[APK] Android 3.0 Email Exchange support bypassing security policies [2011-02-09] - Nook Color Android Development

The Nook Honeycomb build is now ready for work! The Email client now completely ignores security policies pushed by the Exchange server and I'm able to get to my corporate email.
I decompiled the Email.apk (using apktool), and repacked it after bypassing the check for security policies. Essentially it is the same method as described by user afflaq.
For the 3.0 build, the function isActive() needs to be modified in com.android.email.SecurityPolicy to make it always return 1.
Here is a diff:
Code:
$ diff -rup SecurityPolicy.smali smali/com/android/email/SecurityPolicy.smali
--- SecurityPolicy.smali 2011-02-09 02:32:22.269439000 -0500
+++ smali/com/android/email/SecurityPolicy.smali 2011-02-09 02:32:29.634860300 -0500
@@ -1778,7 +1778,7 @@
return v1
:cond_0
- const/4 v1, 0x0
+ const/4 v1, 0x1
goto :goto_0
.end method
Use the attached signed Email.apk and replace the one in /system/app with it.
Note: I noticed that all the apks under /system/app were setuid user and group. I wonder why? Anyways, so when I copied the Email.apk, I just set it to the permissions of the original Email.apk.
Code:
# adb shell mount -o remount,rw /dev/block/mmcblk0p2 /system
# adb push Email.apk /system/app
# adb shell chmod 6755 /system/app/Email.apk
Warning: Do not forget to secure your lock screen with either a PIN, pattern or password (Honycomb supports all of these methods). This is under Settings->Location and Security
Enjoy!
EDIT: yes the APK is signed so no need to sign it again.

You first said:
j4mm3r said:
Use the attached signed Email.apk and replace the one in /system/app with it.
Click to expand...
Click to collapse
But then you were like...
Oh and dont forget to sign the apk before pushing it to the phone.
Click to expand...
Click to collapse
So which one is it? Signed or unsigned?

HQRaja said:
You first said:
But then you were like...
So which one is it? Signed or unsigned?
Click to expand...
Click to collapse
since its just an apk, Im going to go with unsigned. You would sign a zip file. You can push the apk directly from ADB, or sign and zip it and flash it

Bypassing corporate security policies = mucho bad.

Ummm... yeah... bypassing corporate security is real bad. I'm a Systems Admin at a healthcare company and if one of our employees bypassed security, had e-mails with Protected Health Information on a device and lost it, they would probably get fired. Same goes for financial institutions. Or anyone who violates IT policy. But, you know, whatever you're into...

A. Nonymous said:
Bypassing corporate security policies = mucho bad.
Click to expand...
Click to collapse
You seem to have an extra word at the beginning of that sentence.
But then I suppose that also depends on which side of the "remote data wipe" you happen to be on.

iconoclastnet said:
You seem to have an extra word at the beginning of that sentence.
But then I suppose that also depends on which side of the "remote data wipe" you happen to be on.
Click to expand...
Click to collapse
HAHA that response was EPIC, to say the least!

Modified Email.apk for rooted stock Nook?
All in the title...
I've rooted my nook, using ADW launcher, hoping to get onto corporate email the same way I do on my phone. Will the Email.apk in this thread work on stock? If not, does anyone have an Email.apk that will work with stock?
Thanks,
Alan

Just in case you were wondering, this is incompatible with phones running Android 2.x
I just tried pushing it to my phone, but no love.

lost icon
Well, got root, copied Email.apk to Email.apk.bak.
Copied new Email.apk and EmailWidget.apk into /system/app, set perms, all OK.
Now the email icon is gone.
What did I do? How can I launch my mail app?
Thanks in advance.
HolderOfTheHorns

Related

[MOD] Remove "Your phone will shut down" prompt

