Enabling just Night Light in framework-res - Nexus 6P Q&A, Help & Troubleshooting

Hello everyone, I was looking to just enable Night Light on our 6P instead of having the whole Pixel experience.
So I read a few things about implementing night light, https://source.android.com/devices/tech/display/night-light
I found that config xml and edited from the android-7.1.2_r4 AOSP repo and made a modified framework-res.apk.
When I push the apk to my phone it gets stuck at the boot animation. I've tried both 755 and 644 file permissions on it.
I suppose this might not be the way to do it, but are there more specific changes I need to do instead when I want to build the framework-res.apk for the 6P?
Also, I didn't change the default manifest XML before syncing the repo.
And entered: lunch aosp_angler-userdebug
Any insight is very much appreciated!

Okey, so I definitely overlooked this, but all you need to do is decompile framework-res.apk and goto values/bool.xml and then locate the 2nd line regarding 'night' and change from false to true. Then recompile, push and reboot!

Do you mind doing a step by step?
Sent from my Nexus 6P using XDA-Developers Legacy app

+1 for step-by-step. Root is needed or no?

lilgrass71 said:
Do you mind doing a step by step?
Click to expand...
Click to collapse
forzdaZE96 said:
+1 for step-by-step. Root is needed or no?
Click to expand...
Click to collapse
His last post is a step by step. There's plenty of guides on XDA on how to decompile an app. If you're not sure where to look, just Google "XDA how to decompile an app."
Not trying to be rude, but you're basically asking OP to write up an entire guide here for you when plenty of them already exist. Good luck.

Sorry, this may be a dumb question...
If I were to make this modification, would this prevent me from applying system updates via FlashFire? Or will a system update via FlashFire just remove this modification and require me to apply it again?

Related

[REQ] Pays black bar and icons for CM 5.0.8

Now that we have a CyanogenMOD 5.0.8 on Desire, I am missing black bar and great icons from Pays...
I tried editing framework-res.apk myself but for some reason, after editing, signing, pushing and rebooting, I get FC on every single app on my phone. I don't have problems signing other apks.
Could somebody please edit this, shouldn't be too much work with the right procedure...
THANKS!
you don't have to sign it actually if you adb push it, I never sign it. Just be careful that images are the same resolution and especially look at the 9.png files cause they're not that simple to edit. Is the rom deodexed?
nikosrs4 said:
you don't have to sign it actually if you adb push it, I never sign it. Just be careful that images are the same resolution and especially look at the 9.png files cause they're not that simple to edit. Is the rom deodexed?
Click to expand...
Click to collapse
End up in a boot cycle if I don't sign. Didn't touch *.9.png's
Yes, rom is deodexed. Could signer be the problem? This is not the first ROM i had problems with framework-res....
did you change the permissions? chmod etc?
could you post the stock framework-res.apk?
No, m8, no chmod, chown or anything, just pushed it... Does it have to have specific permissions? I am just about to upload it...
EDIT: Uploaded
View attachment framework-res.apk
well, I use chmod 644.
also check this, I found it now. http://forum.xda-developers.com/showthread.php?t=695701
I changed the battery icons with some I know that work on mine. plz chmod 644 after you adb push it, then we'll know..
http://forum.xda-developers.com/showpost.php?p=6456982&postcount=14
Sorry for responding so late. Will give it a go this weekend (hopefully) and will let you know the results. Thanks!
Thank you! Finally got chance to try it and yes, right permissions was the cause for my trouble.

Flashlight Preinstalled in Vodafone Froyo release

