[Q] Classes.dex inside apk and dalvik cache - Android Q&A, Help & Troubleshooting

Hi
Is the file classes.dex found inside the apk and the [email protected]@classes.dex file found in /data/dalvik-cache that corespondes to that same apk, are the same file? Meanning I can extract the clssses.dex file from an apk rename it to [email protected]@classes.dex and copy it to /data/dalvik-cache to restore dalvik cache for that app? (Assuming my rom is deodexed of course)
Thanks

EB10000 said:
Hi
Is the file classes.dex found inside the apk and the [email protected]@classes.dex file found in /data/dalvik-cache that corespondes to that same apk, are the same file? Meanning I can extract the clssses.dex file from an apk rename it to [email protected]@classes.dex and copy it to /data/dalvik-cache to restore dalvik cache for that app? (Assuming my rom is deodexed of course)
Thanks
Click to expand...
Click to collapse
I assume but what are you trying to accomplish by doing this? I mean that app can create it's own Dalvik-Cache when it is running so no need to do it manually.

Thank you for the help. What I'm trying to accomplish is permanently patch an apk or jar file creating a new one.. You may be familiar with an app called Lucky patcher that can disable ads of many free apps by patching their dalvik cache. So i was thinking, if the dalvik cache file is simply the classes.dex extracted from the apk and renamed, one this *.dex file is patched, I copy and renamed it back to classes.dex and inject it into the apk file, overwriting the original, so I'll end up with a new pre-patched ad free apk file that I can use any time to reinstall the app... Will this work?
Thanks

Related

[Q] Manual deodex an rom before flashing?

I'm searching for a simple way how can I deodex any rom. My idea is to rename the *.odex file to classes.dex and put it into the apk/jar archive using a simple archive manager. Will this work? I don't like any scripts to do that, will make it manual before flashing the rom. And need I to sign the apk/jar files (I think the normal apk files need that, but what witch the framework? Need it too to be resigned?).
no use xultimate
Sent from my GT-S5830 using xda premium
sometimes scripts is better to make your life easier
btw try dsixda android kitchen. its my favorite tool/script to deodex
Hmm ok will try first the dsixda android kitchen, I see it has version for Linux. But I will understand how this script works?
EDIT
Ok, now I see, it uses baksmali and samli to deodex. Thanks to all, will test it tomorrow.
Ok, after using the dsixda android kitchen and deodexing the framework (and SystemUI.apk, not more) and flashing the ROM I got an bootloop (wipe doesn't help). Her is my logcat http://pastebin.com/DtfChnPp , can some help, what did I wrong? I have only after deodexing apply the volume mod and the Pdroid patch, I am working on this rom http://forum.xda-developers.com/showthread.php?t=1360889
try this
download xultimate, theres a thread about it somewhere. unzip it and connect your phone with the rom thats .odex http://forum.xda-developers.com/show....php?t=1360889
next
once connected click on opition 5 which will pull all the apps and framework files from your phone and will deodex all the files and store them in the folder called "done_app" and "done_framework" may take up to 15mins
next
change the folder names of the done folders to "app" and "framework" and have both folders and the rom.zip that you installed pre at hand, in your case
http://forum.xda-developers.com/show....php?t=1360889
Then open the rom.zip up with 7zip and then click on system folder and drop "app" and "framework" folders into the rom.zip so your swaping the the folders with the .odex files for the deoxed ones you just did. put it on sd-card. wipe, mount system and data and install.
correct me if im wrong.
hope this works.

how to create flashable.zip for any system file modded ???

hello everybody
a lot of times I find system modded files and I wanna use them but the developers often offer the file is not flashable so I have to replace the older and set the permissions
but in all times I did that , the system sent an error and was damaged
so I wanna learn how to make a flashable.zip for any system file to be installed to its location and set the permissions
please help me
thanks
engnajjar said:
hello everybody
a lot of times I find system modded files and I wanna use them but the developers often offer the file is not flashable so I have to replace the older and set the permissions
but in all times I did that , the system sent an error and was damaged
so I wanna learn how to make a flashable.zip for any system file to be installed to its location and set the permissions
please help me
thanks
Click to expand...
Click to collapse
Its quite simple. Download a superuser.zip file that is for your device. Extract it. You will find two folders, System and Meta-Inf. Open System folder and you will find a folder called app inside it. Open it and delete the superuser.apk file and copy your modded system file into it.
For eg., Let the file be Gallery2.apk .
Now open META-INF folder -> com -> google -> android. You will find a file called updater-Script. You have to edit that file. There will be a line, where the system mount command is given. Do not do anything until that line. Delete the lines below it and enter these lines.
delete("/system/app/Gallery2.apk");
# [here Gallery2 is the name of the apk file you copied]
package_extract_dir("system","/system");
ui_print("Installation complete!");
Now rezip the folders together and you have your own flashable zip to install modded system files.
Hit thanks if this helped! :laugh:
PM me if you require further help.
dev27 said:
Its quite simple. Download a superuser.zip file that is for your device. Extract it. You will find two folders, System and Meta-Inf. Open System folder and you will find a folder called app inside it. Open it and delete the superuser.apk file and copy your modded system file into it.
For eg., Let the file be Gallery2.apk .
Now open META-INF folder -> com -> google -> android. You will find a file called updater-Script. You have to edit that file. There will be a line, where the system mount command is given. Do not do anything until that line. Delete the lines below it and enter these lines.
delete("/system/app/Gallery2.apk");
# [here Gallery2 is the name of the apk file you copied]
package_extract_dir("system","/system");
ui_print("Installation complete!");
Now rezip the folders together and you have your own flashable zip to install modded system files.
Hit thanks if this helped! :laugh:
PM me if you require further help.
Click to expand...
Click to collapse
thanks so much it works well
engnajjar said:
thanks so much it works well
Click to expand...
Click to collapse
Glad that I could help. :good:

How To Odex Non-System Apps

Hi, Deodexing an Odexed App is very simple. There are many tools for deodexing like the Famous Ultimate Deodexer . How about Odexing back an App without its original odex file? How could we odex it? Here's what I did to get all our problem solved:
1.) First of all, explore your Apk file using WinRar or 7zip, search for its classes.dex file. When you see one, proceed to the other step. When there's no classes.dex in your .apk file, I'm sorry, that App cannot be odexed.
2.) The next step is to extract the classes.dex file from that Apk by dragging it out. Then rename it to ["Appname".odex](Make sure you name Appname.odex the same as your Package Name.
Ex. CHATOn_MARKET.odex--->CHATOn_MARKET.apk
3.)Download Deodexer-Odexer-Tool_v1.00. I can't share the link. Just google it
4.) Extract the downloaded files. Pull framework dependencies. (I feel lazy about this common sense needed
5.) Move the .apk and .odex file you've just made in the "put-file-here" folder of Deodexer-Odexer-Tool_v1.00. Copy again the .apk file to the "finish" folder and rename it to "Deodexed_Appname.apk".
6.) Open "Deodexer-Odexer-Tool.bat" now deodex your apk file. Its just simple, read and understand the onscreen instructions.
7.) Last Step: Push your .apk file to your phone.
Hope I helped you.
For odexing apps i recommend Lucky Patcher, is the only app that actually odex my apps