Okay, here is how to remove the annoying "confirm shutdown message".
I did this with KH4, but should work with most roms.
ALWAYS MAKE A BACKUP BEFORE MODIFYING YOUR ROM...JUST IN CASE THINGS GO TERRIBLY WRONG.
1 - Decompile framework.jar
2 - Open /com/android/internal/app/ShutdownThread.smali
3 - In .method public static shutdown(Landroid/content/Context;Z)V
look for the following:
.line 159
const-string v2, "ShutdownThread"
const-string v2, "Notifying thread to start radio shutdown"
invoke-static {v4, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/StringI
.line 161
if-eqz p1, :cond_2
4 - at about .line 161, comment out: if-eqz p1, :cond_2 as follows
# if-eqz p1, :cond_2 (make sure # is at beginning of line)
5 - then add the following after the above commented line:
goto :cond_2
the 2 lines should look like this:
# if-eqz p1, :cond_2
goto :cond_2
6 - recompile framework.jar
7 - use adb to push it to your sdcard
8 - then do the following:
adb shell
cd /sdcard/
stop
cp framework.jar /system/framework/
reboot
That's it - no more shutdown prompt!
amazing find
Thanks a lot
Sent from my GT-I9100 using xda premium
Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.
jonny68 said:
Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.
Click to expand...
Click to collapse
I prefer use the power menu for this and i will be pleased to skip the confirmation step
sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
i don't think it really matters to be honest, it shuts down quicker actually using the app i posted but each to their own
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
Click to expand...
Click to collapse
I've been using that app now for a long time and have never once had any problems
sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
I agree 100%. This works exactly as I wanted.
gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Click to expand...
Click to collapse
Thank you for sharing this.
mostyle said:
I agree 100%. This works exactly as I wanted.
Thank you for sharing this.
Click to expand...
Click to collapse
You're welcome!
Thanks mate
Cool find. Thanks
s7
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
tech927 said:
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
Click to expand...
Click to collapse
I think probably not. This thread was written in 2011 and android Gingerbread is the latest android version then. Gingerbread is still known for the easiest android version to mod. Now, android nougat and oreo are taking place but they're damn hard to make any modification BUT you can try to decompile with apktool and see if it works

[HowTo] Opera Tablet Mode

Opera Mobile is a nice browser and to my knowleage the only one that can turn off animated gifs. On the Streak Mini opera mobile has a clumsy interface: With the big buttons at the top and the bottom, there is less space for the content.
Basically you have what you see in attachment one.
When you start opera on the Streak 7 or another devices with 800x480 you will get the sleek tablet mode interface. Like in attachment two.
What happend? Opera Inc. deliberately turns tablet mode off for the model name "Dell Streak"
Here I will show how circumvent this.
Prerequisites:
adb and a connection to your device
java
aapt from android-sdk
apktool.jar
signapk.jar with testkey.x509.pem and testkey.pk8 (google for them, or create you own)
minimal commandline skills, how to edit text files
20 MiB space in a temporary directory
Make a nandroid-backup before you tinker around!
Recipe:
Fetch the opera-apk from your device with adb pull /data/app/com.opera.browser-1.apk
Sometimes it is -2 or -3. Have a look with adb shell ls /data/app/com.opera.browser*
Decompile the apk with java -jar apktool.jar d -r com.opera.browser-1.apk com.opera.browser
You will find the model name "Dell Streak" inside "com.opera.browser/smali/com/opera/common/CommonUtils$2.smali"
and "com.opera.browser/smali/com/opera/common/CommonUtils$1.smali"
Basically these files define who should see tablet mode, and who not.
Edit "com.opera.browser/smali/com/opera/common/CommonUtils$2.smali" and remove the lines
Code:
const-string v0, "Dell Streak"
invoke-virtual {p0, v0}, Lcom/opera/common/CommonUtils$2;->add(Ljava/lang/Object;)Z
Edit "com.opera.browser/smali/com/opera/common/CommonUtils$1.smali" and add the following line lines just before "Dell Streak 7"
Code:
const-string v0, "Dell Streak"
invoke-virtual {p0, v0}, Lcom/opera/common/CommonUtils$1;->add(Ljava/lang/Object;)Z
While at it, we should remove the unused libraries in "com.opera.browser/lib/armeabi". Delete the directory (leave armeabi-v7a alone!) and later gain 8 MiB space on your streak /data partition.
Now we compile the changes into an (unsigned) apk with java -jar apktool.jar b com.opera.browser com.opera.browser_unsign.apk
Sign the apk with java -jar signapk.jar testkey.x509.pem testkey.pk8 com.opera.browser_unsign.apk com.opera.browser.apk
We can't update the opera-apk on the device, because we changed the signing key. That is no problem as long you have no preferences changed in opera or didn't made bookmarks. So it is time to backup your opera configuration with adb shell tar cf /data/local/tmp/backup.tar data/data/com.opera.browser/opera
Now we uninstall the old opera apk with adb uninstall com.opera.browser
... and install the modified apk with adb install com.opera.browser.apk
Last step is to get back our old configuration with adb shell tar xf /data/local/tmp/backup.tar
I'm not so ever responsible of any damages you create while trying to reproduce this guidance.
Have fun,
hunderteins
Hi dude.. Really a very nice work looks great.. Can you upload the final apk file alone..? since I m not very keen with this work please.. B. R
i lyk ur way :good:
but der is an easy way too just edit ur build.prop and change the following line...reboot !!!
ro.product.model=GT-N7000
ro.product.manufacturer=samsung
and we can get updates...
MadHaker said:
i lyk ur way :good:
but der is an easy way too just edit ur build.prop and change the following line...reboot !!!
ro.product.model=GT-N7000
ro.product.manufacturer=samsung
and we can get updates...
Click to expand...
Click to collapse
well, but after that, every app thinks you are on a note, expecting 800 x 1280 pixels, 8MP or an other GPU. Don't know in what trouble you will run into with that hack.
Best way would be an app dependant way to fake getprop.
For example intercept property_get() in /system/lib/libcutils.so - would be nice for the market, too. Later, when I have a lot of time ...
"intercept property_get() in /system/lib/libcutils.so" -
i'm in!
(f.e. dpi, etc.)
No probs in applying the patch, dumb question - can opera top bar be removed?
_n0p_ said:
No probs in applying the patch, dumb question - can opera top bar be removed?
Click to expand...
Click to collapse
so how soon will this patch become available to us?
Did you mean a patched apk? I can share mine.
That would be good a patched apk
Sent from my Dell Streak using xda premium
http://n0p.8bit.fm/streak/com.opera.browser-1.apk
Cheers _nop_
Sent from my Dell Streak using xda premium
Thank hunderteins, the OP - it's his find.
Thank hunderteins
Thanks button pressed
Sent from my Dell Streak using xda premium
@hunderteins Have you an idea how to change the Nexus 10 to use the phone mode? The icons are so tiny and it is difficult to use them.
I tried to move the lines for
const-string v0, "Full Android"
from the one file to the other but without success.
I think I need to know what identifier is used for my Nexus 10...
EDIT: Just found it out! Add below
Code:
const-string v0, "Dell Streak"
this
Code:
const-string v0, "Nexus 10"
invoke-virtual {p0, v0}, Lcom/opera/common/r;->add(Ljava/lang/Object;)Z
:laugh:
is anyone still here?
I don't use opera browser but a friend wants to use opera phone mode on his Nexus 7. I have already dicompiled the apk but I can't find the files mentioned in first post to edit them.
is something changed in the latest versions of opera? shouldn't find them just by browsing the folders or I need eclipse to do it?
sorry for the noob question
thanks
psybill said:
is anyone still here?
is something changed in the latest versions of opera?
Click to expand...
Click to collapse
I expected this to be configurable with about:config by now.
Well opera uses code obfuscating now.
That means every symbols in a new release is renamed. In this 12.1.4, versionCode="1301080958"
I'm just snooping, you will find smali/com/opera/common/CommonUtils$2.smali renamed to
smali/com/opera/common/I.smali and smali/com/opera/common/CommonUtils$1.smali is renamed to
smali/com/opera/common/H.smali.
You can find this files on other releases of opera with
$ grep -r 'Dell Streak' smali/
on a linux command prompt. I know windows can search insides files, too. But find that by yourself.
Have fun,
hunderteins
hunderteins said:
I expected this to be configurable with about:config by now.
Well opera uses code obfuscating now.
That means every symbols in a new release is renamed. In this 12.1.4, versionCode="1301080958"
I'm just snooping, you will find smali/com/opera/common/CommonUtils$2.smali renamed to
smali/com/opera/common/I.smali and smali/com/opera/common/CommonUtils$1.smali is renamed to
smali/com/opera/common/H.smali.
You can find this files on other releases of opera with
$ grep -r 'Dell Streak' smali/
on a linux command prompt. I know windows can search insides files, too. But find that by yourself.
Have fun,
hunderteins
Click to expand...
Click to collapse
thanks for your help. you ΄re right about the file names. I'll have it in mind for the next version update.
But first I have to make this version work, and still didn't make it.
I had no problems with decompile, complie and sign the apk, but I know nothing about java files and I get fc's after installation. I want to do what billyx1 says in the post above, phone mode in tablet.
Can anyone care to share apk of latest modded version? The link shared by n0p doesn't work anymore.
Sent from my Dell Streak using Tapatalk 2
ammujee said:
Can anyone care to share apk of latest modded version? The link shared by n0p doesn't work anymore.
Sent from my Dell Streak using Tapatalk 2
Click to expand...
Click to collapse
Install Opera browser beta from Google play. It has tablet mode interface
ryan.nguyen said:
Install Opera browser beta from Google play. It has tablet mode interface
Click to expand...
Click to collapse
Thanks! I know that already, but I found that a bit too heavy for my ageing Streak.
Sent from my Dell Streak using Tapatalk 2

How to disable FLAG_SECURE on Nougat

Hi all,
is there a way to disable FLAG_SECURE on Nougat?
Before update from Android 6 I used Xposed module to do that, but I need a way to disable it on Nougat untill Xposed will be relised.
Thanks for attention
I need the answer aswell
I'm looking for the same thing, everything I tried so far didn't work.
Even with Root it seems to be quite hard to overcome this FLAG_SECUE.
Only way to allow taking screenshots and record video with apps that have FLAG_SECURE in Android 7.0+ (Nougat) is to modify and remove LayoutParams.FLAG_SECURE instances, and recompile the apk to remove the restraint. I don't think FLAG_SECURE can be globally disabled in Nougat yet.
Resources:
https://commonsware.com/blog/2016/06/06/psa-flag-secure-window-leaks.html
https://commonsware.com/blog/2012/01/16/secure-against-screenshots.html
https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html
https://github.com/appium/android-a...um/android/apis/app/SecureWindowActivity.java
https://reverseengineering.stackexc...repackaging-apk-file-using-baksmali-and-smali
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
edzamber said:
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
Click to expand...
Click to collapse
Very Nice!
Does services.jar belongs to target apk Itself??
Ive tried to decompile a specific apk to Disable flag secure on it (not global), but i Cant find any file to edit those strings you mentioned.
Do you have any idea on where can i find them?
renganyen said:
Very Nice!
Does services.jar belongs to target apk Itself??
Ive tried to decompile a specific apk to Disable flag secure on it (not global), but i Cant find any file to edit those strings you mentioned.
Do you have any idea on where can i find them?
Click to expand...
Click to collapse
I found it at /system/framework/services.jar
However, I don't see the targeted location in mine. Just classes.dex and MANIFEST.MF
edzamber said:
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
Click to expand...
Click to collapse
there will be some way to do it with a patch like lcpatch?
Kayjay0x said:
I found it at /system/framework/services.jar
However, I don't see the targeted location in mine. Just classes.dex and MANIFEST.MF
Click to expand...
Click to collapse
Deodex Services.jar first kid?
Anyone have a way to do this in Android 9.0 PIE for S9+ ?
bobfrantic said:
Anyone have a way to do this in Android 9.0 PIE for S9+ ?
Click to expand...
Click to collapse
Hi
This working also on S9 Pie services.jar
https://forum.xda-developers.com/showthread.php?p=73802410
edzamber said:
Hi
This working also on S9 Pie services.jar
https://forum.xda-developers.com/showthread.php?p=73802410
Click to expand...
Click to collapse
Thanks for the response but just a slight bit of confusion. Inside my Services.jar it is empty other than the META-INF folder. See screenshot. where is classes.dex? lol
Wait, now I remember, I need to deodex the file(s) in framework. Any recomendation on a program to deodex pie by chance?
bobfrantic said:
Thanks for the response but just a slight bit of confusion. Inside my Services.jar it is empty other than the META-INF folder. See screenshot. where is classes.dex? lol
View attachment 4711282
Wait, now I remember, I need to deodex the file(s) in framework. Any recomendation on a program to deodex pie by chance?
Click to expand...
Click to collapse
I use SuperR Kitchen paid but this tool working as well
https://forum.xda-developers.com/android/general/toad-source-android-deodexer-t3848307
edzamber said:
I use SuperR Kitchen paid but this tool working as well
https://forum.xda-developers.com/android/general/toad-source-android-deodexer-t3848307
Click to expand...
Click to collapse
Thanks, I had discovered that program and yes it deodexed the framework ok. I extrated classes.dex and tried to baksmali it to get the file but got error. Using latest versions from jesusfreke so trying to figure that out now lol. This stuff was so much easier way back with s advance days.
bobfrantic said:
Thanks, I had discovered that program and yes it deodexed the framework ok. I extrated classes.dex and tried to baksmali it to get the file but got error. Using latest versions from jesusfreke so trying to figure that out now lol. This stuff was so much easier way back with s advance days.
Click to expand...
Click to collapse
What error do you have ?
edzamber said:
What error do you have ?
Click to expand...
Click to collapse
This is the error when trying to decompile the classes.dex
C:\android\java>java -jar baksmali.jar -o classout/ classes.dex
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -o
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
C:\android\java>
bobfrantic said:
This is the error when trying to decompile the classes.dex
C:\android\java>java -jar baksmali.jar -o classout/ classes.dex
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -o
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
C:\android\java>
Click to expand...
Click to collapse
Use last TMA (tickle my android) to decompil/recompil
edzamber said:
Use last TMA (tickle my android) to decompil/recompil
Click to expand...
Click to collapse
Ok, will give it a try, thanks..
Edit:
SUCCESS!! Thanks very much.
help
Hi, could some kind soul post a step by step instructions how to do this? I am trying to disable FLAG_SECURE on AVD emulator (running on Ubuntu 18.04)
I tried adb pull /system/framework/services.jar but I only got a file which is 316 bytes, and not sure what should I do with that file after that anyway.
Thanks!
Hi All.
For all the inexperienced users/beginners, there are a few ways to achieve this:
1) https://forum.xda-developers.com/apps/magisk/module-smali-patcher-0-7-t3680053 - Secure flag - Allow screenshots/screensharing in secure apps.
2) https://github.com/veeti/DisableFlagSecure - Disable flag secure system wide using Xposed Framework.
3) Post 8 in this thread (https://forum.xda-developers.com/showpost.php?p=75323166&postcount=8)
Let me know how you get on Android family. Peace!

[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.

how to force install an unsigned apk?

Given that I have root and custom ROM/recovery?
There is an apk from the different ROM thus different signatures, and the phone's package installer doesn't want to install this apk, same as "adb install" command.
adb: failed to install samsung_service_mode_10.apk: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.sec.android.app.servicemodeapp has no signatures that match those in shared user android.uid.system; ignoring!]
Click to expand...
Click to collapse
Will I brick my phone if I simply rename this .apk to .zip and flash it with TWRP?
Why not to sign the APK using the apksigner tool by yourself?
because it requires downloading thousands of megabytes of Android SDK and learning how to use it.
I would prefer a simpler way like "adb install --force", if possible.
The err msg " INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" triggered by ADB really has NOTHING to with fact whether APK is signed or not.
> dat laughing smiley
I'm glad that you have an optic fibre with unlimited 1Gbps connection at home, however some people on our planet still reside on slow Internet connections with limited traffic, and downloading
android-studio-ide-202.7486908-linux.tar.gz 950 MiB
Click to expand...
Click to collapse
with
Google Maven dependencies 2724 MB
Click to expand...
Click to collapse
will take many hours and $$$s in traffic cost.
jwoegerbauer said:
The err msg " INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" triggered by ADB really has NOTHING to with fact whether APK is signed or not.
Click to expand...
Click to collapse
thanks for pointing that out! I've googled for the second part of the error - "has no signatures that match those in shared user android.uid.system" instead of the first part, and that lead me to the wrong conclusions.
So the fix was relatively simple - download apktool.jar and signapk.jar (no need to download full 3 GBs of Studio stuff), decompile the app with apktool, delete the "android.uid.system" part from the manifest file, compile app back and sign it with signapk.jar using the stock AOSP platform keys.
However in my particular case that did not work because an app requires Samsung libs absent on my device:
adb: failed to install samsung_service_mode_10_EDIT_signed.apk: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Reconciliation failed...: Reconcile failed: Package com.sec.android.app.servicemodeapp requires unavailable shared library sec_platform_library; failing!]
Click to expand...
Click to collapse
P.S. few links for the future self:
apktool.jar:
Apktool - A tool for reverse engineering 3rd party, closed, binary Android apps.
Apktool - A tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications
ibotpeaches.github.io
signapk.jar: (NOTE: use Java 8!)
SignApk/signapk.jar at master · techexpertize/SignApk
SignApk is used to sign the apk file after repack. The easiest way ever. - SignApk/signapk.jar at master · techexpertize/SignApk
github.com
AOSP stock keys:
platform_build/shared.x509.pem at master · aosp-mirror/platform_build
Contribute to aosp-mirror/platform_build development by creating an account on GitHub.
github.com
platform_build/shared.pk8 at master · aosp-mirror/platform_build
Contribute to aosp-mirror/platform_build development by creating an account on GitHub.
github.com

Categories

Resources