Need development help: DexOpt mismatch signature - Moto X Q&A

Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0
baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.
Any dev here who can help? Is this a 4.4.2 or even MotoX issue?

shaftenberg said:
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0
baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.
Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
Click to expand...
Click to collapse
There's a xposed module that works perfectly called xposed additions.
Sent on my Gummy running Lenoto X

flashallthetime said:
There's a xposed module that works perfectly
Click to expand...
Click to collapse
Thanks, I know, but I'd like to mod the files by myself instead of using xposed.
So, the question is still open...

shaftenberg said:
Thanks, I know, but I'd like to mod the files by myself instead of using xposed.
So, the question is still open...
Click to expand...
Click to collapse
I thought you'd say that
Sent on my Gummy running Lenoto X

shaftenberg said:
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0
baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.
Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
Click to expand...
Click to collapse
you could try signing all apks (including framework-res.apk) with test signature and then zipaligning. be sure to exclude any market updatable apps in the test signing process though as this will cause failure to upgrade those apps through play store. dsixda's kitchen makes batch signing and zipaligning very easy.

Q9Nap said:
you could try signing all apks (including framework-res.apk)
Click to expand...
Click to collapse
This doesn't make any sense since the jar-files aren't signed.
I modded framework-res.apk and SystemUI.apk without any problem but with android.policy.jar the system hangs with the error message above. Even further, the same mod works on the Nexus 5:
http://forum.xda-developers.com/showthread.php?t=2515693

shaftenberg said:
This doesn't make any sense since the jar-files aren't signed.
I modded framework-res.apk and SystemUI.apk without any problem but with android.policy.jar the system hangs with the error message above. Even further, the same mod works on the Nexus 5:
http://forum.xda-developers.com/showthread.php?t=2515693
Click to expand...
Click to collapse
only thing i could think of related to signature. sorry for trying to help; it won't happen again.

I appreciate your help, but can't I say that this was no solution?

shaftenberg said:
I appreciate your help, but can't I say that this was no solution?
Click to expand...
Click to collapse
sorry i woke up on the wrong side of the bed that day apparently, it happens. anyway, i think i've gained some insight on the issue. all apks and jars have classes.dex files on 4.4+, even odexed ones. this means there is no need to manually deodex, just delete all the odex files.
the existing classes.dex files are different from the classes.dex files generated from the odex files. i think they contain a signature of some kind, because when i tried to install a manually deodexed build, i got force closes on many of the moto apps. once i discovered that all apks and jars have classes.dex files, i removed all odex files and everything was fine.
so try editing the existing classes.dex files rather than the ones generated from the odex files.
hope this helps...
btw, i think this dual classes.dex/odex setup has something to do with ART, so removing odex files will probably break ART capability. not sure yet, just throwing that out there.

Whoa, this was very helpful indeed, that explains almost everything...
Just a side note: I didn't know that, so I deodexed my system the standard way and I don't have any FCs.
Modding framework-res.apk worked though, even with creating new arsc and dex.
[edit] sure it works. framework is already deodexed in stock systems.

shaftenberg said:
Whoa, this was very helpful indeed, that explains almost everything...
Just a side note: I didn't know that, so I deodexed my system the standard way and I don't have any FCs.
Modding framework-res.apk worked though, even with creating new arsc and dex.
[edit] sure it works. framework is already deodexed in stock systems.
Click to expand...
Click to collapse
yeah kinda crazy, just realized that late last night and redumped the system.img to be sure i wasn't tripping lol.

DEXOPT Invocation Test
shaftenberg said:
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0
baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.
Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
Click to expand...
Click to collapse
''ANY CHANGES TO THE DEVICE COULD RESULT IN UNDESIRABLE USE. AND MAY HAVE CONSEQUENCE. AND MAY VOID WARRANTY. USE IS USERS SOLE RESPONSIBILITY''
You may want to try a test of dexopt.
I came across something, (while surfing the web for midget love making) That you may find useful.. this will test and show you the dexopt conditions of your installation.
netmite.com/android/mydroid/build/tools/dexpreopt/dexopt-wrapper/DexOptWrapper.cpp
P.S. just a thought CmeL8r