Hi,
Can anybody extract the APK for the LED Torch app preinstalled in Froyo?
I saw that the one include with Froyo on the Desire works with a Desire with Eclair. (But doesn't work with my Legend) So I would like to check if the one included in Froyo for the Legend will also work with the Legend on Eclair.
The package name is com.htc.flashlight
Thanks!
U don't have to wait....
Try this APP: Lamppu
But first u have to (Soft)root your Legend with (Universal Androot)
After that, install superuser APP. Now start Lamppu and allow superuser rights...
Now u can use your LED as torch.
Tried it self on my legend v.2.1
Sure about the name?
The only thing I found in the Modaco ROM was Flashlight.apk
Then again...I have no clue what I am doing
above file is not working
Yeah it doesn't install
Ok gentlemen, one more try.
Extracted, re-zipped and signed the apk using apk-manager.
Removed the system app from my phone using TitaniumBackup and installed the signed apk through Root Explorer.
Works for me. No guarantee that it does for any other ROM or Android version though.
Sorry for the video but I just found out how to do screencasts and love it
Its German but you should be able to understand it.
Notice that it is now uninstallable and listed as downloaded app.
denisman said:
Ok gentlemen, one more try.
Extracted, re-zipped and signed the apk using apk-manager.
Removed the system app from my phone using TitaniumBackup and installed the signed apk through Root Explorer.
Works for me. No guarantee that it does for any other ROM or Android version though.
Click to expand...
Click to collapse
Installed and ran for me in stock 2.1 but it didn't do anything with the flash when playing with it
Thanks for trying!
This one is installing correctly, and also loading correctly, but it doesn't light up the LED.
So it isn't working
Are you phones rooted?
First of all, you have to have deodexed apk and second, you need to set right permissions in sysfs.
Sent from my HTC Legend
BlaY0 said:
First of all, you have to have deodexed apk and second, you need to set right permissions in sysfs.
Sent from my HTC Legend
Click to expand...
Click to collapse
The apk is deodexed. As for the permissions. No clue how to set them right
Had to read up an hour last night just to learn enough to extract it. Big newbie here hehe. Guess I'll check some threads about sysfs permissions and try it again later.
Sysfs is everything under /sys directory. File /sys/class/leds/flashlight/brightnes should have read-write permission set for everyone.
Sent from my HTC Legend
BlaY0 said:
Sysfs is everything under /sys directory. File /sys/class/leds/flashlight/brightnes should have read-write permission set for everyone.
Sent from my HTC Legend
Click to expand...
Click to collapse
Ahhh thanks! I guess I understand now.
Ok I just flashed whitetigerdk's rev03 ROM which is a rooted 2.03 ROM.
Than I did the following in adb shell:
Code:
chmod 777 /sys/class/leds/flashlight/brightness
checked permissions with:
Code:
cd /sys/class/leds/flashlight
ls -l
and it has rw permission for everyone now.
Code:
-rwxrwxrwx root root 4096 2010-12-01 16:29 brightness
Problem is, that booting the phone resets the permissions.
EDIT:
I just repeated the procedure while the phone was booted in normal mode.
Permissions successfully changed AND flashlight is working correctly, including all three different light settings!
Still, a reboot resets the permissions.
Guess I have to find a way to make this change permanent now and all is done
Hah so cool. Never used chmod or any other linux command until today. Had to google everything while I was testing. Nice how much one can learn here.
Another EDIT:
Found something else that is interesting.
http://developer.android.com/reference/android/Manifest.permission.html#FLASHLIGHT
Would adding this to the AndroidManifest.xml help aswell? I'd do it myself but I have to work soon. Just tried it decoding the xml with AXMLPrinter and adding it. Unfortunatly I don't know how to save the xml in the right format again and just saving it corrupts the apk. If noone else wants to give it a try I'll check back after work.
denisman said:
Still, a reboot resets the permissions.
Click to expand...
Click to collapse
Yeah... this is done via init.rc which is inside initrd image. So you have two options... tweak init.rc (you would need to unpack boot.img image and extract initrd image, edit init.rc, make new initrd image and construct back boot.img... this can all be done in one swoop with dsixda's kitchen) or make a script that is run every boot (we are doing it via run-parts which also requires editing of init.rc... once again dsixda's kitchen can add this functionality in a single swoop)...
As for "android.permission.FLASHLIGHT" I'm not sure about it as I can see that HTC is doing it avoiding it (setting permissions to 666 by default in FroYo)...
If you want decoding/encoding xmls use ApkManager. It's a nice CLI tool that can decompile and compile apks back...
You are quite a fast learner, congrats.
Back home Got pretty late.
I don't actually need this since I am running a rooted Froyo ROM anyways but thought it would be an interesting task to get this working for others to easily use it and for me to learn more about Android. The first option sounds like it would require a bit too much end-user activity and would be limited to a certain set of ROMs if I understand it correctly.
Leaving the second and third option as the most user-friendly ones I guess.
I will read up more on init.rc and ways to script for it tomorrow. Sounds like a very powerful "tool" to know.
For now I will concentrate on the XML. Might be the most comfortable and ROM-independent way if I get it to work.
BlaY0 said:
As for "android.permission.FLASHLIGHT" I'm not sure about it as I can see that HTC is doing it avoiding it (setting permissions to 666 by default in FroYo)...
If you want decoding/encoding xmls use ApkManager. It's a nice CLI tool that can decompile and compile apks back...
Click to expand...
Click to collapse
Used Apk Manager to extract, zip and sign the apk in the first place. Really nice tool. Just didn't find an option to convert the xml from binary to readable, that's why I used AXMLPrinter2.jar which can do the conversion one-way but not back to binary.
I'll find a way
Thanks again for the input! Helped me a lot!

[GUIDE] Remove Blocking Mode notification (root/deodexed Samsung ROM required)

First off, this is my very FIRST publically posted Android mod, and my second one ever - I made the first one earlier today. In other words, I'm new and may make mistakes.
These steps work for me, though!
Exactly what this guide does:
When you enable "Blocking mode" in the Samsung JB ROMs, an "ongoing" (and thus unremovable) notification is shown AT ALL TIMES, even if Blocking mode is only active for a certain time period (at night in my case).
This mod will entirely remove that notification. It will not show up even when blocking mode IS in fact blocking calls etc.
IMO the ideal behavior would be to show it during the time it's active, but that would be a much harder mod to make, as you'd need to add new (byte)code.
Now, with that out of the way...
Requirements:
* DEODEXED AND ROOTED Samsung Jelly Bean ROM (I use WanamLite XXDLIH v3.9, google it - I can't post the link)
* 7-zip (google it)
* Galaxy S III - not sure if other models than the i9300 will work, my guess is that they will. I can't test on other phones than my own, though, so you're on your own in that case! Also no idea if Note models will work, I've never used one.
* A Windows computer - unless the tools are available for other platforms.
* Java -- if you can do Start -> Run -> "java" -> OK without an error, you should be fine.
* A bit of patience
As always, this is on your own risk!
Steps to hack:
0) BACK UP YOUR PHONE! My suggestion would be to take a nandroid backup before getting started.
1) Get an apktool that works with JB APKs.
Here's the one I use (assemble the link): mediafire . com / ?ufzdylekbkloffy
(Sorry for doing that, but surely posting guides constitutes making helpful contributions? )
The ZIP contains two apktool versions, one for decoding and one for building.
Thing is, I'm not 100% sure on where I got the apktool JARs. I think one of them is the unmodified 1.4.2 JAR, and one is modified to work with ICS (and newer) APKs.
I couldn't get EITHER of them to both decode AND build, so I made two separate batch scripts.
I do promise that the thing's safe, but if you don't trust me, you can find them elsewhere - I'm just not sure exactly where. I found them by trial and error.
2) Unpack the tools to a directory, e.g. "apktool" on your desktop. (If you want to follow this guide to the letter, you need to use that folder too.)
3) Start a command prompt - Start -> Run -> enter "cmd" -> click OK
4) Connect your phone via USB, and make sure USB debugging is enabled on it (under Settings -> Developer Options)
5) Enter the following commands, exactly as specified, in order of course:
Code:
cd Desktop\apktool
adb pull /system/framework/framework-res.apk
java -jar apktool-BUILD.jar if framework-res.apk
adb pull /system/app/SecSettings.apk
apktool-d SecSettings.apk SecSettings-mod
You should now have a "SecSettings-mod" directory (under Desktop\apktool) with the contents of the APK.
6) Browse to SecSettings-mod\smali\com\android\settings\dormantmode, right-click "DormantModeNotiReceiver.smali" and Open With... -> Notepad (or right-click and "Edit", if that choice exists)
7) Click the Edit menu -> Find..., and search for "notificationCreate" (no quotes). The first hit should be ".method public notificationCreate [... etc]"; click Find Next.
The next hit should be something like
Code:
invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/Context;)V
8) Comment that line out by adding a # as the very first character, so you end up with
Code:
# invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/Context;)V
9) A few lines down (10 or so), there's another invoke-virtual, for notificationClear. Comment this out as well, aagin by adding a # as the first character on the line.
When you're done, save and exit.
10) OK, we're getting there. Time to rebuild the modded APK.
Go back to the command prompt (or start a new one, see above).
Run this command:
Code:
apktool-b SecSettings-mod SecSettings-new.apk
This may take a LONG while, it takes a bit over 11 minutes for me (nearly all of it to build resources). Be patient!
When it's completed, open up both the ORIGINAL .apk and the modded one in separate 7-zip windows. Delete "AndroidManifest.xml" from the modified apk, then select and copy "META-INF" and "AndroidManifest.xml" from the original to the modified APK. Exit 7-zip.
11) Time to get the modded file over to your phone! Run these commands:
Code:
adb remount
adb push SecSettings-new.apk /system/app
adb shell
12) You should now have the file on your phone, and have an adb shell open. Almost there!
If you're not root (i.e. if the command line ends with $ rather than #), run "su".
Then:
Code:
cd /system/app
mv SecSettings.apk SecSettings.apk.OLD
mv SecSettings-new.apk SecSettings.apk
... and you're finally DONE, if all went well.
"exit" the adb shell, and reboot your phone. When it boots up, the notification should be gone, but blocking mode still works.
Let me know if you have problems, and we'll see if I'm qualified to help solve them.
Before
After
(I would show that blocking mode is active, but the toggle was offscreen in the "before" shot, and I don't want to revert to snap a new one!)
I've also modded away the brightness bar + rearranged the quick-setting icons via this guide - the steps are essentially the same as this guide, except you edit SystemUI.apk and change different files (two XML files instead of the .smali).
To get rid of the brightness bar, follow that guide but also look in values/bools.xml where you can change a brightness value and auto-brightness-button to false. (Change both!)
Great work, Does anyvbody have this as a flashable zip??
carrd said:
Great work, Does anyvbody have this as a flashable zip??
Click to expand...
Click to collapse
Hmm, I'm not sure whether simply using the finished SecSettings.apk is a good idea or not. If a ROM has changed it, those changes would be lost.
The alternative might be to have all this done by a script on the phone (in CWM), but I'm not sure whether that's possible or not. Anyone?
exscape said:
Hmm, I'm not sure whether simply using the finished SecSettings.apk is a good idea or not. If a ROM has changed it, those changes would be lost.
The alternative might be to have all this done by a script on the phone (in CWM), but I'm not sure whether that's possible or not. Anyone?
Click to expand...
Click to collapse
Here's a CW Zip. I've built this based on the XXDLIH build one.
The script will backup the original file to /system/app/SecSettings.apk.orig so worse case scenario you just need to rename it using a root explorer (any will do).
Let me know, however like anything you flash with CWM, make a backup FIRST and I'm not to be held responsible for your phone becoming Self Aware or owt.
Also, The guide at the top is basically right, however there's a lot of steps missing, I'll knock something up if anyone wants it to fill in the gaps (setting up the environment for a start etc).
However this 'should' work on all XXDLIH builds (but AFAICT should work on XXDLIB as well)
Here's the link to the file https://www.dropbox.com/s/kov1bdluu0pt8x8/Blocking_Mode_Icon_Remover.zip
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
No probs, anything to help.
Thanks to exscape for the source.
the_ape said:
Also, The guide at the top is basically right, however there's a lot of steps missing, I'll knock something up if anyone wants it to fill in the gaps (setting up the environment for a start etc).
Click to expand...
Click to collapse
Hmm, which environment? All the files (adb, apktool + their dependencies) should be included.
Anyway, thanks for the zip
exscape said:
Hmm, which environment? All the files (adb, apktool + their dependencies) should be included.
Anyway, thanks for the zip
Click to expand...
Click to collapse
You need to pull the various frameworks from the device, and put them in the right place. This is all documented elsewhere on the site, but for quickness sake, here's a down and dirty.
Download the 7Z Below (latest versions of aapt etc from http://forum.xda-developers.com/showthread.php?t=1792937), unpack them somewhere. Make sure Jave JRE is installed.
To pull from device, plug the Phone in then
Goto unpack folder
Let's get the frameworks from the device, so plugin the device, and ADB Devices and make sure you get a deviceID back.
pull_framework.bat
pull_twframework.bat
Now get the frameworks installed
set_framework-res.bat
set_twframework.res.bat
Let's get the APK we want to work with, so....
adb pull /system/app/SecSettings.apk .\apk\SecSettings.apk
OK, file in the right place, so let's get it unpacked to work with.
apktool d apk\SecSettings.apk working\SecSettings
That will take a few minutes, as it's got to sort out the framework dependencies etc, so give it a second or two. It should then look a little like the following
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\YourUserName\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Now lets edit the smali for the fix (thanks to exscape for this, so click his thanks button)
notepad .\working\SecSettings\smali\com\android\settings\dormantmode\DormantModeNotiReceiver.smali
<CTRL>-F notificationCreate
Find Next one
change invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/ContextV
to
#invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/ContextV
and a bit further down
change invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationClear(Landroid/content/ContextV
to
#invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationClear(Landroid/content/ContextV
OK, edit done, save and back to the command prompt
start .\apk
Open the APK in 7-Zip/WinRar/Whatnot
Select the AndroidManifest.xml and the META-INF folder, and extract them to the working folder
We have all our bits, so let's put it back together in a usable APK
First we need to create an unsigned build (without the real manifest and META-INF)
apktool b working\SecSettings built\SecSettings-Unsigned.apk
This will take a while to run, as it's compiling everything it needs, should look a bit like this
: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Right, now we need a signed version, so copy the manifest XML and META-INF folders to \build\apk in the SecSettings folder.
move .\working\AndroidManifest.xml .\working\SecSettings\build\apk
move .\working\META-INF .\working\SecSettings\build\apk
Let's now compile the nice signed version, this will take moments, as it's just integrating the Manifest with the already compiled stuff.
apktool b working\SecSettings built\SecSettings.apk
And there we are, job done.
Copy to device in any way that you want, easiest is probably
adb push .\built\SecSettings.apk /system/app/SecSettings.apk
Remember that will overwrite the original (but you have a backup in the APK folder remember), just launch settings now on the device and you should be good to go.
Having said that, easier just to flash the zip
Ohh, I forgot the framework step. Sorry about that. I changed step #5 to include it now.
That's all I've done as far as frameworks go, and I've both used the guide myself (before I wrote it ) and tried it once after... So it should work now.
exscape said:
Ohh, I forgot the framework step. Sorry about that. I changed step #5 to include it now.
That's all I've done as far as frameworks go, and I've both used the guide myself (before I wrote it ) and tried it once after... So it should work now.
Click to expand...
Click to collapse
You will deffo need the TW Framework as well, else it wont be able to decompile. If you want to make sure, try
rd /s %userprofile%\apktool
Then try the process you have out, and you should get issues as the twframework is not available
the_ape said:
You will deffo need the TW Framework as well, else it wont be able to decompile.
Click to expand...
Click to collapse
I just deleted the entire \Users\x\apktool folder, re-added framework-res and decompiled the SecSettings APK with no errors. I'm sure I've never used the 'apktool if' command with anything else prior, too. Hmm.
mocas said:
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
exscape said:
I just deleted the entire \Users\x\apktool folder, re-added framework-res and decompiled the SecSettings APK with no errors. I'm sure I've never used the 'apktool if' command with anything else prior, too. Hmm.
Click to expand...
Click to collapse
Cool, just making sure, if it works then cracking.
However setting up the fw's that way is the 'correct way' to do them.
hi again, is it possible for u to make a flashable zip with remove blocking mode and smart rotation?
when i install smart rotation i lose blocking mode and vice versa. thanks a lote.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
hi again, is it possible for u to make a flashable zip with remove blocking mode and smart rotation?
when i install smart rotation i lose blocking mode and vice versa. thanks a lote.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
I can certainly have a look, can you post a link to the rotation hack your using please?
Sorted, I'll compile and upload shortly, not a problem.
here is the link, thanks a lot again.
http://forum.xda-developers.com/showthread.php?t=1933519
Sent from my GT-I9300 using Tapatalk 2
mocas said:
here is the link, thanks a lot again.
http://forum.xda-developers.com/showthread.php?t=1933519
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Here we go, https://www.dropbox.com/s/mtycq38lfw3sl4z/Blocking_Mode_Icon_Remover_With_Smart_Rotate-DLIH.zip
Should work just fine, works Fine on mine anyhow.
Let me know if there's issue, and click thanks if you appreciate
thanks a lot, no issues what so ever... every thing went just fine.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
thanks a lot, no issues what so ever... every thing went just fine.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Most welcome
Would this excellent mod work on a Note II, by any chance?

Apktool problem MIUI v5

Hello to all devs
If someone can help me I would be very gratefull.
What I`m trying to do is to edit the values for screen brightness in framework-res.apk .
The problem is that after decompiling ,edit the values (values/array.xml) ,compiling and push to system/framework, after reboot the phone won`t boot anymore.It just stucks at the finish of the bootanimation.
So...please...can someone help me?
Do you get any warnings/errors while compiling? You could also try vrtheme instead of modding the apk.
Sent from my Nexus⁴ using Tapatalk 4 Beta
TToivanen said:
Do you get any warnings/errors while compiling? You could also try vrtheme instead of modding the apk.
Sent from my Nexus⁴ using Tapatalk 4 Beta
Click to expand...
Click to collapse
I installed the miui framework and other dependecies and succsessfully compile a new framework-res.apk.
The problem is that after I push the modded framework to system/framework and reboot the system won`t boot anymore.I don`t like how MIUI Team set the values for brightness.It`s too dark for me.And I wanted to "light" the display without any 3rd app from market.
aresbv2000 said:
I installed the miui framework and other dependecies and succsessfully compile a new framework-res.apk.
The problem is that after I push the modded framework to system/framework and reboot the system won`t boot anymore.I don`t like how MIUI Team set the values for brightness.It`s too dark for me.And I wanted to "light" the display without any 3rd app from market.
Click to expand...
Click to collapse
Did you set permissions after pushing? Making a flashable zip may be a good idea.
Sent from my Nexus⁴ using Tapatalk 4 Beta
TToivanen said:
Did you set permissions after pushing? Making a flashable zip may be a good idea.
Sent from my Nexus⁴ using Tapatalk 4 Beta
Click to expand...
Click to collapse
The permissions were set like this:
adb shell
cd system/framework/framework-res.apk
chmod 644 framework-res.apk
Before restart i`ve checked if the permissions were right and they do.
I don`t know where the problem is
aresbv2000 said:
The permissions were set like this:
adb shell
cd system/framework/framework-res.apk
chmod 644 framework-res.apk
Before restart i`ve checked if the permissions were right and they do.
I don`t know where the problem is
Click to expand...
Click to collapse
Hm, seems fine to me.
Can you please upload the modded apk and tell me which file you edited? Imma make a vrtheme zip for you to try.
Sent from my Nexus⁴ using Tapatalk 4 Beta
Here is the two files (framework-res.apk and framework-miui-res.apk). If you have free time and want to give a try,maybe you will manage to do it right.Edit anything in the values/array.xml and I will test to see if it works.
framework-res.apk
framework-miui-res.apk
I run on my laptop Windows 7 x64.Maybe this is the problem.But if the compiling is fine...i think this is not the problem.Maybe the signature of the apk or something like that would be the problem.
Thank you for your interest.
@aresbv2000
Here you go
The zip does not replace the entire apk. It sorta injects the arrays.xml into frameworks-res.apk. I've set every auto brightness step to 250 in order to easily find out if it works. If your screen lights up 100% after enabling autobrightness, the zip worked.
Then you must open the zip using and replace my proof-of-concept arrays.xml with your own.
Cheers!
TToivanen said:
@aresbv2000
Here you go
The zip does not replace the entire apk. It sorta injects the arrays.xml into frameworks-res.apk. I've set every auto brightness step to 250 in order to easily find out if it works. If your screen lights up 100% after enabling autobrightness, the zip worked.
Then you must open the zip using and replace my proof-of-concept arrays.xml with your own.
Cheers!
Click to expand...
Click to collapse
ok....thank you so much.i will install the zip as you made it.i will report to you if it worked.
please if you have time check this thread later to see if i posted any question for you.
thank you again
it is not working my friend
the screen stays the same as usual....too dimm.
i don`t know why but if i use velis autobrightness it seems that the color tones are changing also.and i spent a week just to calibrate my display the way I like it .thank you so much for your effort.i appreciate your efforts.
After a few hours and a lot of nervs i`ve succsessfully edited the values in array.xml, compile....and VOILA>>>it worked.
It took me some time to figure out what values should I set, but now is way better than was before.
All the credis goes to this and to you for your tips.
Thank you.
Forum moderator can delete this thread as the problem is solved
aresbv2000 said:
After a few hours and a lot of nervs i`ve succsessfully edited the values in array.xml, compile....and VOILA>>>it worked.
It took me some time to figure out what values should I set, but now is way better than was before.
All the credis goes to this and to you for your tips.
Thank you.
Forum moderator can delete this thread as the problem is solved
Click to expand...
Click to collapse
Sweet. I'm glad you figured it out
Sent from my Nexus⁴ using Tapatalk 4 Beta

[Guide][How to] Dynamic Nav Bar for Nougat

I don't understand why this isn't a feature of stock Android. They did it with the notification bar, but why not the navigation bar? The main reason for doing this is to prevent the navigation bar from being burned into your screen. There are Xposed modules for Lollipop/Marshmallow that do this exact same thing, making this mod unnecessary on those versions of Android. Since there's no Xposed for Nougat (or if you don't like using Xposed on Lollipop/Marshmallow), doing this mod will make your navigation bar dynamically change color to match your notification bar.
***Please Note***
This isn't perfect. In applications like Google Messenger the navigation bar doesn't change to match the color of the contact you're texting, but it's better than nothing.
Prerequisites:
- Nexus 6 with USB debugging enabled in developer settings
- TWRP
- ADB fully setup and functional
- Text editor (gedit (Linux), NotePad++ (Windows), or whatever you like to use)
- Archive Manager (Linux) or 7Zip (Windows)
- Apktool 2.2.2 (link at the bottom of this post)
- Apktool Windows wrapper script (Windows only)
Step 1: Boot into TWRP
Step 2: Select mount, then select system
Step 3: Connect your Nexus 6 to your computer and fire up a terminal (Linux) or command prompt (Windows)
Step 4: Navigate to the folder containing ADB (platform-tools).
Step 5: Type "adb pull system/framework/framework-res.apk".
Step 6: Type "apktool if framework-res.apk" This installs the framework
Step 7: Type "apktool d framework-res.apk" This decompiles the apk
Step 8: Navigate to res, values, and open styles.xml with your text editor of choice
Step 9: Search for "navigationBar". There will be three instances of it. You only have to change the last two. Change "@colorBlack" to "?colorPrimaryDark" and save your changes
Step 10: Open colors.xml and search for "input_method_navigation_guard". Change "ff000000" to "00000000" and save the file. If you don't change this, the navigation bar will turn black when you open the keyboard
Step 11: Go back to your terminal window/command prompt and type "apktool b framework-res". This recompiles the apk
IF YOU SKIP THE FOLLOWING STEP YOU WILL END UP IN A BOOTLOOP!!!!!!!!!!
Step 12: Delete META-INF and AndroidManifest.xml from the modified framework-res.apk and copy over the ones from your original framework-res.apk
Step 13: Push the modified framework-res.apk to your device with ADB or by boot into recovery, copy it to your phone, and use the TWRP file manager to move it to /system/framework. If you do the TWRP method, be sure to set the permissions to 0644 or your​ phone will not boot.
Step 14: Boot up your Nexus 6 and test it out!
Link to Apktool
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Strephon Alkhalikoi said:
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Click to expand...
Click to collapse
1. The first time I did this I didn't sign the app and ended up in a bootloop. After researching the issue I came across a post that said signing the app was necessary. Signing it fixed my problem, so I've signed it ever since out of habit. Next time I do this I'll skip signing it and see what happens. If I don't get a bootloop I'll remove it from the guide. It's possible I had a permissions error or something.
2. While moving it with a file explorer is possible, I just prefer ADB, so that's why I used it in my guide.
I realize that they're version dependant. I wasn't trying to use a modified framework-res from Marshmallow on Nougat or anything like that. For example, when I tried reusing one from the November factory image on the December security update, or one from the November image on Pure Nexus, I get a bootloops, so that's why I assumed it necessary to create a new one each time. It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Face_Plant said:
It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Click to expand...
Click to collapse
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Strephon Alkhalikoi said:
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Click to expand...
Click to collapse
I didn't mean for all mods, just this one. Like you said, it's only simple changes to two XML files.
After getting some practice by doing this a couple of times it only takes a few minutes to complete, depending on the speed of your computer. It takes me about 30 minutes since my Ubuntu machine is an old early 2000's PC that takes about 10 minutes to decompile the app, 10 minutes to sign it, and 10 more to recompile it... I'll be able to knock 10 minutes of that time if what you're saying is correct and signing it is unnecessary.
I'll try it again after class today and remove the signing bit if all goes well [emoji106]
Great write-up, worked well OP!
You can after recompile of the framework-res folder, you can delete the AndroidManifest.xml in the new APK, and copy the AndroidManifest.xml and META-INF folder from the original framework-res.apk into the newly built APK...hopefully that makes sense.
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
RMarkwald said:
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
Click to expand...
Click to collapse
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Face_Plant said:
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Click to expand...
Click to collapse
Could depend on the app maybe? Not too sure there. I started wanting to learn modding apks (mainly making color changes, etc) by guides similar to this, the whole "I wonder if I can do that?" thing. Hopefully this will encourage those looking to try something like this that isn't too difficult to do to give it a shot and try it, just remember to have a backup of framework-res.apk handy, always can be adb pushed back via recovery if something goes south.
Thanks again for this OP, so far working great!
Awesome write up!
Not trying to hijack the thread, but for those not comfy making mods, there is "an app for that" Navbar Apps
Simple app that will dynamically change your nav bar color as well as other goodies.
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
kidhudi said:
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
Click to expand...
Click to collapse
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
ok i figured that out..
will this technique work on nitrogen version 7.1.1 because the nav bar doesnt change but when i pull the framework-res.apk the xml files are in fact altered.
---------- Post added at 09:13 PM ---------- Previous post was at 08:24 PM ----------
Face_Plant said:
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
Click to expand...
Click to collapse
no the command in the tutorial didnt work. because i was compiling a folder named framework-res and not an apk all i did was remove the .apk from the command supplied and it worked finally
also i dont know if it is an error but the push command has an lsystem for the location to be pushed. that wasnt working either.
thanks for the reply bro
Thanks face_plant. It was working the whole time. I thought I would get the pixel icons lol. My bad
Great tut thanks
kidhudi said:
Thanks face_plant. It was working the while time. I thought I would get the pixel icons lol. My bad
Great tut thanks
Click to expand...
Click to collapse
Pixel buttons are from the Substratum theme I'm using. You can get those too by being on a Nougat ROM that supports Substratum and using Pixel UI theme from the Play Store.
Just a heads up, if you're on 7.1.1 the theme won't work. It needs to be updated to support 7.1.1. Haven't tried it on 7.1, so it may or may not work.

Categories

Resources