Backup and restore a Chrome extension? - Chromebooks

I have an extension that is no longer available on the Chrome store. I'd like to be able to back it up on my Chromebook and restore it, since I think it will not be restored after I update the Chrome OS (it will presumably fetch the available extensions from the store).
My Chromebook is in developer mode. So I wonder can it be done from the shell?
I tried enabling developer mode in chrome://extensions, but pack extension does not allow me to see any system root directory, and I have the additional challenge of figuring out which extension it is in /home/chronos/user/Extensions/.
I'm not really sure where to go from here. Any help with this would be really appreciated!

beetroot said:
I have an extension that is no longer available on the Chrome store. I'd like to be able to back it up on my Chromebook and restore it, since I think it will not be restored after I update the Chrome OS (it will presumably fetch the available extensions from the store).
My Chromebook is in developer mode. So I wonder can it be done from the shell?
Click to expand...
Click to collapse
Can you see the ID of the extension at the very bottom of its listing in chrome://extensions/? If you can.... I just tested out the following with an extension chosen at random, and it worked fine for me, although I suppose it may depend on the extension...
Copied the ID of the extension (at the very bottom of its listing in chrome://extensions/), then:
sudo su
find / -iname theidoftheextension
cp -a -r /home/chronos/user/Extensions/theidoftheextension /media/removable/UNTITLED/
Back in chrome://extensions/
Clicked Packed extension > chose the folder above the one containing manifest (in my case /media/removable/UNTITLED/theidoftheextension/0.1.2_0/)
Clicked Pack extension
Opened /media/removable/UNTITLED/theidoftheextension/ in file browser
Dragged the newly-created packed extension /media/removable/UNTITLED/theidoftheextension/0.1.2_0.crx over chrome://extensions/
It installed! Actually I tested it three times, resulting in three copies of the extension. Having said that, if you only have one copy of the extension, perhaps it would be better to test the .crx out on another copy of Chrome first, in case it somehow overwrites/breaks the copy you have installed.

Nolirum said:
Can you see the ID of the extension at the very bottom of its listing in chrome://extensions/? If you can.... I just tested out the following with an extension chosen at random, and it worked fine for me, although I suppose it may depend on the extension...
Copied the ID of the extension (at the very bottom of its listing in chrome://extensions/), then:
sudo su
find / -iname theidoftheextension
cp -a -r /home/chronos/user/Extensions/theidoftheextension /media/removable/UNTITLED/
Back in chrome://extensions/
Clicked Packed extension > chose the folder above the one containing manifest (in my case /media/removable/UNTITLED/theidoftheextension/0.1.2_0/)
Clicked Pack extension
Opened /media/removable/UNTITLED/theidoftheextension/ in file browser
Dragged the newly-created packed extension /media/removable/UNTITLED/theidoftheextension/0.1.2_0.crx over chrome://extensions/
It installed! Actually I tested it three times, resulting in three copies of the extension. Having said that, if you only have one copy of the extension, perhaps it would be better to test the .crx out on another copy of Chrome first, in case it somehow overwrites/breaks the copy you have installed.
Click to expand...
Click to collapse
Thank you, Nolirum!
I did as you suggested, and installed Chromium in Crouton to test it. I get the error "This can only be added from the Chrome Web Store" when I try dragging in the .crx.
When I try 'Load unpacked extension' option in chrome://extensions I get the following error:
Failed to load extension from: /Volumes/KINGSTON/theidoftheextension/5.0_0
Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
Click to expand...
Click to collapse
I saw this on Stackoverflow about the error. I deleted the leading underscore from metadata folder and it works! Yay!!
https://stackoverflow.com/questions...ebstore-throws-error-package-is-invalid-detai

No problem!
Out of interest, when you dragged the .crx onto Chromium, and got the error, was that with dragging it directly into the list of extensions in the chrome://extensions/ window (where you see the icons, details, extension IDs etc)? Just wondering, as I get that error if dragging a .crx on to the browser address bar or on a webpage, but not if I drag it into the extensions list directly.
In any case, interesting info about the metadata folder nonetheless. I remember having to do the same (deleting the underscore) for some extension I was trying to edit. It's reassuring to to read that _metadata is just Web store hashes, and that modifying it shouldn't affect functionality.

Nolirum said:
No problem!
Out of interest, when you dragged the .crx onto Chromium, and got the error, was that with dragging it directly into the list of extensions in the chrome://extensions/ window (where you see the icons, details, extension IDs etc)?
Click to expand...
Click to collapse
Yes, I was dragging into the extensions list. When I try it a little popup says something like "drop to install" then the error.

Interesting. I don't get that error (tried on Chromium, too). Perhaps it depends on the extension. Thanks for checking.

Related

Android's .so files

OK, So I've gotten to breaking down and recompiling those pesky .dex files, but I've run into a new problem.
This is a noob question, I'm sure, but .so files look like unformatted, binary files. How do I open then, edit them, etc? I need to read whats going on in my libs. :-(
Are these X11? I'm running ubuntu 10.04 x64 - so those could be difficult.
ie - unreliable 64 bit support.
$ sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
Click to expand...
Click to collapse
They're native library files, so platform specific machine code I imagine. Look for an ARM disassembler. I'm not familiar with linux internals, so don't know how you find the entry points, but it obviously will be widely documented. Is it impossible to obtain the source code? Assuming most are written in C/C++, reverse engineering from the machine code is not something I'd describe as a pleasant experience. If the source was well written assembly language & not too big, it can be almost enjoyable I guess. But then TBH walking through a randomly selected programmer's source, let alone object, files scares me, in a Tim Burton inspired bad trip kinda way. If you can find the source, it will be an order of magnitude less painful.
Try IDA Decompiler, it should disassemble all so files!
Most of the libs are open source in the aosp. Some are proprietary blobs with the only solution to them being reverse engineering.
.so disassembly
i know how to disassemble it
you will need orion's easy apk disassembler and apk manager
i've tested it once and it worked, but thereĀ“s a problem, i dont know how to re-assemble
1- rename the file .so to .apk like "libtestlib.so" to "libtestlib.apk"
2- put in the folder "place-apk-here-for-modding" of apk manager
3- open script.bat (or something like this) from Apk manager
4- use extract apk option
in the beggining my images inside the lib was corrupted so i used step 5 to fix
5- use option optimise images inside to fix images
6- go to project folder and copy classes.dex file to the root of easy apk disassembler's folder
7- open EasyApkDisassembler.EN.bat and use the "DISASSEMBLY a classes.dex with smali" option
8- give a name to the folder (like "libtestlib")
9- it will create a folder (like "out_libtestlib") with the disassembled files
Orion's easy apk disassembler http://forum.xda-developers.com/showthread.php?p=5826401
Apk multi tool (almost the same as apk manager) http://forum.xda-developers.com/showthread.php?t=1310151
I've tried to open libsurfaceflinger.so from my device with 7zip, and it worked too
thats it
@gkillershots
not working
i renamed .so to .apk and used extract option but getted error :
Processing archive: C:\APKMultiTools\place-apk-here-for-modding\libnative-lib.apk
Error: Can not open file as archive
"An Error Occurred, Please Check The Log (option 26)"

[Q] ApplyRecovery.bat

this is gonna sounds stupid but i followed every step but i cant seem to get the file to be only ApplyRecovery.bat, thats how i named the files but it does only open notepad....like if it was reading ApplyRecovery.bat.txt
Step 5: create a text file using notepad, called ApplyRecovery.bat. Make sure it is not named "ApplyRecovery.bat.txt" . It will contain the following lines (copy/paste is fine)
i did it finally
For future reference, it might help others if you explained how you solved your problem. For example, given this issue where the file is opening in notepad, one of the following possibilities is apparent:
1. When saving the file, you did not enclose the file name in quotes, e.g. "ApplyRecovery.bat". Enclosing the file name in quotes overrides the automatic generation of extensions and saves the file exactly as you wish.
2. Batch files, files ending in .bat, were set to open in notepad instead of being ran when double-clicked. This would by necessity require you to delete the file association before the batch file would work.

[GUIDE] Recover Notification from Nandroid

Have you ever installed a new rom, but completely forgot which notification sound you were using? I have a nandroid backup of the old rom, but really don't want to completely restore the rom just to figure out which sound I was using. Android stores this in a database, and I'll show you how to access that database. In hindsight, it may just be easier to restore the nandroid backup. But, this is how to do it using a nandroid backup.
I'll be using Ubuntu 12.04 to do this. I believe it can be done with Windows as well, though the commands and programs will differ. Again, this assumes that you don't remember what the filename was. If you do, you can just skip to step 7.
1. Copy your nandroid backup files to your computer. Specifically, the "data.ext4.tar" and any "data.ext4.tar.a", "data.ext4.tar.b", etc. files.
2. The files need to be combined together. Use the command "cat data.ext4.tar data.ext4.tar.a data.ext4.tar.b > data-combined.tar" or similar for your filenames. It combines all of your data.ext4.tar files into one new file, data-combined.tar. This should give you a working tar file. I got this step from http://forum.xda-developers.com/showthread.php?t=2194171.
3. Extract the data-combined tar file. If you're a super-cool linux hacker, you probably know some terminal command to do this, like tar -randomLettersHere (xzvf?). I just right clicked the tar file and selected "Extract Here".
4. Navigate to "./data/com.android.providers.settings/databases/settings.db" and open the file. I didn't have any program to read SQL databases, so I let Ubuntu installed the recommended one for me, called "Sqliteman".
5. Using the list on the left, go under Tables-System. You should see the contents of that table, which look like an excel spreadsheet. The row (or tuple) we're looking for has the field "name" equal to "ringtone" or "notification_sound", depending on which file you're trying to locate. You can scroll through the rows and look for those rows, or you can enter an SQL command in the top box and hit the green arrow to run it and filter just the ones we want. Try this-
Code:
select *
from system
where name='notification_sound' or name='ringtone';
This pulls up all the rows where "name" is exactly equal to either of those strings. You can also search for anything that contains those strings by using this syntax-
Code:
select *
from system
where name like '%notification%';
If you're looking for your ringtone, try a query that just contains "ringtone", like this-
Code:
select *
from system
where name like '%ringtone%';
(That pulled up the actual file for me under the name "ringtone_CONSTANT_PATH")
If you're using a different rom than that I was (or a different device), you might need to tweak what you look for. Try changing the strings you search for. What we're looking for is for the entry where "value" equals something like "content://media/internal/audio/media/238". It might have the word 'internal' instead of 'external'. Note that number at the end, which is some kind of media ID number.
6. Now, open the SQL file "./data/data/com.android.providers.media/databases/external.db" or "./data/data/com.android.providers.media/databases/internal.db" depending on whether the value in step 5 had the word internal or external. Find the row where "_id" equals the number at the end of your "value" string in step 5. You can scroll through the "files" table, or enter a query like this-
Code:
select *
from files
where _id='238';
The field "_data" should show the path for your file. For me, it was "/system/media/audio/notifications/S_Dew_drops.ogg". Oh, how I love you, Touchwiz...
7. Now you know where the file is. If your new rom doesn't have that ringtone/notification sound any more, you can probably retrieve it from two places. First, check the rom installation zip file (probably the easiest way) if it was an included sound. Open the installation zip file, and look in the path you found in step 6. The second way is to go through your Nandroid backup. Follow steps 1-3, but copy, combine, and extract your system.ext4.tar file(s). Again, just look in the same path from step 6, and it should be there. These paths are typically "/system/media/audio/notifications/" and "/system/media/audio/ringtones".
Enjoy your old, familiar sound again!

Editing the host file - new entry has no effect

Hi folks,
I'm developing a new version of a live website in WordPress with domain mapping so that the URL is like-for-like with the live site. On a PC, I just change my host file to point to the WordPress IP address.
I now need to test the WordPress site on a phone.
I have an old HTC Desire with Android 2.3.4 (rooted) that I'm trying to use, so need to add the WordPress IP to the host file.
Using ADB, I've managed to retrieve the hosts file from the phone, edit it and place it back on the phone using:
Code:
adb remount
adb pull /system/etc/hosts /hosts
[edited host file]
adb push /hosts /system/etc/hosts
To double-check that the hosts file really has updated, I've deleted hosts from my computer, then pulled it again from my phone. Opening it up in Notepad++ I can see that it does contain the new entry.
The strange thing is, if I open a web browser to the url I'm trying to map to the WordPress IP address, it still goes to the live website, not the WordPress server. I've verified this using PingTools - the returned IP address is that of the live server.
I'm guessing I need to flush the DNS but it seems the only way to do this is a reboot. But upon reboot, the new entry in the hosts file is gone and we're back to only "127.0.0.1 localhost", so I'm now at a loss.
Any thoughts on where to go from here?
EDIT
After doing the above, installing and loading 'Hosts tool' from Google Play, sometimes the new host entry is there, but most of the time the host file disappears from the phone completely! Looking through ASTRO file manager, it confirms the host file has vanished. Rebooting the phone gets it back, but then we're then back to only "127.0.0.1 localhost" in the host file
I've fixed the problem. For some reason, there needs to be a line feed after the last entry in the host file.
To do this, open the host file in Notepad++ and go the view menu > Show symbol > Show characters. Copy the LF character at the end of "127.0.0.1 localhost" and paste it to the end of each line if it doesn't already have the LF character at the end.
Android refreshes its DNS every 10 minutes, so it's then just a matter of waiting.

[SOLVED] Installing WebView (rooted Stock ROM)

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.

Categories

Resources