I know of three ways to disable/freeze unwanted apps:
Using the command pm disable PACKAGE_OR_COMPONENT
Titanium Backup Pro
Disable the app through the built-in Application Manager (does not work for all apps)
Here's some details I could find about pm disable: http://www.kpbird.com/2013/05/android-shell-command-pm-package-manager.html
But my question to the community: When an app is disabled/frozen by any of these methods, what keeps track of these? Where is this data stored?
If nobody can answer my question above, then I have a different question: Are there any apps/commands that would allow you to view/log filesystem changes on-the-fly? (goal with this: start this "watcher" app, then disable an app using pm, and figure out what changed).
Thanks!
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Aou said:
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Click to expand...
Click to collapse
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
jetlitheone said:
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
Click to expand...
Click to collapse
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Aou said:
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Click to expand...
Click to collapse
Yeah I know what you mean I don't know it might be possible. Only thing I know of is applications that run bash scripts on boot up. But not of running one via a flashable zip in recovery
Sent from my SGH-I337 using Tapatalk 4 Beta
Based on some of the flashable zips out there, I think it's possible to use busybox to execute a bash script. I came up with a little bit of crappy psuedocode for what needs to happen:
Code:
set foundFlag = 0
if (file exists: /system/app/<app>.apk) do:
for (each line of package-restrictions.xml) do:
if ( line = <pkg name="com.wssyncmldm" enabled="1" /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
set foundFlag = 1
else do:
echo line into newfile
end if
end for
if (foundFlag != 1) do:
for (each line of package-restrictions.xml) do:
if ( line = <preferred-activities /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
echo <preferred-activities /> into newfile
else do:
echo line into newfile
end if
end for
end if
move newfile -> package-restrictions.xml
end if
The above would need to be repeated 3 times for the 3 apk's that need to be disabled.
.
Related
Hi there,
I've posted this already in the launcher 8 thread, but I guess it should've gone here from the start since it's a very specific nook question, so here goes:
I've rooted my nook and am running launcher 8 now, I am on 1.5.2 right now but I've tried newer versions too which still work with the old android system running on the nook. The latest 2.6 and 3.0 versions do not work.
I've ran into a problem though: I don't seem to be able to choose launcher 8 as the default launcher when I press the home button.
Is there anything I can do to solve this?
Some pictures attached just to make clear what my problem actually is.
schelleursli said:
Hi there,
I've posted this already in the launcher 8 thread, but I guess it should've gone here from the start since it's a very specific nook question, so here goes:
I've rooted my nook and am running launcher 8 now, I am on 1.5.2 right now but I've tried newer versions too which still work with the old android system running on the nook. The latest 2.6 and 3.0 versions do not work.
I've ran into a problem though: I don't seem to be able to choose launcher 8 as the default launcher when I press the home button.
Is there anything I can do to solve this?
Some pictures attached just to make clear what my problem actually is.
Click to expand...
Click to collapse
It appears from the photographs that your Nook is not recognizing Launcher8 as a launcher app, but instead as a regular app. Are you able to view Launcher8 from ReLaunch's app drawer?
Thanks for the reply, I guess you mean the "All applications" bit in ReLaunch? Then yes, it's there, thats how I start it at the moment.
I've already tried fiddling with the AndroidManifest.xml but I really don't know what I'm doing.
schelleursli said:
Thanks for the reply, I guess you mean the "All applications" bit in ReLaunch? Then yes, it's there, thats how I start it at the moment.
I've already tried fiddling with the AndroidManifest.xml but I really don't know what I'm doing.
Click to expand...
Click to collapse
Yes, "All applications" is ReLaunch's app drawer.
I don't know exactly how to fix this, but let me do some research, and I'll get back to you.
Check the intent-filter's in AndroidManifest.xml
You probably should see something like this:
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You can also try through ADB shell:
Code:
am start -a android.intent.action.MAIN -c android.intent.category.HOME
and see what happens.
Renate NST said:
Check the intent-filter's in AndroidManifest.xml
You probably should see something like this:
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You can also try through ADB shell:
Code:
am start -a android.intent.action.MAIN -c android.intent.category.HOME
and see what happens.
Click to expand...
Click to collapse
Thanks for that, I've tried fiddling with the Manifest but I always either get a non working application with an entry in the Home menu or a working application with no entry in the Home menu to choose as default.
If you feel like having a look, this is the default manifest that is in use by launcher 8: pastebin.com/K8BknQuk (I'm not allowed to post links yet)
I do not have the android sdk installed or anything prepared to run ADB on my nook, I'll look into that at some point if the manifest fiddling doesn't work out.
The AndroidManifest.xml looks fine, which is to be expected.
Maybe you "picked" the wrong application at some point?
That's all in /data/system/packages.xml
Check preferred-activities in there.
You can always delete that whole section, as long as you do it cleanly.
Thanks for the continued help. I've had a look at packages.xml preferred-activities looks like this:
Code:
<preferred-activities>
<item name="com.lx.launcher8/.AnallLauncher" match="100000" set="4">
<set name="com.bn.nook.home/.HomeActivity" />
<set name="com.lx.launcher8/.AnallLauncher" />
<set name="com.lx.launcher8/.Home" />
<set name="com.harasoft.relaunch/.Home" />
<filter>
<action name="android.intent.action.MAIN" />
<cat name="android.intent.category.HOME" />
<cat name="android.intent.category.DEFAULT" />
</filter>
</item>
</preferred-activities>
I can turn off my nook and turn it on again then launcher 8 starts by default, but if I press the "n" button on the nook and then press home on the touch-screen I still only get the choice between ReLaunch and the default nook Home. I've also tried completely resetting my device restoring an old unrooted backup then root it again and set it up from scratch, same problem.
I don't have my nook with me (lost it a few days ago) but I seems to remember seeing a nook manager app that can help program what buttons do what, including the N button. You may have to lose the pop up home/library/shop/search/glowlight/setting thing (you could delegate that function to long press N if you want.) but the app should properly program the N button to start up the launcher 8. I THINK it's the Nook Color Tool? I remember the appropriate app came with the 1337 ROM.
Deafcyclist said:
I don't have my nook with me (lost it a few days ago) but I seems to remember seeing a nook manager app that can help program what buttons do what, including the N button. You may have to lose the pop up home/library/shop/search/glowlight/setting thing (you could delegate that function to long press N if you want.) but the app should properly program the N button to start up the launcher 8. I THINK it's the Nook Color Tool? I remember the appropriate app came with the 1337 ROM.
Click to expand...
Click to collapse
Yep, that's Nook Touch Mod Manager. It comes pre-installed with NookManager and my 1337 ROM, but it can also be installed manually with some modified framework-related .jar files.
Thanks for the tip, sounds like a good workaround for now.
edit: I see I need a running build environment for that, will see if I can get this to work on my virtual machine.
edit2: got it working
Oh, the "n" button?
B&N has that hardwired to do some B&N specific intent.
This problem has been solved many different ways.
My solution is to patch where the problem is, com.android.internal.policy.impl.PhoneWindowManager (in android.policy.jar).
This just makes the "n" key a normal Home key.
Code:
apktool d android.policy.jar -o C:\AP
mergesmali /v C:\AP PhoneWindowManager.smali PhoneWindowManager$HomeButtonHandler.smali
apktool b C:\AP -o android.policy.jar
Check the mergesmali link in the signature, a zip of the patches is there too.
No it was the "Home" menu button you open by pressing the "n" button. But with Nook Touch Mod Manager I've managed to change the behaviour of said "Home" even though Launcher 8 still wasn't shown as a choice. Thanks for all the help.
If I root my S4 - only root, no custom ROM -, will it allow me to write to the external SD card? Or is a custom ROM required for that?
Yes.
The steps:
1. Make sure that you have root access
2. Perform a NANDROID backup to be completely safe
3. Use a root-enabled file manager and navigate to /system/etc/permissions
4. Edit platform.xml and find “WRITE_EXTERNAL_STORAGE“
5. Add an additional group definition for this permission: <group gid=”media_rw” />
6. Save the changes and restart your device
You are now able to write on your external SD card again
Is step 5 put on a separate line? Until I root the phone, I can't see what you are saying to do. Maybe you can cut/paste the specific bit of code?
4. Edit platform.xml and find “WRITE_EXTERNAL_STORAGE“
5. Add an additional group definition for this permission: <group gid=”media_rw” />
Click to expand...
Click to collapse
You need to modify the file /platform.xml
Find the code "WRITE_EXTERNAL_STORAGE".
Then add an additional "Group Definition" for this permission ("write_external_storage"):
-->> <group gid="media_rew" />
.
Hello, when you using phh's GSIs, you may found bugs on auto brightness, battery usage data, etc (e.g: Xiaomi, Huawei, etc.). For this, you can make an overlay files for your mobiles.
Requirements:
framework-res.apk on your stock rom. (It may on /system/framework/framework-res.apk)
apktool (to extract framework-res.apk)
git (to clone repo)
Linux (to build overlay files)
Steps:
1. Fork phhusson/vendor_hardware_overlay on GitHub.
2. Clone Repository which you forked, and make a new branch for your works.
3. Copy a device which similar for your device, and rename it to your own device.
4. Edit <Your device>/Android.mk (Just modify the contents of the brackets, same as below)
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-[Manufacturer of your device]-[Name of your device]
LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)
5. Edit <Your device>/AndroidManifest.xml
Code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.phh.treble.overlay.[Manufacturer of your device].[Name of your device]"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:requiredSystemPropertyName="ro.vendor.build.fingerprint"
android:requiredSystemPropertyValue="+[write as similar format]*"
android:priority="[Take next number of last used]"
android:isStatic="true" />
</manifest>
If you don't know how to take androidriority, you can execute this commands to list priority which used already:
Code:
cd [Path of repository]
find -name AndroidManifest.xml |while read manifest;do packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";echo -e "$priority\t$packagename";done|more
(the single line command split here, just for viewing or making a shell script):
Code:
find -name AndroidManifest.xml |while read manifest;do
packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";
priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";
echo -e "$priority\t$packagename";
done
It will print a list for you (unsorted), and you just take an unused priority.
You can find device fingerprint on /vendor/build.prop, or execute following commands (on your device or adb shell):
Code:
getprop ro.vendor.build.fingerprint
If you can't find ro.vendor.build.fingerprint, you can find ro.vendor.product.name or ro.product.vendor.device, then change android:requiredSystemPropertyName and android:requiredSystemPropertyValue what you found.
Huawei seems to use ro.hw.oemName to detect phone, and others manufacturer maybe have their own detection, too. But it should be unique for other phones with same manufacturer.
(It's NOT recommended unless your device don't have ro.vendor.build.fingerprint.)
6. Extract framework-res.apk with apktool on another side. (to avoid commited by mistake)
7. Replace <Your device>/res/xml/power_profile.xml to which power_profile.xml for your device.
It will on <Extracted framework-res.apk>/res/xml/power_profile.xml.
Or you can find whoever's device tree, it may have this file, too.
8. Edit <Your device>/res/values/config.xml
Find each key on following files what for your device:
Code:
[Extracted framework-res.apk]/res/values/arrays.xml
[Extracted framework-res.apk]/res/values/bools.xml
[Extracted framework-res.apk]/res/values/fractions.xml
[Extracted framework-res.apk]/res/values/integers.xml
And then replace values into <Your device>/res/values/config.xml
9. Add your device into <Path of repository>/overlay.mk
Just write like other lines.
10. Build overlays
Just execute following commands:
Code:
chmod u+x [Path of repository]/build/build.sh
[Path of repository]/build/build.sh
If You get this, Do what it said:
Code:
Please install aapt (apt install aapt should do)
Or if you get this:
Code:
OpenJDK Server VM warning: You have loaded library /root/overlay/vendor_hardware_overlay/build/signapk/libconscrypt_openjdk_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.conscrypt.NativeCrypto.get_cipher_names(Ljava/lang/String;)[Ljava/lang/String;
at org.conscrypt.NativeCrypto.get_cipher_names(Native Method)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:764)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:56)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:49)
at com.android.signapk.SignApk.main(SignApk.java:942)
I have no solution, either. Try to build on another computer.
11. Test overlay with tests.sh and yourself
For general checks (symtax, etc.), just execute following command:
Code:
chmod u+x [Path of repository]/tests/tests.sh
[Path of repository]/tests/tests.sh
You should fix errors what reported for your device, and then restart from step 10.
If it reported errors but not for your device, just ignore it.
When check passed, you can find overlay file on <Path of repository>/build/treble-overlay-<Manufacturer of your device>-<Name of your device>.apk, just copy it into your phone's /system/overlay/, and set permission to rw-r--r-- / 0644.
And then reboot your phone to test your overlay.
12. If it works for your device, don't forget to perform a pull request for phhusson/vendor_hardware_overlay, to support his awesome works.
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
king1990 said:
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
Click to expand...
Click to collapse
Oh...I forgot this, sorry.
Because I haven't encountered this error, so I don't have a way to solve it, either. (I tried to built it on three remote servers only)
And...is it cause segment fault?
Or you can try to install google-android-build-tools instead of aapt. (because I can't find aapt on archlinux but found this)
Very nice guide, thanks!
I'll link it as part of a "how to contribute"
For aapt, there is an aapt included in the git. If it doesn't work for you (like @king1990's segfault), know that the one included in the git has the lowest priority. It will pick up aapt from the system first.
(but then you'll need to have a system-wide aapt).
Or if you have an Android SDK somewhere, you can set your PATH to include it.
Edit: I just realized that what I just described might actually be the issue. If there is a system-wide aapt, it will use the libc++ in the git, which would explain the crash.
I fixed this case in my current git.
If there is a system-wide aapt it will use it.
If for some reason, system-wide aapt isn't suitable, you can run build.sh with --local-aapt to force the use of the in-git aapt (i.e. it will have higher priority than system's so no conflict should happen)
king1990 said:
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
Click to expand...
Click to collapse
Could you check again with latest git?
If it still doesn't work, can you try to call build.sh --local-aapt ?
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for androidriority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?
and thanks again for your great work
king1990 said:
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for androidriority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?
and thanks again for your great work
Click to expand...
Click to collapse
1. For example, Xiaomi Mi 6X has this fingerprint:
xiaomi/wayne/wayne:8.1.0/OPM1.171019.011/8.7.12:user/release-keys/
So you can take xiaomi/wayne to use, and android:requiredSystemPropertyValue will be: +xiaomi/wayne*
2. it will affect to build images, or affect the detection on System. If you got this:
Code:
F: .xxx/AndroidManifest.xml: priority xx conflicts with another manifest
You just take next number and try again, until now priority 53 has been taken (without pull request), you can take priority since 54.
3. Sorry, I don't know for this.
4. Yes, just simply copy and permission change.
king1990 said:
@phhusson Thanks now it working fine and building without faults
Click to expand...
Click to collapse
Cool
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
Click to expand...
Click to collapse
overlays in /system/overlay and /vendor/overlay are the same thing, and on my GSI both are loaded, so yes it affects it.
But if your vendor has a framework-res__auto_generated_rro.apk, you probably don't need an overlay file for your phone, because it's already there.
(Please note that /system/overlay doesn't exist in AOSP, that's a change specific to my ROM, and custom ROMs based on it. AOSP only has /vendor/overlay)
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
king1990 said:
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
Click to expand...
Click to collapse
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
phhusson said:
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
Click to expand...
Click to collapse
for overlay this the extracted files from the overlay apk (my device is Axon7)
The lowest backlight is 10 (once manually edit it to 1 it goes to really dim brightness)
what I don't understand that I already built two GSI ROMs one is DU13 & other Liquid pie both report the same backlight light value at 10 at minimum value but in DU its very dim and in liquid its still bright ?!
The command did not give back any information so I assume we don't extended brightness range.
Thanks
Edit : it was overlay problem , fixed after modifying it
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Copperhead100 said:
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Click to expand...
Click to collapse
I don't have any Huawei phones, sorry.
Maybe you can referrer /Huawei/kirin970/CLT or /Huawei/kirin970/EML, Honor V10 maybe have its OEM name and called "BKL"
Copperhead100 said:
I tried to create an overlay for my Honor View 10 (Berkeley)
Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work
There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?
There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
Click to expand...
Click to collapse
On Huawei, you'll find real power_profile.xml somewhere in /odm or /product. I'd say /product/etc/power_profile.xml
phhusson said:
On Huawei, you'll find real power_profile.xml somewhere in /odm or /product. I'd say /product/etc/power_profile.xml
Click to expand...
Click to collapse
Thanks. It's actually /product/etc/xml/power_profile.xml
There's a new pull request incoming
is it possible to create an overlay in Widows usingGIT for Windows?
JEANRIVERA said:
is it possible to create an overlay in Widows usingGIT for Windows?
Click to expand...
Click to collapse
Yes, you can write source code everywhere (don't forget to replace CRLF to LF), but maybe you should build it on Linux, or you have a way to build it on Windows (e.g.: WSL, Mingw, etc.)
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?
another question
on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?
JEANRIVERA said:
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?
another question
on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?
Click to expand...
Click to collapse
framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).
and step 5, just replace values which for your device, like what other devices wrote.
minadzuki said:
framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).
and step 5, just replace values which for your device, like what other devices wrote.
Click to expand...
Click to collapse
thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?
to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+
JEANRIVERA said:
thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?
to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+
Click to expand...
Click to collapse
you can check like this:
https://github.com/phhusson/vendor_hardware_overlay/blob/master/Xiaomi/Mi8/res/values/config.xml
then take values from those 4 xmls.
I have been saving this for a while because it can be a headache when you forget about it. Also this seems to stop at least one headache now that most of have TWRP.
Basically Amazon removed a permission from the platform.xml that allows apps to write to and be moved to external storage (sdcard) PROPERLY.
There is a couple of cons to this (isn't there always lol). When you uninstall an app, the data will persist in the external storage which means you have to delete it manually. This can be a headache if you forget about this and need to reflash stock. So make sure to format your card before doing that.
The second con is you have to make sure all of the toggles for Amazon's external storage settings are turned off. So if you have Amazon apps still installed, they're going to get lost. Just delete them, their data folders and sideload them from adb from somewhere like APK Mirror (some are in the play store).
Instructions:
1. With a root explorer, navigate to /system/etc/permissions and open platform.xml in the native text editor, or copy the file to your sdcard then to PC and open it in Notepad++.
2. Look for the following permission: WRITE_EXTERNAL_STORAGE and add the following line to the with the others, above sdcard_r:
Code:
<group gid="media_rw" />
3. Look for the permission WRITE_MEDIA_STORAGE and add the following line under media_rw:
Code:
<group gid="sdcard_rw" />
4. Save the file and reboot to recovery and wipe the cache. Reboot the device. If you have flash fire working, wipe the dalvik and cache through the app.
5. Now you have the ability to use nearly all of your available storage, without anything screaming at you every few minutes. Thank me by hitting the thumbs up button a million times and get rid of that bottle of aspirin.
Hi everyone,
I have a Nook GlowLight 3. I don't like the default screensavers, so I'd like to delete them and (optionally) put in some new ones. Is this possible?
Maybe it's just a matter of getting into the Nook's file system and replacing their image files with my own (with the same filenames)?
This Nook is new. I don't mind voiding the warranty, but I'd rather not unless I know it will be worthwhile. Otherwise, I would try it myself. So I'm hoping some kind soul who has a NGL3 that they have already broken into would be willing to take a look at it for me.
Please let me know if I can help! Thank you!!
Robert
I've got too many Nooks and I'm far removed from stock.
Do you have a directory /data/sleep/
That used to have PNGs for some standby images.
Do you currently have the old, creepy authors?
I have not rooted it or anything yet, just plugged it into my Mac and looked at the default directories it comes with. There is basically nothing there– I even had to research online and experiment how to just create a directory where I could sideload a PDF. So, no, I haven't seen any directory like you mentioned. And I'm not sure what you mean about the old authors(?). The screensavers I have are Symbols and Quotes. In any case, this is my first Nook, and it's less than a week old.
So, do you think there is a good chance I could make changes to the stock screensavers?
The "old, creepy authors" were the screensavers that made the Brontë sisters look like the witches out of Macbeth.
These images are all packed away in /system/priv-app/partner.apk in res/drawable-mdpi-v4/
Code:
artboard_1.png
artboard_2.png
artboard_3.png
artboard_4.png
artboard_5.png
artboard_6.png
artboard_7.png
artboard_8.png
alexander_pope.png
chinese_proverb_00.png
cicero.png
jane_austen.png
john_wilson.png
lady_mary_montagu.png
louisa_alcott.png
robert_southey.png
thomas_jefferson.png
thomas_kempis.png
The list of images is in res/values/arrays.xml in quotes_imgs and symbols_imgs
The actual screensaver mechanism is com.nook.partner.screensaver.ScreenSaver (in partner.apk).
If you repack that all it won't have a B&N signature
I'm not sure how much that will break things.
In worst case you could resign everything.
I think that I'd just rewrite ScreenSaver to fetch PNGs from a directory like /data/sleep
That way, changing the collection would be easier.
Oh, and another thing...
As always, the sloppiness of B&N gets to me.
Those "quote" image files are ten times the size of the "symbol" image files.
Why? Because they have a very subtle dithering to the backgrounds.
It's nothing that you can see even on a regular LCD monitor, let alone on a black & white eInk panel with 16 shades.
So the file is basically trying to compress random noise. That doesn't work out well.
Below is what you get when you use the fill tool (red) in MS Paint on the image.
It leaves holes because the adjacent pixels aren't exactly the same value.
Oh, yes: I remember those goofy portraits.
OK, thank you– I really appreciate your help! I am excited to try this out when I can snag some free time. I will try to post what happened, too.
OK, I was able to pull that partner.apk file to my Mac, and unzip it. The images are there. Awesome!
So, I'm temped to create my own B&W/greyscale pngs, with the same dimensions, and give them the same file names. Then put them in the same locations, rezip (with an apk extension), and push it into place. I know it will have a different file size, etc, but do you think that will be a problem? Normally I'd just try it, but I'm trying to err on the side of caution.
Thanks!
Newtham said:
rezip (with an apk extension), and push it into place.
Click to expand...
Click to collapse
Yes, it should work.
There doesn't seem to be any problem with signatures.
I modified all my images for fun and it didn't break anything.
(Although, I've hacked so much stuff on this that the screensaver never activate. This is not my primary reading device.)
It must have some signature (the originals will do) or it won't be acknowledged as an APK.
Make sure that you keep the original file as a backup.
I'm still new to this, so basic question: what is a signature (in this case) and how do I create or modify it?
Thanks!
Newtham said:
What is a signature...
Click to expand...
Click to collapse
Signatures are the three (or more) files in the META-INF directory in the zip (apk).
If they are there, that's fine.
To learn about apk signing Google it.
@Newtham
Oh! I figured something out. I looked through the code.
If you just want to have one screensaver of your own (which you could manually change).
All you have to do is change some undocumented settings.
File: /data/data/com.nook.partner/shared_prefs/screen_saver_preference.xml
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
[color=red]<boolean name="pref_key_screen_saver_from_sdcard" value="true" />
<string name="pref_key_screen_saver_from_path">/sdcard/sleep.png</string>[/color]
<boolean name="pref_key_screen_saver_low_power" value="false" />
<int name="key_screensaver_img_index" value="8" />
</map>
OK, awesome, thanks!
About a week ago, I tried just modifying the image files, rezipping & renaming to apk, and pushing into place, but I didn't modify the signatures. So now I'm stuck on the boot screen. (I forced it off in the meantime, but since it's e-ink, its still showing the boot screen.)
I can still see it on the command line via adb, but I no longer have write permission so I can't push the original apk back into place. So that's my next task. I haven't had time to play with it since then. It's fun playing with this, I just wish I had more time.
Newtham said:
I no longer have write permission...
Click to expand...
Click to collapse
Well, you did it once, it's just a question of making /system rw:
Code:
# mount -o rw,remount /system
One of the silly things that B&N did was making the "screensaver" and the "wallpaper" the same thing.
I'll have to write some code to make them separate things.
Lol! As I dived into this I realized that I had been all over this ground before.
The stuff I wrote in https://forum.xda-developers.com/showpost.php?p=79994025&postcount=11 about using settings to disable the B&N wallpaper is true but not necessary.
You can disable all that silliness with:
Code:
# pm disable com.nook.partner/.daydream.DayDream
You can set a simple white wallpaper using my Wallpaper.apk app available in the signature
The wallpaper only appears as a background to a launcher (or any app that has no background).
The Glow3 4.7 & Glow4 5.0 both broke the Wallpaper, you need a separate patch for that, see below.
I had previously made a patch to cycle through user supplied PNGs as a lock screen.
That patch is available in the signature as nook45patch.zip
Code:
C:\> adb pull /system/framework/android.policy.jar
C:\> apktool d android.policy.jar -o AP
C:\> mergesmali /v \AP\smali Screen.smali
C:\> apktool b AP -o android.policy.jar
Then replace android.policy.jar and delete/backup/rename/whatever android.policy.odex
Then stuff your PNGs in /data/sleep
Erm, I think this mostly applies to Glow2 4.5
I'll look more closely at Glow3 4.7
glow45patch.zip works fine on the Glow3 4.7 & Glow4 5.0
So, the nook45patch.zip works fine on the Glow3 4.7
I kind of confused myself, strange things happen if you have no images in data/sleep.
I'll look into that too.
The Glow3 & Glow4 have this problem where B&N stole the functionality of wallpaper for sleep screen.
The background on launchers appears black even though the Wallpaper API changes /data/system/users/0/wallpaper correctly.
I should be able to solve this one too.
There was a minor bug in the old patch.
It would barf if you didn't have any user images.
The new glow45patch.zip is in the signature under mergesmali.
The aforementioned glow45patch.zip is a valid patch for Glow3 4.7 too.
There is also the issue of the black Wallpaper on Glow3 4.7 when using a stock Launcher.
Does anybody else have this/notice it/care?
With 4.7 B&N got rid of /system/priv-app/SystemUI.apk and put it all into /system/priv-app/partner.apk
This necessitated a change in the WallpaperManager since it's all a different package.
The actual ImageWallpaper.DrawableEngine.drawFrame() is a bit complicated.
I couldn't (be bothered to) figure out how it was supposed to work and where it was failing.
To my taste, anything other than solid white wallpaper on an eInk device is just distracting.
I wrote a small patch to make drawFrame() just drawColor() instead of scaling and rotating Wallpapers.
Is there any interest in that?
I have been working on this, but I can't get write access via adb anymore. I have tried everything I can think of, including your suggestion above. I can log in to the adb shell and run as root and make changes there. But anytime I try to push anything with adb, it tells me it is read-only. When I run rootnook.sh, it tells me I'm already rooted, but no superSU found (and then roots again, with no different results). adb root doesn't work, either.
The only major thing that's changed recently is that I installed the latest nook update, which I thought would be a good idea before I start hacking. Maybe that messed it up.
I'm stumped (which is not difficult to do...). Any suggestion on how to get back in there?
Thanks!
You probably de-rooted yourself.
Does adb shell give a # prompt?
Does the shell command "id" tell that you are root?
Does the shell command "mount" tell you that /system is rw?
Does the shell command "getprop ro.secure" say 0 (security is off)?
When in doubt, push to sdcard and then copy (cp) to where it should be.
Thanks! Moving it to sdcard did the trick.
I unpacked the apk with apktool, edited the images directly (didn't change the file names), repacked it with apktool, and then (finally, by using the sdcard directory) got it back to the Nook. And then copied it into place. But I still get the same results: the GUI gets stuck on the boot screen.
So, do you think this has to do with signing the apk file? I did a lot of research on it, but mostly what I found was how to sign your own file, not someone else's. Do you have any tips on how I can do this (if that's what's needed)? Thanks!!
(P.S. Thanks for the info on the glow45patch. I haven't had a chance to look at it too closely yet, but it looks interesting. I'd still like to mod the actual pics, though, if I can.)