Related
First let me note that all credit goes to FxN. I simply am updating the code for the Droid 2. Thank you for all the work you did FxN. Also, this is only for DeOdexed phones.
NOTE BEFORE YOU START:
Standard disclaimer, I don't guarantee anything that might happen after following these steps, and I mean anything!! These steps worked for me and I have tried to include every minute step!
1. Connect phone using USB and check that you can see your device using: adb devices
2. in your SDK/tools directory from command line do:
PHP:
adb pull /system/framework/services.jar services.jar
3. Make a backup of the services.jar file that just popped in the tools folder just in case!
4. Download smali and baksmali from http://code.google.com/p/smali/ and place them in the tools folder. Rename the files to baksmali.jar and smali.jar to save on typing later
5. Open the services.jar file with something such as winrar or 7zip or whatever you prefer
6. Copy out the classes.dex file to your SKD/tools folder
7. run following from command line:
PHP:
java -jar baksmali.jar -o classout/ classes.dex
8. Now browse to your new folders classout/com/android/server/status
9. Open the file StatusBarIcon.smali in something like notepad or context or any text editor
10. Locate a line that says: .line 61, under this line it should have something like:
PHP:
const/high16 v6, -0x100
11. Change this to say:
PHP:
const/high16 v6, -0x1
12. Save the file
13. Now back to the command line and from your SDK/tools folder run:
PHP:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
14. If the above finishes without errors you should have a file called new-classes.dex in your SDK/tools folder now that is the same size as your classes.dex file.
15. Rename the old classes.dex file to classes-old.dex and rename the new-classes.dex file to classes.dex
16. Open the services.jar file with your archiving tool again from step 5 and replace the existing classes.dex file with our new classes.dex we just created.
17. From command line run:
PHP:
adb remount
18. also from command line:
PHP:
adb push services.jar /system/framework/
19. Finally run:
PHP:
adb shell reboot
On step 11, this is setting the font to red. If you want white change the line to
PHP:
const v6, -0x1
Original FxN Post is sourced:http://forum.xda-developers.com/showthread.php?t=549309
Could you post a white services.jar?
I've been trying to get this to happen for a while. I thought it had to do with the method of deodexing, but it turns out it may be the services.jar itself. i've talked Xeudoxus, and he's going to take a look. Also, the way he's going to do it, will be incorporated into xUltimate, so that will make this process a billion times easier.
Here you go.
Rename .rar to .jar
theecho said:
Here you go.
Rename .rar to .jar
Click to expand...
Click to collapse
does this change ALL status bar text to white or just the clock?
also, would it work on nondeodexed phones?
Currently just the clock. As for the non-deodexed not sure..you should pull you current and push this and let us know
theecho said:
Currently just the clock. As for the non-deodexed not sure..you should pull you current and push this and let us know
Click to expand...
Click to collapse
im not sure how this is valuable if the other statbar text is gonna remain black.
have to start somewhere. Im working on the other portions just need to find where they are stored.
theecho said:
have to start somewhere. Im working on the other portions just need to find where they are stored.
Click to expand...
Click to collapse
i _thought_ they were in framework-res color but i think im wrong there.
I know that there are some default values stored in the status_bar.xml as i have changed the active action such as preparing sd card and stuff like that. I am trying to at least change the date before proceeding with my theme.
theecho said:
Currently just the clock. As for the non-deodexed not sure..you should pull you current and push this and let us know
Click to expand...
Click to collapse
didnt work. guess it wont if you have:
services.jar
services.odex
not sure how to make them one file.
http://www.droidxforums.com/forum/droid-x-themes/4620-how-manually-deodex-your-phone.html
check that out.
theecho said:
http://www.droidxforums.com/forum/droid-x-themes/4620-how-manually-deodex-your-phone.html
check that out.
Click to expand...
Click to collapse
this worked great thanks. gonna try the white services.jar soon.
white services.jar works great. now if we can just get the rest of the text in white we can go back to the black bg themes
all white status bar. Again change .rar to .jar
theecho said:
all white status bar. Again change .rar to .jar
Click to expand...
Click to collapse
getting closer.. notifications are still black text.
do you mean the pictures? like the tiny icons?
Screenshot of new wifi icon
i made some screen shots.. first one should say the sms text but its black so you dont see it.. second has some list items all black..
those arent the status bar and are not controlled by services.jar.
Try this framework.apk and tell me if you sms text is white.
theecho said:
those arent the status bar and are not controlled by services.jar.
Try this framework.apk and tell me if you sms text is white.
Click to expand...
Click to collapse
yep, this fixed the notification colors to white. can you tell me what portion of this is for the color change so that i can only apply that portion.
do you know which file affects the dropdown list text colors?
not yet i do not that was in the status_bar.xml located in res/layout/
hit me up on gtalk
I have CM7 installed... I know there are settings for screen timeout under display, and CM7 settings allow you to specify the delay for the screen to actually lock. But what about when the screen is locked, you turn it on to check the time and it shuts off after 5 secs. Can this be changed?
Edit: Here's a list of important posts so people don't have to read the entire thread...
Background Info
Step-by-step guide for windows
Allow .jar files to be seen in APK Manager
How-to deODEX android.policy.jar for ODEXed ROMs
How-to for linux/mac(will make a better guide once I finish porting the APK Manager tool from Windows)
Old Stuff:There's not a setting to change the lock screen timeout but I got to looking around and think I found where it can be changed. The stuff I found pointed to android.policy.jar which is located in /system/framework so I adb pulled it and then decoded it using apktool. Some smali files contain hex values of 0x1388 equals 5000 in decimal where 5000ms = 5s. So one of those should be what we want to change. I'm going to try figuring out which one to change, set it to 10s = 10000ms = 0x2710. If it works for me, I can describe how to do it yourself in better detail and/or post a modified android.policy.jar with the timeout you would like.
Edit: I started a thread about this in the Eris dev forum and removed the attached files from here. PM me or post in one of these two threads if you have questions or would like me to modify and send you a custom android.policy.jar
http://forum.xda-developers.com/showthread.php?t=1079844
I successfully increased the default 5s timeout when you wake the phone but don't unlock. If you want to test it out, download one of the attached zip files corresponding to the timeout you would like to have(10s or 30s). Extract android.policy.jar from the zip file and follow either the ADB or Root Explorer or Terminal Emulator instructions below.
If using ADB:
Code:
adb remount
adb shell
cd /system/framework
mv android.policy.jar android.policy.jar.bak
exit
adb push android.policy.jar /system/framework
adb shell
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
If using Root Explorer on phone:
mount system as r/w
rename original android.policy.jar in /system/framework to android.policy.jar.bak
move modified android.policy.jar to /system/framework
change owner: owner = 0 - root & group = 0 - root
change permissions: rw-r--r--
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Click to expand...
Click to collapse
If using Terminal Emulator on phone:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
mv /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
mv /PATH/TO/NEW/android.policy.jar /system/framework
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Later tonight or tomorrow I will post a how-to so anyone can make the necessary modifications themselves. That should allow for other devices/ROMs to modify theirs as well since it will be customized to their phone.
I've only tested this on my Eris running GSB v3.1 - Gingerbread 2.3.4 - CM 7.1.0 RC0. Be sure to make a NAND backup and a backup of android.policy.jar as I can't guarantee this will work for you. If you have problems or just want to switch back to the original 5s timeout, replace the modified android.policy.jar with the android.policy.jar backup, wipe cache & dalvik-cache, and reboot or restore from the NAND backup you created.
I'm really surprised no one has brought this idea up before..well glad I had a chance to give you something to dig into and explore some more. I haven't done any editing to system files like this before so I might be posting back with some questions. Thanks for the info..I'll let you know how it goes!
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
thetornado said:
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
Click to expand...
Click to collapse
The debugging notification will only show up if the option for "USB debugging notify" is also checked in Settings->Applications->Development. Not sure why it wouldn't be able to find your phone especially since it sounds like you had it working fine before. What version of adb do you have? I'm using v1.0.26 and never had any problem. You can check the version with the command "adb version". You could also try using adbWireless which would allow you to not have it hooked to your computer with the USB cable.
Scratch that last post..I got it working in ADB Shell
I downloaded the APK tool and moved the files to C:\Windows
Ran this successful: adb pull /system/framework/android.policy.jar
Problem with: apktool d android.policy.jar out - error saying it couldn't find apktool. I went to restart my phone to see if that was an issue and now its hung on the white android screen and wont boot up
Thoughts?
You didn't actually modify anything on the phone right? And didn't push anything to it either? If not, nothing would have changed and it shouldn't be having a problem booting. Try "adb reboot recovery", wipe cache & dalvik-cache then reboot. If you can't run adb commands...pull the battery, put it back in, power it on and hold volume up + power to get into recovery. If something was modified, use adb to revert the modded files back to the originals or restore with a NAND backup if you made one.
Edit: As for apktool not being found, it sounds like apktool is not in your PATH. The Windows folder should be part of your PATH by default. You could check your PATH variable by following these instructions and modify it if needed or you try moving the unpacked apktool files to the same location as the adb command which is most likely /PATH/TO/ANDROID_SDK/platform-tools OR /PATH/TO/ANDROID_SDK/tools
Sorry for the delay..got back to trying this mod. I got an error..
C:\Users\ME\apktool d android.policy.jar out
Unable to access jarfile C:\Windows\\apktool.jar
Did I put these 3 files in the wrong location?
I just saw your comment about putting these files into where adb.exe is located. I moved these files there..also checked my path and its set up for:
Variable: path
Value: C:\android-sdk\platform-tools
The error I got now is: Unable to access jarfile C:\android-sdk\platform-tools\\apktool.jar
I'm not all that familiar with how Windows handles things but something it should be able to find apktool.jar if it's the same directory as apktool.bat. What is the contents of apktool.bat? A workaround would be manually doing the .bat file's job and run "apktool" using this command instead:
Code:
"java -jar /LOCATION/OF/apktool.jar"
Typing that in a cmd window should give you the usage output for apktool. If that works, you could then use that format to decode and build apk/jar files.
I have everything in the folder: C:\android-sdk\platform-tools
Contents of 'apktool.bat':
@echo off
java -jar "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
I am getting this error:
C:\Users\ME>java -jar C:\android-sdk\platform-tools\apktool.jar
Unable to access jarfile C:\android-sdk\platform-tools\apktool.jar
Ok...two more things to try.
Add the location of the java commands to the PATH variable. Probably somewhere like C:\jdk1.6.0_##\bin OR C:\Program Files\Java\jdk1.6.0_##\bin. The PATH variable as a whole would now be something like this: C:\LOCATION\OF\jdk1.6.0_##\bin;C:\WINDOWS\system32;C:\WINDOWS
If that doesn't help: change directory(cd) to C:\android-sdk\platform-tools in the cmd prompt, then run "java -jar apktool.jar"
Sorry it's being such a PITA to just get apktool to run.
1. The location of my Java program is: C:\Program Files\Java - There are 3 folders in there: jdk1.6.0_25, jre1.6.0_22, jre6 - I currently have a user variable 'path' with the value 'C:\android-sdk\platform-tools' - should it be added after this? ..if so, could you explain from what I gave about java what I need to add?
2. Tried cd - same thing..Unable to access jarfile
What does the following command give as output?
Code:
echo %PATH%
I'd set your system environment variable PATH like so:
right-click my computer -> properties -> advanced system settings -> Environment Variables...
under system variables, select Path, and Edit...
add the following(without the quotes) to the end of what's already there: ";C:\Program Files\Java\jdk1.6.0_25\bin;C:\android-sdk\platform-tools;C:\android-sdk\tools"
Also, since you are running Windows...it might make things easier on you to use APK Manager. Here's the thread for it: http://forum.xda-developers.com/showthread.php?t=695701
Here is what I have from the echo %PATH%
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I installed the APK manager..I have it up and running. So I pulled the 'android.policy.jar' - Now what do I do to edit this file?
With all the storms, a power outage, and being busy I'm just now able to get back to you. I'm going to try going through the process using APK Manager on a Windows desktop I have access to. Step-by-step instructions will be in the post below.
Step-by-Step for Windows
You will need the java jdk installed and ADB set up for this to work.
download APK Manager and extract it to you preferred location
this guide will use C:\apk_manager_4.9
run C:\apk_manager_4.9\Script.bat
select option 0 to adb pull
where = /system/framework/android.policy.jar
stored name = android.policy.jar
current project = y
select option 9 to decompile
minimize Script.bat window
use Notepad++(or your preferred editor) to open:
Code:
C:\apk_manager_4.9\projects\android.policy.jar\smali\com\android\internal\policy\KeyguardViewMediator.smali
find ".method public pokeWakelock()V" NOT ".method public pokeWakelock(I)V"
inside the method, find the two lines starting with "const/16 v#" followed by a hex value(0x####)
the second(0x1388=5000ms=5s) is the default timeout unless a hardware keyboard is open, in which case the first(0x2710=10000ms=10s) is used
the values are 16-bit signed integers so the highest either can be set is 0x7FFF=32767ms=32.767s (Your screen will not wake up if set higher)
use this dec->hex convertor to determine the hex equivalent of your desired ms timeout
modify the hex values to your liking, save the file, and close Notepad++
return to the Script.bat window
select option 11 to compile
system apk = y
additional files = n
select option 8 to adb push
where&name = /system/framework/android.policy.jar
select option 24 to quit
open a command prompt to run these commands:
Code:
adb shell chmod 644 /system/framework/android.policy.jar
adb reboot recovery
in recovery,wipe dalvik-cache & cache, then reboot
Done!
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
thetornado said:
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
Click to expand...
Click to collapse
I'm glad we finally got it figured out for you. I have the screen animation turned off on my Eris so I didn't notice this broke it. I'll look into it and see if I can figure anything out. The first thing that comes to mind is that the screen off animation could somehow be dependent on the AWAKE_INTERVAL_DEFAULT_MS variable. As I found when first looking at this mod, changing the variable won't actually affect the value wherever it is used since the package is already compiled. So if the animation does use that variable in some way, we'll need to find where that happens and change the value there.
hello everyone
I have updated to kennethpenn's 4.5.91 Gingerbread Beta 4 (must say, it is truly a phenomally put together build !)
I have also noticed that many of the mods that i had applied to 1.8.3 have not been updated for 4.5.91, so i decided to make the changes myself.
Now, I have a pretty decent knowledge of Unix-based operating systems ( I have used Red Hat Linux, Ubuntu, SUSe Linux, OpenBSD, FreeBSD, Solaris, and now OS X) however, I would like to expand my knowledge to include Android.
The first one I attempted to do myself was the Wake on Volume Keys mod.
This is a very simple change to the android.policy.jar file, as you all well know.
For this, I used Windows XP, simply for the fact that I have 7zip and PeaZip installed on it. However, I can do all of this on OS X as well. The file archiver applications I have on OS X are:
1. The Unarchiver
2. Keka
I am going to list my method of applying this edit, and i would ask that someone with solid knowledge on this subject give me their feedback and guidance.
---------------------------------------------------------
My Method of editing android.policy.jar
---------------------------------------------------------
1. Using Root Explorer, I made a copy of /system/framework on my External SD Card
2. Mounting the Phone for USB Mass Storage on Windows XP that I have running in VirtualBox on my Macbook Pro, I moved the copy of the /system/framework directory to my Desktop
3. I downloaded smali-1.2.6.jar and baksmali-1.2.6.jar from code.google.com/p/smali/
4. I placed both of these .jar files in the copy of the framework-edited directory that I created on my Desktop
5. I renamed smali-1.2.6.jar to smali.jar and baksmali-1.2.6.jar to baksmali.jar for simplicity's sake
6. I moved the android.policy.jar file to /framework-edited directory on my Desktop
7. Using 7zip (I also have PeaZip, but for this, I used 7zip, if you think I should use PeaZip, please tell me) I extracted the files from android.policy.jar to end up with classes.dex and META-INF. I then moved classes.dex to /framework-edited so it is in the same directory as smali.jar and baksmali.jar
8. In Command Prompt, I entered:
Code:
cd C:\Documents and Settings\Owner\Desktop\framework-edited
in order to be working from the proper location where my files are located
9. Now, having Command Prompt working in the proper location, I entered the following commands:
Code:
java -jar baksmali.jar -o classout/ classes.dex
to create a new directory within /framework-edited called /framework-edited/classout
10. I then opened the /classout directory, and navigated to /classout/com/android/internal/policy/impl/ and opened the file KeyguardViewMediator.smali with Notepad
11. I used [Ctrl] + [F] to locate the line:
private isWakeKeyWhenKeyguardShowing(I)Z
12. I then looked at the lines DIRECTLY below the above line, and following the Original Post on how to manually apply this modification, I removed lines:
0x18
0x19
13. Upon removing these lines, I simply did a File -> Save As -> KeyguardViewMediator.smali and saved the file to my desktop
14. I [Cut] + [Pasted] the edited KeyguardViewMediator.smali file back to /classout/com/android/internal/policy/impl/ and replaced the original KeyguardViewMediator.smali file
15. With the edited KeyguardViewMediator.smali file in place, I went back to Command Prompt and entered the following commands:
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
To create a new file called new-classes.dex
16. Changing the name of new-classes.dex to classes.dex, I took the original META-INF file, and my newly created classes.dex files, and, using 7zip, created a new android.policy.zip archive
17. I renamed my newly created android.policy.zip to android.policy.jar, and transferred it to my External SD Card
18. Using Root Explorer, I navigated to /system/framework on my phone, and renamed android.policy.jar to 1122android.policy.jar.bac and [Copy] + [Pasted] my edited android.policy.jar to /system/framework
19. I then immediately powered off my phone, and rebooted into CWM Recovery, and cleared my Dalvik Cache, then rebooted the phone normally through CWM Recovery.
At this point, to my knowledge, I had successfully edited my android.policy.jar file and had manually added the Wake on Volume Keys modification, however, once the phone was fully booted and showing my lockscreen, I unlocked the phone as normal by sliding the slider to the right. As soon as the phone unlocked, I saw pop-ups for processes that had failed and were terminated. I'm not sure what the exact message the pop-ups had, but it was the normal pop-up message you get when a process force-closes. My only option was to click "Ok" so I clicked it, only to have another force-close pop-up.
Apparently, every single process on the phone had force-closed, BUT, the phone was waking when I press a volume key while the screen was off. I had no choice but to pull the battery out.
I decided to reboot into CWM Recovery and "install .zip from SD Card", Nottach's 1% Battery Mod / No Carrier Mod Uninstall Script
I installed Nottach's uninstall script because I hoped that it had an unmodified copy of android.policy.zip in it.
After installing the uninstall script, and rebooting the phone once again, I got to the lock screen, unlocked the phone, and found everything to be in perfect working order, just as before I edited anything,
But the Wake on Volume Keys mod was still applied!
So now, my questions / requests to all of you are:
1. Explain to me what I missed or did wrong that resulted in the force-closure of every single process on the phone prior to installing Nottach's Uninstall script
and
2. Educate me on the proper process that you developers use to apply small modifications such as this one to the android.policy.jar file, or any other related file on the phone for that matter.
My plan is now to change the color of the text on my lock screen (Clock, Date, and possibly Carrier) following this [Guide]
Any and all feedback is welcomed and greatly appreciated, as you will be helping me learn the beginnings of modding and developing
bump . . . . .
Perhaps this may help
http://forum.xda-developers.com/showthread.php?p=18226553
I am trying to modify a few APKs in an updated ROM I just installed. I was able to modify these in a previous release but now I am having trouble with SystemUI.apk. The SystemUI.apk in the ROM has no META-INF. How does this work?
If I modify and replace, I loose my status bar. If I copy the original from the ROM back, my status bar does not return. The only way to get my status bar back is to restore from a full backup.
Any help in how to modify this, or just understand how it is working in the first place would be appreciated.
What are you using to decompile the apks? Are you getting any error messages when you try to recompile it?
Apktool 1.4.5174001. No errors or warnings on decompile. No errors and one translation warning on compile.
Have you placed the right 1.apk and 2.apk in your C:\Documents and Settings\"your user name"\apktools
Yup framework-res and twframework-res from this ROM. Even though it looks like its only using 1.apk.
Update:
It's not the decompiling tools at all. I tried copying the unmodified SystemUI.apk back to /system/app, verified ownership and permissions. When I rebooted the phone, the same thing happened. No notification bar.
IDK sorry try pulling a systemui from a stock updated rom and past all you modified on that one. Sorry I could not help more Ill try to work on mine when I get home see if I can figure anything else for you.
I got it to work, sort of. I took the ROM and placed my SystemUI.apk inside, then flashed. I'm still curious about this SystemUI not being signed but still working as long as its not replaced.
Update:
After I found that the above worked, I create my own update.zip with just the SystemUI.apk inside. This also worked! Is there some reason that it did? The only difference I can tell is that the file access and modify time stamps are set to 2008
Code:
[email protected]:/ $ stat /system/app/SystemUI.apk
stat /system/app/SystemUI.apk
File: /system/app/SystemUI.apk
Size: 1108265 Blocks: 2168 IO Block: 4096 regular file
Device: b318h/45848d Inode: 41066 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ UNKNOWN) Gid: ( 0/ UNKNOWN)
Access: 2008-08-01 12:00:00.000000000
Modify: 2008-08-01 12:00:00.000000000
Change: 2012-05-26 23:27:02.000000000
I'm glad it worked out for you.
I am trying to install a clean Android System WebView (packagename: com.android.webview) onto stock LG G5 RS988 RS98821d Android 7.0 that is rooted.
I downloaded an arm64 WebView APK from the Bromite Releases GitHub page:
https://github.com/bromite/bromite/releases
I tried installing the Bromite WebView APK to "/system/app/webview/" (0644 permissions) and rebooted, but the WebView implementation could not be used.
There are instructions regarding installing Bromite System WebView available:
https://github.com/bromite/bromite/wiki/Installing-SystemWebView
From my reading of the installation instructions, "res/xml/config_webview_packages.xml" from "/system/framework/framework-res.apk" must contain the an entry for the package with the particular package name ("com.android.webview" in this case).
After examining the stock "config_webview_packages.xml" member file, it appears that a reference to "com.android.webview" is not present. The "config_webview_packages.xml" XML file also appears to not be easily readable in a text editor. My guess is that it has some kind of signing.
What must be done to get the system to allow the newly installed WebView? My impression is that the "config_webview_packages.xml" XML file must be edited, but it is not clear how to do so, given that it does not appear to be just plain text.
I have attached a copy of the "config_webview_packages.xml" XML member file and the original framework-res.apk file zipped into a ZIP 2.0 archive.
XML files inside apks are compressed, you should unpack the framework-res.apk using a tool for apk editing, not just a zip archiver program. On Android, you can use APK Editor Pro, for example.
By the way, have you already uninstalled Chrome? If Chrome is installed, it will be forced as the standard WebView provider.
tremalnaik said:
XML files inside apks are compressed, you should unpack the framework-res.apk using a tool for apk editing, not just a zip archiver program. On Android, you can use APK Editor Pro, for example.
Click to expand...
Click to collapse
It was my impression that the APK files were zip files with a particular signature block. I shall try a tool like APK Editor Pro and report back.
tremalnaik said:
have you already uninstalled Chrome? If Chrome is installed, it will be forced as the standard WebView provider.
Click to expand...
Click to collapse
I have uninstalled/removed both Chrome and the Android System WebView (Google Apps version).
Ascii3 said:
It was my impression that the APK files were zip files with a particular signature block. I shall try a tool like APK Editor Pro and report back.
Click to expand...
Click to collapse
Now I'm on PC and I remember the name of the tool I use sometimes on PC: APKChanger. It's very complete, although very heavy (about 650MB with my current configuration);
If you have platform tools installed on your pc, or the whole Android Studio, you can also use
Code:
aapt d xmltree framework-res.apk res/xml/config_webview_packages.xml
to see the list of allowed webview packages.
Ascii3 said:
I have uninstalled/removed both Chrome and the Android System WebView (Google Apps version).
Click to expand...
Click to collapse
So we can be sure the problem is not the system forcing Chrome as default WebView provider. So, as Bromite's wiki states, "Changing the package name does not make installation easier/possible;", so the only solution is to add com.android.webview to config_webview_packages.xml, or, if it is already there, remove the requirement for Google's signature on the webview package. EDIT: I checked, on your file com.android.webview is missing, you just need to add it:
Code:
E: webviewproviders (line=20)
E: webviewprovider (line=21)
A: description="Chrome Stable" (Raw: "Chrome Stable")
A: packageName="com.android.chrome" (Raw: "com.android.chrome")
A: availableByDefault=(type 0x12)0xffffffff (Raw: "true")
E: webviewprovider (line=24)
A: description="Google WebView" (Raw: "Google WebView")
A: packageName="com.google.android.webview" (Raw: "com.google.android.webview")
A: availableByDefault=(type 0x12)0xffffffff (Raw: "true")
A: isFallback=(type 0x12)0xffffffff (Raw: "true")
E: webviewprovider (line=27)
A: description="Chrome Beta" (Raw: "Chrome Beta")
A: packageName="com.chrome.beta" (Raw: "com.chrome.beta")
E: signature (line=28)
C: "MIIDwzCCAqugAwIBAgIJAOoj9MXoVhH6MA0GCSqGSIb3DQEBBQUAMHgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKDAtHb29nbGUgSW5jLjEQMA4GA1UECwwHQW5kcm9pZDEUMBIGA1UEAwwLY2hyb21lX2JldGEwHhcNMTYwMjI5MTUxNTIzWhcNNDMwNzE3MTUxNTIzWjB4MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzEUMBIGA1UECgwLR29vZ2xlIEluYy4xEDAOBgNVBAsMB0FuZHJvaWQxFDASBgNVBAMMC2Nocm9tZV9iZXRhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo/wW27nRxVqGbFOyXr8jtv2pc2Ke8XMr6Sfs+3JK2licVaAljGFpLtWH4wUdb50w/QQSPALNLSSyuK/94rtp5Jjs4RSJI+whuewV/R6El+mFXBO3Ek5/op4UrOsR91IM4emvS67Ji2u8gp5EmttVgJtllFZCbtZLPmKuTaOkOB+EdWIxrYiHVEEaAcQpEHa9UgWUZ0bMfPj8j3F0w+Ak2ttmTjoFGLaZjuBAYwfdctN1b0sdLT9Lif45kMCb8QwPp0F9/ozs0rrTc+I6vnTS8kfFQfk7GIE4Hgm+cYQEHkIA6gLJxUVWvPZGdulAZw7wPt/neOkazHNZPcV4pYuNLQIDAQABo1AwTjAdBgNVHQ4EFgQU5t7dhcZfOSixRsiJ1E46JhzPlwowHwYDVR0jBBgwFoAU5t7dhcZfOSixRsiJ1E46JhzPlwowDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAZO2jB8P1d8ki3KZILvp27a2VM3DInlp8I8UgG3gh7nBQfTrnZr5M1PL8eFHqX7MEvAiGCMTcrPklEhjtcHK/c7BcdeCWq6oL56UK3JTl33RxJcjmjrz3e3VI6ehRSm1feNAkMD0Nr2RWr2LCYheAEmwTPtluLOJS+i7WhnXJzBtg5UpUFEbdFYenqUbDzya+cUVp0197k7hUTs8/Hxs0wf79o/TZXzTBq9eYQkiITonRN8+5QCBl1XmZKV0IHkzGFES1RP+fTiZpIjZT+W4tasHgs9QTTks4CCpyHBAy+uy7tApe1AxCzihgecCfUN1hWIltKwGZS6EE0bu0OXPzaQ=="
E: webviewprovider (line=30)
A: description="Chrome Dev" (Raw: "Chrome Dev")
A: packageName="com.chrome.dev" (Raw: "com.chrome.dev")
E: signature (line=31)
C: "MIIDwTCCAqmgAwIBAgIJAOSN+O0cdii5MA0GCSqGSIb3DQEBBQUAMHcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKDAtHb29nbGUgSW5jLjEQMA4GA1UECwwHQW5kcm9pZDETMBEGA1UEAwwKY2hyb21lX2RldjAeFw0xNjAyMjkxNzUwMDdaFw00MzA3MTcxNzUwMDdaMHcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKDAtHb29nbGUgSW5jLjEQMA4GA1UECwwHQW5kcm9pZDETMBEGA1UEAwwKY2hyb21lX2RldjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOYPj6Y9rVt8xizSHDYjDEkDfFZAgSiZ9T6tevkQXsFyfaq3Gk3h2qssi29G6cTPJ2VXFKlVB71wSXv5p9/LEcDQPWQiO3Q2cLmgUXxyhJWXI3g96tPAhZQX2q6SC37ZQdiBR/raMO70DAkvCyBGtNplsvutzSE3oZ7LYfzB8vTbe7zCh3fDYSS/7xb3ZVvFqydHS40uVq1qqg1S80Pge7tW3pDGsPMZN7yA4yfmsvA1rbHm9N8t3Rc9hqzh6OxNAAgRB535YcsWL7iF+mpdFILXk3jLYT0nMvMnB83rsdgnRREjlGQYHl2mh8+6CqujsW/eICDq/LR6BYDyqHhk0ECAwEAAaNQME4wHQYDVR0OBBYEFKzsl07JglgpbeYDYGqsgqRDo+01MB8GA1UdIwQYMBaAFKzsl07JglgpbeYDYGqsgqRDo+01MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBACka6SFF6xAcj8L8O6R36++E09DTiGZEjvKT8eIycgcQQ+p1WUmPb6M2EJpN6zvvSE62ussmXdzf8rIyc0JXA8jbViZt62Y39epNENFxPTLN9QzXlT+w8AW73Ka3cnbOuL5EgoDl8fM79WVlARY3X+wB/jGNrkiGIdRm2IZIeAodWgC2mtXMiferyYBKz2/F2bhnU6DwgCbegS8trFjEWviijWdJ+lBdobn7LRc3orZCtHl8UyvRDi7cye3sK9y3BM39k0g20F21wTNHAonnvL6zbuNgpd+UEsVxDpOeWrEdBFN7Md0CI2wnu8eA8ljJD45v0WWMEoxsIi131g5piNM="
E: webviewprovider (line=33)
A: description="Chrome Canary" (Raw: "Chrome Canary")
A: packageName="com.chrome.canary" (Raw: "com.chrome.canary")
E: signature (line=34)
C: "MIIDxzCCAq+gAwIBAgIJAML7APITsgV7MA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKDAtHb29nbGUgSW5jLjEQMA4GA1UECwwHQW5kcm9pZDEWMBQGA1UEAwwNY2hyb21lX2NhbmFyeTAeFw0xNjAyMjkxOTA5MDdaFw00MzA3MTcxOTA5MDdaMHoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKDAtHb29nbGUgSW5jLjEQMA4GA1UECwwHQW5kcm9pZDEWMBQGA1UEAwwNY2hyb21lX2NhbmFyeTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANXfeAoZlr0ya1HBzIfAz/nLLjpPJeAPvuX5dueaxmiQgv2hNG22acriFuiiJI6TU0t8AIVJD5Ifbc4OOuA0zeFhdzWWGnmTRH6x27WI7bzOKnAqOvv21ZBmE9i8Vo++K13xWdTs3qVn1bn9oUONxFu0wKDzXYZhoj1Jom0RZGjXm16xuPlEuOzMcjiNBDoYuxPAXkMcK/G1gP4P4nAV8Rd/GGIjKRS/SUtcShhoAMOQhs4WIEkUrvEVRwhBDIbpM87oFbCVdBH38r0XS6F6CdhPJsKFhoEfq4c01HZqNmDpCPA8AAcCuSWqmXoTIqs7OqkWgduE2bInbWU7WMaTl+kCAwEAAaNQME4wHQYDVR0OBBYEFB/AsC4iPAqaLoNytNSx29qByI7+MB8GA1UdIwQYMBaAFB/AsC4iPAqaLoNytNSx29qByI7+MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAMb2Td3ro/+MGVnCPAbwBSOZMVLUKGqt6zr8CShW9mtFHnmy29EaWSYYAj1M4+6Vpkq85NsgBEck7rnUjV8A3Q0NKdTys1KRKJqVvQRBN6SwqQenSf/abxQCa8Z+69rh+3BkIU1HLtu5lrMDZwon5H91L5mpORn6vItd20uW132lwSDeUEW2CHslTrodoFuTUcSUlRiq/URfUH3baO1QHXkxpQwrBPKL5deJfcZnxh5MAtAGSQL7gHvayEFlDppETXdDO7vgGTH2dEK2TjKWALbGiKkxSqjRyTNt4/FOj10TqNRdUamj+ydVJgzGQ8bki4Vc6NnKm/r4asusxapkVR4="
E: webviewprovider (line=36)
A: description="Chrome Debug" (Raw: "Chrome Debug")
A: packageName="com.google.android.apps.chrome" (Raw: "com.google.android.apps.chrome")
On Android, I used APK Editor Pro 1.10.0 to modify res/xml/config_webview_packages.xml of /system/framework/framework-res.apk. A new APK with a generic signature was generated with the modification. I used the XML file editing option to select and modify the config_webview_packages.xml. The XML file editing functionality is given to be in beta and appears buggy.
I replaced the original /system/framework/framework-res.apk file with the patched one using the TWRP 3.2.3-0 file manager and attempted to boot to system. The system would start, but get stuck at the LG logo screen. I tried wiping data, and cache in recovery and booting again, but received the same result. I note that adb was available and usable after the boot process got stuck on the LG Logo screen.
My impression is that the patched framework-res.apk file is incompatible or defective. Perhaps APK Editor Pro 1.10.0 malformed the output APK (the XML editing feature appeared unfinished) or that the LG stock ROM expects framework-res.apk to have have a particular signature.
Perhaps a different APK editing tool should be tried. What could the problem be?
I have attached a ZIP archive containing the APK Editor Pro 1.10.0 modified framework-res.apk.
EDIT: Attachment has been removed; the file was defective and should not be used. Attachment is no longer necessary.
I have now patched framewor-res.apk successfully, and Bromite System WebView is working.
Did you use again APk Editor Pro or a PC tool?
The tools I used were Windows tools (and with a Java dependency in the case of Apktool) and were: Apktool 2.3.1 and WinRAR 5.6.1. I found that it is best to avoid newer versions of the tool unless trying to manipulate Android 9 Pie or newer resources.
Ascii3 said:
I have now patched framewor-res.apk successfully, and Bromite System WebView is working.
Click to expand...
Click to collapse
I know this is an old post, but how did you get it to boot?
I'm using apktool 2.5 and seems to be stuck on the boot screen as you were
burny02 said:
I know this is an old post, but how did you get it to boot?
I'm using apktool 2.5 and seems to be stuck on the boot screen as you were
Click to expand...
Click to collapse
From somewhere else it seems that you are now using Apktool 2.3.1.
After comparing my notes, my impression on what you are missing and some related notes:
The modified framework-res.apk should use the unmodified APK file's "AndroidManifest.xml" root file and META-INF directory contents. It is not sufficient for any of the content to be the same after decompiling.
Copy "AndroidManifest.xml" and META-INF directory from original framework-res.apk to modified framework-res.apk using zip program, if contents are different.
v2 APK signing scheme (which includes the APK file itself in validation), if present, would be broken, but the scheme's enforcement is not enforced on /system; v1 APK signing scheme (on APK contents ("AndroidManifest.xml" file and META-INF directory contents)) is still enforced.
I zipaligned output/modified framework-res.apk prior to transferring original "AndroidManifest.xml" file and META-INF directory contents, but I do not believe it matters for the purposes of getting a functional framework-res.apk.
EDIT: Some added things to keep in mind:
Sometimes clearing system cache and the runtimes cache is also necessary before system will boot after framework-res.apk replacement. Also make sure that the permissions of the replaced framework-res.apk file are at minimum whatever the original file permissions were. Depending on what software you use to replace the framework-res.apk file, the permissions set may be different.
I really appreciate the help, still does not work unfortunately.
Here is what I do:
adb pull framework-res.apk
apktool d framework-res.apk (tried most versions, mainly now 2.3.1)
Edit framework-res/res/xml/config-webview-packages.xml to:
Code:
<webviewproviders>
<webviewprovider description="Bromite WebView" packageName="com.android.webview" availableByDefault="true" isFallback="true" />
</webviewproviders>
Removing other dev versions with signatures etc
apktool b framework-res
zipalign -v 4 framework-res.apk framework-res-new.apk
Move META-INF and AndroidManifest.xml from the 1st original framework-res.apk > framework-res-new.apk (Have also tried moving res & resources from the new to the original...7Zip, WinRAR, CLI - Linux)
adb push framework-res-new.apk /system/framwork-res.apk
Modify permissions in TWRP > 0644
Move framework-res.apk from /system/ to /system/framework/framwork-res.apk (I read somewhere this is better than pushing directly. Neither worked)
Clear Davlik & Cache
Reboot
Hangs on boot screen
Any ideas if I am missing something important?
@burny02 - Please clarify whether the framework-res.apk you are trying to modify is for LG G5 stock ROM Android Nougat.
I note that you are using the "isFallback="true"" flag with the webviewprovider tag. The purpose of the isFallback attribute set to true (its default is false) is to specify that the WebView provider should be disabled by deault and should only become available when allow other WebView providers are disabled. Using the attribute with the true value with only a single WebView provider seems improper. I do not know if boot should fail if the attribute is present in the way that it is, but in both scenarios I would recommend its omission.
It has also been a while since I used Apktool versions and do not exactly remember the command lines. Do not take my not pointing to an issue with it as there necessarily not being an issue. One thing I would mention is that one typically first install a frameworks before decompiling and building. For the LG G5 RS988 Android Nougat, I believe installing the framework-res.apk as a framework was sufficient. You would specify on command line "apktool if framework-res.apk" and any tags you wish to explicitly specify, if any.
The moving of framework-res.apk to /system/ before /system/framework/ is oftentimes done by people to try to install a modified framework-res.apk with proper permissions and on a live system before the system crashes and reboots. Once framework-res.apk is copied to /system , but does not replace the framework-res.apk file, proper permissions can be set prior to using that file to replace the live framework-res.apk. It is still important to note that some software disregards permissions set when a file is relocated or copied, so this could be an issue if framework-res.apk is replaced with more restrictive permissions than the original framework-res.apk (less restrictive permissions should not usually be a problem for the app to be used). I particularity do not like the idea of the system crashing and prefer to make such changes offline (such as via the aid of a custom recovery).
Sorted. Got it working. Really appreciate the help, Ascii3
For anyone looking at this in the future, the isFallback back seems to stop booting, regardless of whether it is the only entry or not.
The procedure then works as above:
adb pull framework-res.apk
apktool d framework-res.apk (2.3.4 worked for me - SDK 24 Android 7.1 (LGG5))
Edit framework-res/res/xml/config-webview-packages.xml to:
Code:
<webviewproviders>
<webviewprovider description="Bromite WebView" packageName="com.android.webview" availableByDefault="true" />
</webviewproviders>
apktool b framework-res
Move META-INF and AndroidManifest.xml from the 1st original framework-res.apk > new framework-res-new.apk (Used 7Zip drag & drop)
adb push framework-res-new.apk /system/framework/framwork-res.apk
Modify permissions in TWRP > 0644
Clear Davlik & Cache
Reboot
I found the following unnecessary :
Installing framework (apktool if)
Zip-aligning
Moving to /system prior to /system/framework/ (Using TWRP, live system; it might be necessary)
burny02 said:
Sorted. Got it working. Really appreciate the help, Ascii3
Click to expand...
Click to collapse
Sure.
burny02 said:
For anyone looking at this in the future, the isFallback back seems to stop booting, regardless of whether it is the only entry or not.
Click to expand...
Click to collapse
The isFallback attribute is supposed to only be set to true for no more than one webviewprovider. Explicitly setting it to false (its default) should not be problematic (but does result in a larger config-webview-packages.xml file generated). Setting isFallback to true on the only webviewprovider item is not an intended use and apparently results in no boot.
burny02 said:
I found the following unnecessary :
Zip-aligning
Click to expand...
Click to collapse
I do not think zip-aligning apps is necessary generally . My understanding around the reason to do so is to try to optimize the packaged data to be more efficiently fetched in the manner which Android fetches the data.
@Ascii3 @burny02
Hello guys, sorry to exhume this post but I'm struggling and all other threads are maybe ten years old...
So I'm struggling to replicate what you did! I'm no expert but I can follow basic instructions.
So I do as you say, decompile framework-res.apk, modify the xml file (I just add the line). This step seems okay since I did some errors while editing the file and apktool would not recompile properly. Now this goes fine.
Then I got my freshly recompiled framework-res.apk, but 7zip on linux won't let me insert META-INF and AndroidManifest.xml. So I had to rename the extension .zip, do it, then rename in apk. Could this be an issue? It looks dirty.
Anyway, after this you didn't had to resign the apk? I read everywhere you had to, so I did. I did not zipaligned it since I used a resign tool I found on xda and I could not tell if I had to do it before or after resigning, but since you said you didn't zipalign it I thought whatever.
The problem is the following: after replacing framework-res.apk in /system/framework, the phone won't start, I get stuck on the starting screen and I could extract the following from logging:
01-24 04:15:17.470 +0000 4042 4042 I PackageManager: /system/framework/framework-res.apk changed; collecting certs
01-24 04:15:17.749 +0000 4042 4042 W PackageManager: Failed to scan /system/framework/framework-res.apk: Failed to collect certificates from /system/framework/framework-res.apk
Have you got any ideas of what I did wrong? It's my fourth soft-brick today, I'm getting a bit annoyed.
Thanks in advance
@LeSplendide did you ever get this working? Not sure if I'm having the same trouble, but I followed burny's instructions and my phone fails to boot. I checked logcat but I don't see anything relating to framework-res. I'm using magisk to overlay it because if I touch the /system partition for real, VoLTE stops working on my phone (known issue for this phone). I'm successfully overlaying stuff in /system/app and /system/priv-app so I do have overlaying generally working, though this is the first apk in the framework directory I've tried to overlay. Boy do I want to get this working. I've extensively degoogled and debloated this phone and the only glaring thing that remains is chrome handling webview.
TheShanMan said:
@LeSplendide did you ever get this working? Not sure if I'm having the same trouble, but I followed burny's instructions and my phone fails to boot. I checked logcat but I don't see anything relating to framework-res. I'm using magisk to overlay it because if I touch the /system partition for real, VoLTE stops working on my phone (known issue for this phone). I'm successfully overlaying stuff in /system/app and /system/priv-app so I do have overlaying generally working, though this is the first apk in the framework directory I've tried to overlay. Boy do I want to get this working. I've extensively degoogled and debloated this phone and the only glaring thing that remains is chrome handling webview.
Click to expand...
Click to collapse
I'm sorry I have no idea, rn Webview Implementation says I have Android System Webvew 102.0.5005 so I assume this is chrome webview? But I have no clue what I did or not but I know for sure I fixed my problem which was that Webview would crash when trying to sign in a google account on my MicroG'd LEAOS. Now this works so I guess I did make it work. All I found that could be a clue is a update.zip containing instructions and the webview in question. Iirc, the issue was that the zip needed to be signed so that twrp could flash it, so I think I just signed my zip and it worked but can"t tell for sure.