[Oreo] How to integrate apps update in rom.

After update my LG G6 (LG-H870) from nougat to oreo, I've have problem with integration updated apps in to /system.
I do it like this:
1. copy apk file from data/apk to sd card
2. rename copied apk file to name of /system apk
3. extract lib folder from apk
4. copy newer file to proper folder in /system/app or /system/priv-app and replace file in it
5. Copy lib files extracted form apk to right folder /system/lib or /system/lib64
6. Uninstall update from /data/app
7. reboot + dalvik-cache wipe
In nougat it was working, but in oreo, app after integration, breaks. It cannot be open, and app name changes to random words (ex. google docs name changes to "write com.android").
To repair integrated apps I have to perform a full /data/ wipe.
Is it a some kind of protection? How to do it properly?
TitaniumBackup and Link2SD cannot integrate updates to rom properly without errors since Lolipop.

priv-app APK modification

Hello All,
I am trying to add/edit xml files found inside "assets", "vendor" directories of an APK included in system.img (priv-app directory) of a ROM.
The APK is available at
system/priv-app/CarrierConfig/CarrierConfig.apk
system/priv-app/CarrierConfig/oat/arm64/CarrierConfig.odex
system/priv-app/CarrierConfig/oat/arm64/CarrierConfig.vdex
I have used apk tool to decompile and re-compile the apk. I also zipaligned, signed with my own key. I copied the file to priv-app directory in the phone and restarted the phone. This did not work. I did have 644 permission for apk file after replacing. Also, I did clear the dalvik cache and cache after APK replacement.
1. Do I need to change the odex or vdex files? I did not touch them since my changes were in xml files.
2. Should I sign with originally signed signature?
3. I could not see the odex and vdex file in the priv-app directory in the phone after the ROM install(when I tried to replace the APK). Why is that?
4. Should I build a rom zip file to flash(along with existing odex and vdex files) as opposed to replacing the APK in the device?
Any help?
http://www.w3.org/2001/XMLSchema
I was looking into this as well. Everything I read said you have to be registered as carrier to make modifications to carrier config.apk , unfortunately:-/ Let me know if you did find a solution, though.

Categories

Resources