DEXOPT mismatches...
environmental variables can be overridden with explicit assignment.
Then you can use command line makefile assignment:
$ make showcommands WITH_DEXPREOPT=false
ANY CHANGES TO THE DEVICE COULD VOID WARRANTY.
AND MAY CAUSE UNDESIRABLE CONSEQUENCE OF SYSTEM.
USE IS USERS SOLE DISCRETION, RESPONSIBILITY.
Hope this helps you to call up current files, with variables allocating instructions for device to, Stop Driving You CRAZY....
Just a thought CmeL8r

Related

[Q] How to edit framework-res.apk?

I'm trying to edit framework-res.apk so I can theme my rom. Are these the correct steps?
pull framework-res.apk from my phone
decompile the apk
make the changes
rebuild the apk
sign
zipalign
push apk back to device
I'm not too sure on this method as after I pushed back my modified apk, I get a load of force close errors
Any advice would be welcome
don't sign and don't zipalign and all are fine
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
How is your process to decompile and recompile what tools do you use
vibez said:
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
Click to expand...
Click to collapse
Sent from my GT-I9000 using XDA App
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
setenza01 said:
How is your process to decompile and recompile what tools do you use
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
I use apk manager to decompile and rebuild
Benjamin Dobell said:
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
Click to expand...
Click to collapse
It is a stock rom but there is no framework-res.odex does that mean it doesn't need deodexing even though there are odex files for every other apk in my system folder?
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
FadeFx said:
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
Click to expand...
Click to collapse
Nice app but this theme also needs .xml changes which this app doesnt support
ok, i put him a note in his thread about the xml changing issue, we will see what hes answer will be...
edit:
also this software could do the trick: http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/302404/ande-android-design-editor/
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
vibez said:
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
Click to expand...
Click to collapse
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
So here are the rules u must follow :
If u've modified the manifest.xml, u must stop core, push the apk, start core or push the apk while in recovery.
If u've modified anything else, a simple push / reboot will do the trick.
Note, u cannot flash a modified system apk the first time (as in on a clean boot), u must flash the original rom, let it build the dex's and then flash ur modified apk.
Daneshm90 said:
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
Click to expand...
Click to collapse
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
vibez said:
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
Click to expand...
Click to collapse
That shouldn't concern u. Apktool's method of rebuilding the apk/arsc file is slightly different than how android originally builds an apk. What should concern u is if the apk simply works. Now when u decompile the apk, can u check the log to see if it reports of any missing resources, if it doesn't ur fine. So decompile the apk, make ur changes, recompile the apk, move the original meta-inf folder into ur new apk and push it to ur phone following the guidelines in my previous post. if it causes problems, post ur log and i'll take a look.
Ok this time I have added meta-inf to the new apk, pushed it to my phone and the phone hangs on boot.
Here is my log
--------------------------------------------------------------------------
|08/08/2010 -- 18:36:30.87|
--------------------------------------------------------------------------
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the path specified.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk
The system cannot find the file specified.
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'keyguard_password_attempts_count_pin_code' has no default translation in C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\other\..\out\res; found: fr ko
I: Building apk file...
Click to expand...
Click to collapse
Oh lol i meant the log of ur phone.
Use adb logcat
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
vibez said:
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
Click to expand...
Click to collapse
When u switch phone On.
Ok here you are
vibez said:
Ok here you are
Click to expand...
Click to collapse
Heres ur culprit
Code:
java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml
Now seems u modified the androidmanifest.xml ? If u didn't then heres my recommendation, copy over the original androidmanifest.xml from the original apk.

[REQ] Accurate Battery Mod/Theme

This would be AMAZING to see on the fascinate!
http://forum.xda-developers.com/showthread.php?t=756441
taypotts said:
This would be AMAZING to see on the fascinate!
http://forum.xda-developers.com/showthread.php?t=756441
Click to expand...
Click to collapse
im looking into it... ill see what i can do.
Sweet!! I know it has something to do with the .xml files. Look into a guy named Eugene he was the creator of this I believe..
taypotts said:
Sweet!! I know it has something to do with the .xml files. Look into a guy named Eugene he was the creator of this I believe..
Click to expand...
Click to collapse
yeah... i dont know xml though.... we need to find someone who does xml..
We found anyone that knows XML yet?? I'm really really wanting this!! Lol
As I said before it got lost in the forum crash, I'm pretty sure you just need to copy files from the Captivate version (thread 756627) or original Desire version (thread 756627) into the Fascinate's framework-res.apk and then reinstall that. Will work on it when my phone arrives.
s44 said:
As I said before it got lost in the forum crash, I'm pretty sure you just need to copy files from the Captivate version (thread 756627) or original Desire version (thread 756627) into the Fascinate's framework-res.apk and then reinstall that. Will work on it when my phone arrives.
Click to expand...
Click to collapse
nah already tried that... you have to exit the .xml to update that there is new images for the battery too.... we need an xml person, i promise.
Hello,
I too was interested in this mod so I went ahead and ported it to the Fascinate.
My framework-res.apk is from dh12 I am unsure if this works with the update. There is a readme in the zip file that explains how to install. This is not an update.zip you must push my framework-res.apk using adb or some other method.
I take no responsibility if you brick your phone with this. Make a backup and follow the directions in the readme file. It seems to work ok on my phone, but I'm not going to sit there and watch it drain every percentage point
I take no credit for this I just modified what I found on the OP's linked thread. What I implemented was the battery with the number inside, but you can use any of the other types by replacing the pngs in my framework-res.apk with 7-zip.
If there are any problems let me know.
Enjoy.
Threax said:
Hello,
I too was interested in this mod so I went ahead and ported it to the Fascinate.
My framework-res.apk is from dh12 I am unsure if this works with the update. There is a readme in the zip file that explains how to install. This is not an update.zip you must push my framework-res.apk using adb or some other method.
I take no responsibility if you brick your phone with this. Make a backup and follow the directions in the readme file. It seems to work ok on my phone, but I'm not going to sit there and watch it drain every percentage point
I take no credit for this I just modified what I found on the OP's linked thread. What I implemented was the battery with the number inside, but you can use any of the other types by replacing the pngs in my framework-res.apk with 7-zip.
If there are any problems let me know.
Enjoy.
Click to expand...
Click to collapse
Excellent, yea that framework should work, I have switched from both systems without doing the full update and my phone has been fine.
May I ask the names of the xmls you edited, so I can manually pull them, I don't want to retheme the whole framework-res lol.
EDIT: Nevermind just downloaded and saw that you included the files you edited separately too.
My hero right here!! I'm going to have some fun with themes now!! Lol
Threax said:
Hello,
I too was interested in this mod so I went ahead and ported it to the Fascinate.
My framework-res.apk is from dh12 I am unsure if this works with the update. There is a readme in the zip file that explains how to install. This is not an update.zip you must push my framework-res.apk using adb or some other method.
I take no responsibility if you brick your phone with this. Make a backup and follow the directions in the readme file. It seems to work ok on my phone, but I'm not going to sit there and watch it drain every percentage point
I take no credit for this I just modified what I found on the OP's linked thread. What I implemented was the battery with the number inside, but you can use any of the other types by replacing the pngs in my framework-res.apk with 7-zip.
If there are any problems let me know.
Enjoy.
Click to expand...
Click to collapse
yes! Thanks so much, just got it on my phone and so far so good
is it possible to make the battery the stock blue color?
betostunts said:
yes! Thanks so much, just got it on my phone and so far so good
is it possible to make the battery the stock blue color?
Click to expand...
Click to collapse
I will be working with this tonight and hopefully coming out with a flashable version as well..
Yes implementing this into my remix nextheme as we speak.
Problem is I am making each image one by one lol.
What did you use to decompile and rebuild your apk? I'm just getting android developement/themeing and I noticed there seem to be a couple tools.
Thanks,
Dan
It doesn't seem to change the battery charge images...
(Working on this)
Yeah I keep changing the images and try to put them in a update.zip but I fail.. it doesn't keep up with the actual charge of the battery.
I used apk manager 4.9. You will need to get adb and java for it to work. Also I can't get this program to push the modded apks, but I just do it manually. The program is nice because it kind of guides you through what you need to do.
Also I did not modify the charge icons just the battery drain.
Sent from my SCH-I500 using XDA App
Is apk manager's advice that you don't sign system apks correct?
Threax said:
I used apk manager 4.9. You will need to get adb and java for it to work. Also I can't get this program to push the modded apks, but I just do it manually. The program is nice because it kind of guides you through what you need to do.
Also I did not modify the charge icons just the battery drain.
Sent from my SCH-I500 using XDA App
Click to expand...
Click to collapse
Thanks - I had seen that but was just apkTool 1.2. I have been using adb and have been successful in making some small tweaks to verify what I am doing.
Regarding signing - it was my understanding that the apks should always be signed to ensure the system doesn't run into problems. I have not proofed how not signing effects things or if there are any side effects to now signing or if an app looks for a specific signature.
References for anyone following this thread...(http removed as I'm a new member and cannot post links yet)
APK Manager --> forum.xda-developers.com/showthread.php?t=695701
apkTool --> forum.xda-developers.com/showthread.php?t=707189
dashultz said:
Thanks - I had seen that but was just apkTool 1.2. I have been using adb and have been successful in making some small tweaks to verify what I am doing.
Regarding signing - it was my understanding that the apks should always be signed to ensure the system doesn't run into problems. I have not proofed how not signing effects things or if there are any side effects to now signing or if an app looks for a specific signature.
References for anyone following this thread...(http removed as I'm a new member and cannot post links yet)
APK Manager --> forum.xda-developers.com/showthread.php?t=695701
apkTool --> forum.xda-developers.com/showthread.php?t=707189
Click to expand...
Click to collapse
You don't want to sign the system apks. It is my understanding that it somehow reuses the old signature. This is what is nice about Apk Manager as it will prompt you with this information so you don't have to guess when you are first learning. It also nicely organizes your projects and allows you to easily zip everything back up.
It also has a nice feature when recompiling a system apk to allow you to copy files from the original apk if unmodified (you delete what you have changed from a directory it created). I needed to do this because when I was first modifying framework-res.apk I would get a blank screen when rebooting my phone. When I had apk manager keep most of the old files it worked perfectly, so if you are having problems with modded xml files try using this feature. It will prompt you when you are recompiling the apk.
Sorry to turn this into the noob apk packaging thread, but I am new to this as well and am happy to share what I've picked up to save any other people some time.

[DEV] 99% deodexed GRI40 XXKB1 for Nexus S framwork and app dirs only

Hi,
My first deodexing, wasn't as simple as expected, I was surprised no one did it before me...
Deodexed: entire framework dir, and most of the app directory (all but 2 apks which refused to deodex...), as long as the framework is deodexed thats ok.
Needed it to patch the framework.jar for bidi language and it works, seems a bit of a lag after each boot before showing the widgets and apps but after that it runs smooth,
can someone explaing that maybe? something to do with unzipping delay maybe?
here is the file, enjoy.
http://www.multiupload.com/FRE906144I
EDIT1: this zip is not flashable nor is it full rom, just deodexed framework and app directories, use adb to push to device, it is working for me with no problems (except the delay at boot), no fc (forced.closed) at all.
flashable zip?
FaithCry said:
flashable zip?
Click to expand...
Click to collapse
its in a .zip so i would assume so. thats the only way to put new ROMs within Nexus S... unless you want to go to Odin which would be .tar
@OP
Was it bluetooth.apk & networklocation.apk? If so, I finally got those deodexed, but I couldn't get the framework.jar to deodex correctly xD
If you need/want them, I can send them to you.
#EDIT
Testing my build with your framework.jar to see if it works right..
#EDIT 2
I am still getting that da** framework fc lol. Let me logcat it..
#Edit 3
I think I might know what my issue is.. Trying a few things now
#Edit 4
I went back to my framework.jar and fixed some files & now it works.. Go figure! lol. I will upload in a bit
#Edit 5
The issues on my build were the messed up NetworkLocation.apk & Bluetooth.apk.. I fixed those, and we now have a fully deodexed 2.3.3
http://forum.xda-developers.com/showthread.php?t=971690
@OP You should change the thread title to [ROM] Stock 2.3.3 DEODEXED. I'll give it a flash in the morning and add it to my Roms, themes, and kernels thread You could even give it a flashy name hehe
The zip I supplied is not flashable as far as I know, I used adb in recovery mode to push the files to the phone,
my deodexed framework.jar works, I use it for a day now and also used a patching script on it to make it bidi enabled, and it still works, I get no fc's at all with it, just a delay on boot before I see all my widgets/icons, after that all ok.
I have a clean working nandroid deodexed backup which also has the bidi patch at:
http://www.multiupload.com/UQ364AHDWT

[Q] Bootloop after editing a few XMLs?

So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?
ih4ckback said:
So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?
Click to expand...
Click to collapse
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.
.Candy said:
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.
Click to expand...
Click to collapse
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.
ih4ckback said:
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.
Click to expand...
Click to collapse
How did you install it. Using APK Manager? If so, that's probably the issue. I don't trust certain APK Manager options. To be safe, in the future you should only use it for decompiling, recompiling, and signing if necessary, never for re-install the APK.
Anyway, did you attempt to sign the file? framework-res.apk doesn't need to be signed, and if you do sign it, I believe it will create a boot-loop.
Also, when you recompiled it, did you go through the step that creates the "keep" folder where you delete the files that you edited? If not, then that's probably the issue. If you don't do that step, then your edited file will only contain the files that you edited. At least that's what I understand from my experience.
I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.
ih4ckback said:
I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.
Click to expand...
Click to collapse
dont sign system apks
Pirateghost said:
dont sign system apks
Click to expand...
Click to collapse
thats a good tip lol thanks I'll remember that next time I do any modding.

[Developing Module] framework .jar files are modified but are not loaded by Android

Hi all.
I am developing a magisk module that modifies system/framework/services.jar and some APKs using Magic Mount for Pokemon GO and other games.
I am using the Magisk Module template where I have added relevant files/folders to system.
The APKs I added work successfully.
But the framework .JAR files such as services.jar that I added are not loaded by Android after reboot.
As in, the .JAR files are replaced successfully, but Android exhibits no change, as if it was not using them and using instead the stock .JAR files.
I tried checking via md5sum in the terminal whether the services.jar file had in fact been swapped for the one embedded in my Magisk Module.
It had been successfully changed.
Maybe the OS wasn't loading these .JAR files at all, so as an experiment, I tried swapping services.jar for an empty file.
The phone still booted, and running md5sum and cat confirmed that system/framework/services.jar was an empty file.
My best guess is that framework files are loaded way before system/app APKs, but I found no information regarding my issue via Google.
I hope that someone here could please offer some quick tip or wisdom. Thank you in advance.
P.S.: I checked the open source Magisk modules I could find, and those that used framework .JAR replacements did not implement anything other than the basic template. An example: SonyFramework (My account can't post links yet).
Did you deodex your ROM, or is it a deodexed ROM?
I think you can only patch framework classes on deodexed ROMs.
Fif_ said:
Did you deodex your ROM, or is it a deodexed ROM?
I think you can only patch framework classes on deodexed ROMs.
Click to expand...
Click to collapse
Thank you for the suggestion.
The ROM I'm working on is Stock and Odexed by default.
The .JAR files I am including in the Module are Deodexed mods of the stock ones.
I tried the following as per your reply:
A) deodexing the whole ROM
B) deodexing the whole /system/framework/*
C) deodexing /system/framework/services.jar and removing odex residue (services.odex)
Unfortunately the device won't boot with A or B :S
With C it boots correctly, but the main issue remains.
---
An interesting behavior I found, is that when substituting (stock odex services.jar) with (modded deodexed services.jar),
the /system/framework/oat/arm/services.odex and other odex residue disappears for services.jar.
This along with the md5sum matching the modded version makes me think that maybe /system/framework gets loaded before Magic Mount gets to modify it.
Digging through open source Magisk modules I am yet to find the missing piece.
Thank you for your help Fif_, and to whoever takes the time to read my thread
Have a look at this thread. https://tapatalk.com/shareLink?url=...3793&share_type=t
[MODULE] Smali Patcher 0.8 and compare methods.
The module to replace patched, de-odexed services.jar definitely works.
shoey63 said:
Have a look at this thread (...)
Click to expand...
Click to collapse
Thanks, "Smali Patcher" was indeed a good clue.
What I found in the "Smali Patcher" project:
-> services.odex was being deleted
But I also needed to modify framework.jar
unfortunately there is no "framework.odex" file.
Googling around seems that framework.jar's odex companion is stored in "/system/framework/arm/boot.oat", but boot.oat contains many more unrelated .jars :S
After fully Deodexing the WHOLE ROM, the Magisk Module works.
I wonder if there is a way to remove framework.odex from boot.oat... that would be very useful.
Thank you guys for your help,

Categories

Resources