Related
So i have written a simple script to ease the process of editing apks. Got a lot of downloads so thought its in demand
Whether you're doing basic image editing or editing the smali or xml files, on average u have to use (Brut.all or JF's smali/baksmali) awesome tool to extract the apk, edit it, then sign the apk and then adb push/install it. This process is quite tiresome if you are testing a method that needs fine tweaking.
This script should make the process a LOT smoother.
Theres an option of compiling/signing/installing all in one step
Thanks:
Goes to Brut.all for his awesome tool.
Goes to JF for ofcourse, smali/baksmali
Goes to farmatito for porting this script to linux
Features:
- Extract, Zip apk's.
- Optimize pngs (ignores .9.pngs)
- Zipalign apks
- Sign apks
- Push to specific location on phone
- Incorporates brut.all's apktool
- Pull apk from phone into modding environment.
- Batch optimize apk (Zipalign,optipng,or both)
- Quick sign an apk (Batch mode supported)
- Batch Ogg optimization
- Compression level selector (monitor status above menu)
- Batch install apk from script (option 16)
- Logging on/off has been removed. Instead a log.txt is created which logs the activities of the script organized using time/date headers
- User can change the max java heap size (only use if certain large apks get stuck when decompiling/compiling apks) (Option 19)
- Improved syntax of questions/answers
- Error detection. Checks if error occured anytime u perform a task, and reports it
- Read log (Option 20)
- U can now set this script as ur default application for apks. When u do, if u double click any apk it will install it for u.
- Supports batch installation, so if u drag multiple apks into the script (not while its running) it will install them all for u. U can ofcourse drag a single apk as well
- Added framework dependent decompiling (For non propietary rom apks). (Option 10). Checks whether the dependee apk u selected is correct.
- Allows multiple projects to be modified, switch to and from.
- Allows to modify system apk's using apktool but ensures maximum compatibility in terms of signature / manifest.xml
- Stuff i forgot i guess
Instructions (Windows):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Run script
- Minimize the script
- Edit files inside the project folder
- Maximize the script
Instructions (Linux):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Open terminal and change-directory to apkmanager (Easiest way is to type "cd ")
- Chmod 755 Script.sh
- Chmod 755 all files apps inside other folder (thanks for the tip bkmo )
- Run script by typing ./Script.sh
- Minimize the script
- Edit files inside the out folder
- Maximize the script
Requirements:
Java
Adb
Future Improvements:
- Manage multiple simultaneous apk edits (choose which apk to extract/build)
- Option to optimize the apks
- Option to adb push to user defined location
- Other stuff i dont know yet
Got problems ?
1. Make sure your path has no spaces
2. Your filename has no wierd characters
3. Java/adb are in your path
4. It's not a proprietary rom's apk (aka Sense,Motorola,Samsung) (If u are, then use option 11 and drag the required framework, eg com.htc.resources, twframework-res...etc)
5. It's not a themed apk (if it is, expect .9 png errors, use as close to stock as possible)
6. Look at the log to know whats happening
7. If all else fails, post as much info as possible and we will try to assist you.
MOD EDIT:
New DL link from this post
http://apkmultitool.com
Nice
As you probably know, I want to add signing and installing functionality to apktool. But I don't plan to make any kind of GUI for it, so such wrapper is a very good thing for many users, thanks
What is "Option to optimize the apks"?
I was thinking of incorporating the script "apkopt" it was basically using optipng to optimize the png's and then used zip align on the apks. Thanks btw, this tool wudnt exist without ur awesome script
I just did this so ppl would stop asking questions like "How do i change this/that in an app"
Here this is wht im talking about Link
Very nice
Thanks dude...
once again you manage to make modding easier with your scripts!
Does your apkopt avoid .9.png files? Because those have been a pain in the behind.
Re: Apk Manager 1.0 - Makes Modifying Ur Apk A Breeze
my script currently does not optimize apks. it will be in the upcoming updates and yea prolly when ill implement itll avoid .9.pngs lol
I have already incorporated "adb push" into the script.
Aside from adding an option to optimize the apks, is there anything else you guys think would make this script easier to use ?
Im really targetting those ppl who overcomplicate the simple process of editing apks. Any tips would be appreciated.
I posted a video attached to the main post.
New version out, features added are
Zipalign apks
Optimize pngs, ignores .9.pngs
allows to adb push to phone through script.
Great script man, it works flawlessly. You may just wanna edit your post #1 rather than continuously bumping with new posts for every update. I'm sure a mod won't be too pleased with that
I'm getting the
'java' is not recognized as an internal or external command, operable program or batch filemessage when I attempt to sign an apk. I tried switching the PATH in Environment Variables so that it's pointing to my Java bin folder, but then I just end up with
java.io.FileNotFoundException: ..\place-apk-here\repackaged-unsigned.apk <The system cannot find the file specified>
at java.util.zip.ZipFile.open<Native Method>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at com.android.signapk.SignApk.main<SignApk.java:320>
Could Not Find C:\ApkManager2.0\place-apk-here\../place-apk-here/repackaged-unsigned.apkHelp? :]
What app are you trying to edit ? also are you editing pngs only or code editing ?
Hop on Here im helping someone out so ill help u 2
There's a lot of things in /system that benefit from the optimized .pngs. Vending.apk, for instance, shrunk to half the size and runs a bit quicker and smoother now. Even framework-res.apk enjoyed the optimization. Paid apps, on the other hand, don't seem to fare so well; perhaps they check the md5sum of the app or something.
Yea png optimization works for almost all apks, zipalign on the other hand as i recall doesnt work on certain system apks such as settings.apk. Im prolly gonna incorporate apkopt's script into this which would allow to optimize a folder full of apks. As for paid apps not being optimized, a lot of dev already do their part on making the apk as small as possible, so perhaps thats the case.
hmm, after trying a couple of unpaid apps, it seems that perhaps the testkeys aren't compatible with my build. For any signed app, I get an error "Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]"
Yes when u modify a non system apk, they need to be resigned, and you cannot resign it with same key as dev cuz u dont know it hence anytime u modify an app, u must uninstall it, install the modded version, and from then on any change u make u dont have to uninstall as the keys will match
ahhh thanks. My mistake was just removing the package rather than uninstalling it.
Getting this on a zipalign. The file is there but it is repackaged-unsigned.apk and throws this error:
Please make your decision: 5
Unable to open 'E:\ApkManager\place-apk-here\repackaged-signed.apk' as zip archi
ve
Could Not Find E:\ApkManager\place-apk-here\repackaged-signed.apk
The system cannot find the file specified.
Nevermind....looks like it is by design that it tries both signed and unsigned and throws the error on the file that does not exist. It's just I did not see any zipalign output
having an issue that when I go to resign an apk the file deletes after running the script.. am I missing something here?
For optimizing apks, aside from fixAllAPKs by omniwolf, I found another one.
Note: I have no responsibility for breaking your ROM, so backup first.
Rights: No rights reserved, you can do whatever you like.
The classes.dex files have significant amount of debug infos in it, striping out those can reduce file size and increase some performance. I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps. Stripe out those debug info doesn't hurt anything, they are usefull only for original developer and one who wants to mod it, but you can always keep a copy of the original one for modding and debugging purpose.
Note that this does not boost performance like increase CPU freq, but the theory is, since the file size is reduced, dex and dalvik-cache became smaller in size, occupies memories smaller, thus processing is faster, and saves a little battery life, you can think it as something like optipng does.
Note also, you don't need to specify 0 compression, dex will be decompressed to /data/dalvik-cache, just use fixAllAPKs for fixing files inside APK that should not be compressed, and 0 compression for file type like xml isn't really a good idea.
Don't use this for ICS Framework files yet, there are specific files will causes surprising bugs when recompiled, but I'm lazy to find it out why and what, so just don't do it.
For FixAllAPKs, original thread here, http://forum.xda-developers.com/showthread.php?t=1123463
or post #36 by carl1961 http://forum.xda-developers.com/showpost.php?p=21458549&postcount=36
==========================================================================================================
RemoveDebuggingInfo_v2.2:
API Level must be specified to get 100% compatibility, it seems not forward nor backward compatible.
Froyo = 8, GB = 10, ICS4.0 ~ 4.0.2 = 14, ICS 4.0.3 = 15
Added API Level chooser, default 15 (ICS 4.0.3)
Added more descriptions.
Correct typos.
==========================================================================================================
depricated...
RemoveDebuggingInfo_v2.1:
First, Thanks to all who corrects me.
fix typo for menu selection 6
fix path for pulling for adb to work without setting PATH env variable
fix pushing framework to wrong directory
update smali/baksmali to v1.3.2
update script to compile/decompile using api level 15
added menu selection of fixAllAPKs
Instructions: Important
The default config is for ICS 4.03 base ROM, if you are gonna use it for Gingerbread Base ROM, need to edit the file RemoveDebuggingInfo.bat, and change the -a 15 to -a 10 for API level 10, then just double click start.bat and follow the on screen instruction.
java -jar baksmali-1.3.2.jar -b -a 10 -o .\classes .\classes.dex
java -jar smali-1.3.2.jar -a 10 .\classes -o .\classes.dex
Click to expand...
Click to collapse
Using API level 10 for ICS and API level 15 for GB will not work, you phone will just hang or endless reboots.
Pushing framework will reset all your settings, so if you choose to push framework, do a factory reset instead and just re-install your user apps.
After pushing /system/app, you must reboot to recovery and wipe dalvik and cache, another way of pushing is boot to recovery, mount /system then push.
I have only tested on Gingerbread 2.08.401.1 base, have no idea for ICS, but it should work, as the latest smali/baksmali supports ICS.
If you experience glitches, do it from the beginning by using un-modified apk and jar.
How it works: it is just baksmali (decompile dex to smali code WITHOUT debugging info) and then smali (compile back to dex)
Requirements: java and htc sync usb driver.
==========================================================================================================
Depricated - too much error.
RemoveDebuggingInfo_v2:
Added another script for simpler operations, instead of dragging hundreds of APKs, it is self descriptive, can pull and push /system/app, /system/framework, optimizing all files for app and framework, and reboot to recovery.
Tested on v2.08.401.1 ROM, on all files /system/app, /system/framework, should work on other device and ROM too, but not sure, test it yourself!
==========================================================================================================
For /data/app/ user application files, modify it may not installed at all, re-sign it also not help, so just do it manually to test.
But for now, here is a way to do it manually, since /system partition will not grow and many spaces left, you can simply put some APP on this partition, and following are working on my ROM, some should have naming as com.a.b.c... whatever is the name installed on /data/app/ stripe out the -1 at the end. Just besure the APP is uninstalled before pushing to /system/app/
Below are what I tested.
AdobePhotoshopExpress.apk
BarcodeScanner.apk
com.evernote.skitch.apk
ESFileExplorer.apk
GoogleDocs.apk
GoogleGoggles.apk
GoogleTranslate.apk
GPSTest.apk
org.hermit.audalyzer.apk
For APKs that has lib folder, you can just extract it and put it on /system/lib/ then del the lib folder inside the apk archive, e.g. flashplayer, adobereader.
adb should be start only once after booting your PC, if you get issues, like adb always shows restarting and out of date, it is because the included adb.exe in htc sync is out of date, and you had installed android sdk with environmental variable set, to fix it, both must have same version, or simply delete one of them, and if you have path variable set, you can del the included adb.exe as well.
Thanks for this, I will be sure to use it
Sent from my HTC Sensation XE with Beats Audio Z715e using xda premium
I have 189 Apps in system/app .... is there a way to make it with all files!?
Jonny said:
Thanks for this, I will be sure to use it
Just out of interest, what program do you use for getting the smali code?
Click to expand...
Click to collapse
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
xtcislove said:
I have 189 Apps in system/app .... is there a way to make it with all files!?
Click to expand...
Click to collapse
Yes I know it is so much, but need to write a sohphisticated code, maybe if I have time, I'll try to make it more easier, a vbscript or cmd script, or a shell script in linux. And don't forget the framework files too.
mudhi said:
I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps.
Click to expand...
Click to collapse
It is really so. I have checked it up.
mudhi said:
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
Click to expand...
Click to collapse
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Alfaifi said:
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Click to expand...
Click to collapse
Yes, use dex2jar to jar archive file, then jd-gui to view the source, you can also use DJ-decompiler (commercial) to view and change code, but that's not really readable, and compile back is too hard, and also jbe, ce etc... but I came to a conclusion.
Use dex2jar to decompile dex and use jd-gui to view the source for understand logic, method etc... and just reference it to smali code, and if you get use to it, hacking app will be easier, perhaps more easier than viewing the source code, because hackiing involviing mostly on 0 to 1, true to false, jump to where ... and that is only adding or changing a single code in smali, e.g. logic if a == b then c, if you want to make it always c, then just if 0 == 0 then c, or just a simple jump etc...
@mudhi new smali/baksmali 1.3.2 is out
And is also possible to remove debugging info from jar files that are present in framework folder?
texture said:
And is also possible to remove debugging info from jar files that are present in framework folder?
Click to expand...
Click to collapse
I think you can just rename them to .apk and then back to .jar.
mike1986. said:
I think you can just rename them to .apk and then back to .jar.
Click to expand...
Click to collapse
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
mike1986. said:
@mudhi new smali/baksmali 1.3.2 is out
Click to expand...
Click to collapse
ah... hehe thank you, supposed ICS 4.0.3 is supported. Thank you!
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
WarlockW said:
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
Click to expand...
Click to collapse
You need to set java variable, here's how-to:
http://java.com/en/download/help/path.xml
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
ivicask said:
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
Click to expand...
Click to collapse
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
mudhi said:
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
Click to expand...
Click to collapse
Is there any problem with doing 0 compression on all files? I dont have space problems, and doesnt that make phone run faster as it doesnt need to decompress any data? Saves both CPU and RAM?
drms12 said:
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
Click to expand...
Click to collapse
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
mudhi said:
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
Click to expand...
Click to collapse
Yes
I think you forgot to update the download, It still ver2.
There is an error in script - the push command to upload files to framework uploads them to /system/app
ICS 4.0.3 - got bootloop just after lockscreen shows. Had to restore system.
Hi,
After flashing a custom rom I noticed that rom didn't have my language, so I wanted to add it to this custom rom.
After a great and long journey and thx to the info found on this forum I managed to add the language I wanted.
During the journey I started to write a small tool to make the whole process a bit less painful. The tool has been growing from as simple batch decomiple - recompile apk tool to 1 that adds the value folders and do the resources.arsc switch thing.
This is my 1ste release and is still a beta version so still has some errors, stuff to be added and bad code. But still I hope some of you can use it.
If you got any questions just post or pm
Greetings
Installing the tool.
Just extract all files to your root folder and run the ignite script as root. That's it.
There is a help option that guide you step by step.
EDIT: Small adjustment in the language lists and added the Custom_language_list option
EDIT: Like I said tool is still in beta stage, it seems that yesterday in my hurry to get it ready I screwed up big time (like command to make a cp without telling where to copy to) anyway already beta version 1.1 is out now
UPDATE: 1ste real release out now.
Killed some more bugs
Updated the help page
Added some layout editing
Added or updated the log handeling
how can i insert pt language on last jaggyrom for htc explorer ?
I would appreciate if u created a 'How To' for Super Noobs like me ...
a windows version
If there is a windows version,it will be more appreciated.
bascro said:
I would appreciate if u created a 'How To' for Super Noobs like me ...
Click to expand...
Click to collapse
There is a help function in the tool that guide through most of the steps from the moment you got your hands on tha apk files.
So now the question is how to get those apk files.
Well I like to use Android-Kitchen to unpack rom's, and you'll need that tool anyway to add the new apk files to the rom.
1. Decompile the rom containing the language you want. (Can be stock-rom, your original rom, other custom,...)
2. Copy all the apk files from the systeml/app folder to the stock_APK.
3.Copy the framework-res.apk and com.htc.resources.apk from the system/framework folder to flare/framework and the stock_APK folders
The rest of the how you'll find when you start APK-Fire and use option 'h'
Note: Not all of the apk file will decompile without errors, those that give errors (like market, street, superuser,...) you don't realy need to add language so just delete those apk's from the stock_APK and the decompiled_APK folders.
pedrofidalgo said:
how can i insert pt language on last jaggyrom for htc explorer ?
Click to expand...
Click to collapse
To add portugees you can choose to add all the languages from the South_West_Europe list.
or
you put pt and pt-rPT (each on a diff line) to the Custom_language_list.
then follow the steps you'll find in help option.
picodaren said:
If there is a windows version,it will be more appreciated.
Click to expand...
Click to collapse
There is a windows version called APK Edit
Only prob here is that you have to open the apk that has the wanted language, copy those folders, open the apk from the rom where you want to add the language to and repeat this process for all the apk files 1 by 1.
If you take this road plz let me know how long it took yah
i have jaggy rom. and a backup of my stock rom in Portuguese. can i install pt language on jaggy rom ?
Need a little help .. : p
pedrofidalgo said:
i have jaggy rom. and a backup of my stock rom in Portuguese. can i install pt language on jaggy rom ?
Need a little help .. : p
Click to expand...
Click to collapse
sure you can.
Step trough:
1 Set-up Android-kitchen
2 Decompile your stock rom
3 copy the content of the system/apk folder to the APK-Fire/stock_APK
4 copy the 2 apk files from system/framework to APK-Fire/stock_APK AND APK-Fire/flare/framework
5 Start APK-Fire and install the frameworks (option 1)
6 Decompile the apk files (option 2)
7 Add the language code to the Custom_language_list each language code get's it's own line. (you find this file in the APK-Fire/lighter folder) for portugees you add something like this:
pt
pt-rPT
8 Get the value folders containing the portugees language (option 4)
9 Now you can choose to back up the stock_apk and the decompiled_apk folders (option 6 / 1) or delete the content of those 2 folders.
10 Got back to the kitchen and decompile the Jaggyrom and repeat the steps 2 till 6 as before.
11 Now copy the value folders you took from the stock rom to the jaggyrom (option 5)
12 Recompile the apk files (option 3)
(check log for errors, warnings you could ignore but errors need attention, be aware that non stock apps mostly will give errors but those also don't need additional language)
13 Do the resources.arsc switch thing to fool the signature security (option 6)
(for more info what this is all about read the switch_resources script)
14 Copy your upgraded apk files from the APK-Fire/firebox/translated_APK folder to the Android-kitchen/WORKING_****/system/app (don't forget to copy the 2 framework apk files to the Android-kitchen/WORKING_****/system/framework folder and not the app folder)
15 Cook your rom
16 Flash the rom
17 Hold your fingers crossed while booting
18 Hopely enjoy the costum rom in your desired language.
Hope this helps you.
Cosmoon said:
sure you can.
Step trough:
1 Set-up Android-kitchen
2 Decompile your stock rom
3 copy the content of the system/apk folder to the APK-Fire/stock_APK
4 copy the 2 apk files from system/framework to APK-Fire/stock_APK AND APK-Fire/flare/framework
5 Start APK-Fire and install the frameworks (option 1)
6 Decompile the apk files (option 2)
7 Add the language code to the Custom_language_list each language code get's it's own line. (you find this file in the APK-Fire/lighter folder) for portugees you add something like this:
pt
pt-rPT
8 Get the value folders containing the portugees language (option 4)
9 Now you can choose to back up the stock_apk and the decompiled_apk folders (option 6 / 1) or delete the content of those 2 folders.
10 Got back to the kitchen and decompile the Jaggyrom and repeat the steps 2 till 6 as before.
11 Now copy the value folders you took from the stock rom to the jaggyrom (option 5)
12 Recompile the apk files (option 3)
(check log for errors, warnings you could ignore but errors need attention, be aware that non stock apps mostly will give errors but those also don't need additional language)
13 Do the resources.arsc switch thing to fool the signature security (option 6)
(for more info what this is all about read the switch_resources script)
14 Copy your upgraded apk files from the APK-Fire/firebox/translated_APK folder to the Android-kitchen/WORKING_****/system/app (don't forget to copy the 2 framework apk files to the Android-kitchen/WORKING_****/system/framework folder and not the app folder)
15 Cook your rom
16 Flash the rom
17 Hold your fingers crossed while booting
18 Hopely enjoy the costum rom in your desired language.
Hope this helps you.
Click to expand...
Click to collapse
i dont know how to do it :/
if i give you my backup can you add pt language for the last jaggyrom ?
cumps
really??
I've already robbed the experience from you of wandering through the jungle of this mystic entity called Android by making the wandering seem nothing more then a walk through the park.
And now you tell me you don't want to know this mystic entity?
Nah I don't buy that, you almost got me there.
I'm willing to guide you through every step but I refuse to carry you.
If you'r on IRC or msn or I can meet you there to start your journey.
Btw at the current rate Jaggyjags is spitting out rom's I can't keep up adding stuff for everyone so I go by the rule:
You translate 1 version of a rom for a man and you made him happy till the release of the next version. You teach a man how to translate a rom and you made him happy for many versions
pedrofidalgo said:
i dont know how to do it :/
if i give you my backup can you add pt language for the last jaggyrom ?
cumps
Click to expand...
Click to collapse
seriously, I know you like your phone and want get the best out of it but your maximum effort is installing .zip roms or .zip updates?
you've got 2 options.
1. Stick with whatever you have right now: your Portuguese backup or any available custom rom.
2. research, research again, try things out and learn. Try to stop asking people to do things for you. It's difficult, I know, specially when you are used to it, but don´t worry, it always is.
Believe me, it is a really nice feeling when you get things done on your own.
good luck
Would you teach us HOT TO DO IT MANUALLY (without using APK Fire)
pmeler said:
Would you teach us HOT TO DO IT MANUALLY (without using APK Fire)
Click to expand...
Click to collapse
Well.... all right then
I've explained most of how to add language already, k most of it in close relation with the use of APK-Fire. Anyway I'll try to explain the whole process starting from the base rom till the modified one.
Step 1
Check if your (custom) rom really really doesn't have your language. Try also 'morelocal' app. This simple step can save you lot's of time
Step 2
Now that you't sure that the (custom) rom doesn't have your language or you just want to add more languages to the rom you build your self you have to go and look for roms that do have the language(s) your want to add.
Possible finding places:
- different versions of the leaked stock rom
- Others people custom rom's
- Rom's for other devices. ! Won't work for the 2 framework apk files, but has good chances to work with the other apk files !
Step 3
Question now probably is how can I find out what languages a rom contains (specialy those for other devices). Well easy, you just have to dismantle the rom's and to be sure a few apk files.
The easyest way to dismantle a rom is to use Android-Kitchen. This tool doesn't need alot of installing or modification but I do recommend you read the how to etc.
So now you have easy access to all the content files of the rom.
Take a few apk files from the system/app folder and dismantle them with 'Apk Tool' or if you realy want to go hardcore 'aapt'. And check the 'app-name'/res for 'values-*' folders that you need.
Step 4
Now that you've found the folders containing the translation (those values-* folders) you've got to copy them to to 'app-name'/res of the afk file from the rom you want to add language to.
dismantled app from copy value folders dismantled app from
rom with language -----------------> rom without language
Step 5
recompile the dismantled app where you just added the value folders to
Step 6
You thought you where allmost done didn't you??? Now the real fun part just starts.
In order to bypass the security that check for the integity of the apk file we need to cheat abit.
You need the new apk file and the original apk (the one without the language)
*rename the 'app-name'.apk file (from both version) to 'app-name'.zip
*delete the resources.arsc file from the original 'app-name'.apk (now temporaly 'app-name'.zip)
*take that same file from the new apk file and copy it to the original apk
* rename the original back from 'app-name'.zip to 'app-name'.apk
* Copy that apk file back into the rom (Android-Kitchen remember)
Step7
Now you repeat this proces for ALL apk files you find in the rom.
Yup all +100 apk files from 1 rom + the same +100 apk files from the other rom need to get this treatment.
Step 8
Cook rom
So you see 8 simple step is more or less what it takes.
Same tutorial but better here
Even more resources here and here
Updated the tool
Cosmoon said:
Updated the tool
Click to expand...
Click to collapse
It doesn't seem to do the last step for me. The one that is supposed to copy the resources.arsc. It just creates another copy of the stock, without the new resources.arsc.
Any idea of what's going on? Would be a flavor to not have to do this manually!
Hmm I fully tested the latest update with the 2 rframework apk files and everything worked fine.
Are you sure that it's just a copy of the stock apk folder?
The switch_resources script does all the final steps. renaming, delete file from stock, copy from new to stock and rename back.
As I still have to add loggin to this part you should see an output on screen showing what the script is/was doing.
While that part is running you should see a folder called 'temp' (inside firebox or 1 of the subfolders of firebox).
Inside the firebox/recompiled_APK you should find a folder for each app containing the resources.arsc file.
And as last check you can compair the size of the 3 diff apk files. (stock, recompiled and translated). If I'm not mistaken the translated is the smallest (how strange it may sound)
Also make sure the tool is in your root folder.
If possible send me the output you get during this fase.
Cosmoon said:
Hmm I fully tested the latest update with the 2 rframework apk files and everything worked fine.
Are you sure that it's just a copy of the stock apk folder?
The switch_resources script does all the final steps. renaming, delete file from stock, copy from new to stock and rename back.
As I still have to add loggin to this part you should see an output on screen showing what the script is/was doing.
While that part is running you should see a folder called 'temp' (inside firebox or 1 of the subfolders of firebox).
Inside the firebox/recompiled_APK you should find a folder for each app containing the resources.arsc file.
And as last check you can compair the size of the 3 diff apk files. (stock, recompiled and translated). If I'm not mistaken the translated is the smallest (how strange it may sound)
Also make sure the tool is in your root folder.
If possible send me the output you get during this fase.
Click to expand...
Click to collapse
They are identical, not even smaller so Although i was running this in cygwin on windows so it might be that. I'll try to boot it up in ubuntu to see if it's any difference Could be the su that's messing with me in cygwin :S
leolulz said:
They are identical, not even smaller so Although i was running this in cygwin on windows so it might be that. I'll try to boot it up in ubuntu to see if it's any difference Could be the su that's messing with me in cygwin :S
Click to expand...
Click to collapse
Never tried it on windows with cygwin, I'm running a debian linux, so that could be the thing that's messing it up.
Still good to know that only that part doesn't work on windows, I'll see if I can modify the script.
THANK YOU Cosmoon !
I asked because I want to remove unsued language from framework-res.apk to make it slimmer
Cosmoon said:
Never tried it on windows with cygwin, I'm running a debian linux, so that could be the thing that's messing it up.
Still good to know that only that part doesn't work on windows, I'll see if I can modify the script.
Click to expand...
Click to collapse
Ye, but it could work although, i never checked the su/root stuff, kinda rushed it yesterday to see how it worked Anyways it's a nice script and ill love to see this project getting further
pmeler said:
THANK YOU Cosmoon !
I asked because I want to remove unsued language from framework-res.apk to make it slimmer
Click to expand...
Click to collapse
Hmm never thought about that. Only thinking of adding stuff but having a option to remove can be handy to.
I'll add it in the next update.
Thx great idea man
Due ART changes, Quick Deodex doesn't work with Android Lollipop/Marshmallow/Nougat ROMs. I might update this script some day, but due other priorities and lack of time, this tool is currently unmaintained.
Well, if you ever tried to deodex a single APK file you should know how tricky this process can be. Searching XDA we find various tools and tutorials in how to deodex but most of them may look complicated enough to make a newbie or an user that never messed around with Android system give up. So, I wrote my own script to simplify two tasks: deodexing and zipaligning. I also made this script with newbies in mind, so, I did my best to make this tool as straightforward, small and portable as possible.
Requirements
• For Linux, you need OpenJDK 6 or newer
• For Windows, you need Java SE runtime 6 or newer
Instructions
• Download the script and extract it somewhere
• Grab a copy of the folders "framework", "app" and "priv-app" (optional, KitKat only) and put them inside "files" folder
• Run quick_deodex.bat (or quick_deodex.sh on Linux) and wait while the files are being deodexed
• After the script finishes, all files inside the folders you copied before will now be deodexed and zipaligned.
Any file that fail to deodex will be skipped and left intact, so you can fix what caused the problem and run the tool again. If all files fail to deodex, make sure Java runtimes are installed properly
Frequently Asked Questions
Q: I keep getting "Framework not found" error. What should I do?
A: For most APKs you can only deodex if you have the framework files, so, I made this a requirement, even if you want to deodex only a single file. In that case, grab a copy of "framework" folder from the same ROM you got the APK and run this script again, it'll fix that.
Q: I'm trying to deodex an entire ROM but some files get errors and aren't deodexed. What should I do?
A: This usually occur only if the files you're trying to deodex and the framework are from different ROM versions. If the files are all from the same ROM version and you're still getting this, try updating smali and baksmali components used by this script by downloading an updated copy and replacing the ones this script uses (located in "tools" folder).
Changelog
Version 1.0.2
• Minor bug fixes (Linux only)
Version 1.0.1
• Now compatible with Linux
Version 1.0
• Initial release
+1
It work without errors.
thanks man, it's first tools that perfectly worked.
Hey, has anyone tested the Linux version? Did it work? Linux users, leave some feedback
mbc07 said:
Hey, has anyone tested the Linux version? Did it worked? Linux users, leave some feedback
Click to expand...
Click to collapse
I will test out the Linux script later, in the process of doing clean install of 14.04 and setting up build environment, currently the windows verison is running though, looks like you have done a very nice job here, thank you a lot.
Version 1.0.2 is out, it fixes "Permission denied" errors that may occur in some Linux distros...
mbc07 said:
Version 1.0.2 is out, it fixes "Permission denied" errors that may occur in some Linux distros...
Click to expand...
Click to collapse
Still haven't gotten around to it, If all else fails, I will get time this weekend, stuck doing some cad drawings the next few days!
I keep getting this error in Ubuntu 14.04. ( Using Java7 Open JDK AMD64 version )
Exception:
Code:
JNLParseException[ Could not parse launch file. Error at line 0.]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Wrapped Exception:
Code:
Failed to find the '<' charater that marks the end of a CDATA element. Exception parsing xml at line 0
at com.sun.deploy.xml.XMLParser.skipPCData(Unknown Source)
at com.sun.deploy.xml.XMLParser.nextToken(Unknown Source)
at com.sun.deploy.xml.XMLParser.parse(Unknown Source)
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
@DarkAngel if it's a Java error, then it's related either to smali/baksmali or to the input files, not to the script itself. I would suggest testing the files you're trying to deodex in other tools, if they work, report to me what tool worked so I can try to figure out what's wrong in Quick Deodex...
@mbc07 I did keep seeing that and even made sure my path was set for Java. I'll see what I can come up with.
Having switched to a new Laptop has had me looking for new things as I was already set up before. ADB/Fastboot, JOdin3/Heimdall I can do fine. Windows I'm good to go as well I just rather do more/learn more in Linux this time around.
@mbc07
I tried it once again, this time uninstalling & purging all copies of Java ( only had version 7 & 8 though ) and then reinstalled version 7 only. I still get the same error. I did also try updating the smali and baksmali components just in case but no dice.
-------------------------------------
Windiows version, on the other hand, did go smoothly with no problems for me at all. Deodexed both folder perfectly w/ no errors ( JB 4.2.2 ). Tried them on a phone I have and all is working perfectly. :good:
With Dalvik runtime the deodexed files works well but when switching to ART I'm having bootloop.
Tested with Nexus 4 stock 4.4.4 KTU84P (during the deodex process there wasn't any errors) and clean install (factory reset)
Try updating smali / baksmali, I'm not running KitKat so there's not much I can do to test that =/
mbc07 said:
Try updating smali / baksmali, I'm not running KitKat so there's not much I can do to test that =/
Click to expand...
Click to collapse
If this can help you to fix the bug (or help someone else that encounter the same problem), I solved the problem by using this deodexer with compression level 0.
Desno365 said:
If this can help you to fix the bug (or help someone else that encounter the same problem), I solved the problem by using this deodexer with compression level 0.
Click to expand...
Click to collapse
Thanks for the tip, I'll take a look at it...
THANK YOU!!!!
mbc07 said:
Well, if you ever tried to deodex a single APK file you should know how tricky this process can be. Searching XDA we find various tools and tutorials in how to deodex but most of them may look complicated enough to make a newbie or an user that never messed around with Android system give up. So, based in Kamome tool and @RyokoN work, I wrote my own script to simplify two tasks: deodexing and zipaligning. I also made this script with newbies in mind, so, I did my best to make this tool as straightforward, small and portable as possible.
Requirements
• For Linux, you need OpenJDK 6 or newer
• For Windows, you need Java SE runtime 6 or newer
Instructions
• Download the script and extract it somewhere
• Grab a copy of the folders "framework", "app" and "priv-app" (optional, KitKat only) and put them inside "files" folder
• Run quick_deodex.bat (or quick_deodex.sh on Linux) and wait while the files are being deodexed
• After the script finishes, all files inside the folders you copied before will now be deodexed and zipaligned.
Any file that fail to deodex will be skipped and left intact, so you can fix what caused the problem and run the tool again. If all files fail to deodex, make sure Java runtimes are installed properly
Frequently Asked Questions
Q: I keep getting "Framework not found" error. What should I do?
A: For most APKs you can only deodex if you have the framework files, so, I made this a requirement, even if you want to deodex only a single file. In that case, grab a copy of "framework" folder from the same ROM you got the APK and run this script again, it'll fix that.
Q: I'm trying to deodex an entire ROM but some files get errors and aren't deodexed. What should I do?
A: This usually occur only if the files you're trying to deodex and the framework are from different ROM versions. If the files are all from the same ROM version and you're still getting this, try updating smali and baksmali components used by this script by downloading an updated copy and replacing the ones this script uses (located in "tools" folder).
Q: I want to deodex a KitKat ROM, but it have an additional "priv-app" folder with .odex files. Is this script compatible?
A: Yes, it is. When "priv-app" folder is present, the script handle it accordingly. Otherwise the script assumes it's a JellyBean ROM or older and skips "priv-app".
Changelog
Version 1.0.2
• Minor bug fixes (Linux only)
Version 1.0.1
• Now compatible with Linux
Version 1.0
• Initial release
Click to expand...
Click to collapse
Thank you so much!!! My phone doesn't play nice with deodexing. I've tried before to deodex my files with the kitchen, but always had problems. This tool is so easy to use, and it seems to work perfectly!!!! I have an old phone (LG Spectrum), and I am still a NOOB, but with your tool, I now have a debloated, customized deodexed zipaligned rom I can flash with no problems!!!!!
Thanks a bunch for this and thankkkkkks for making it work for linux, cant believe all the folks making deodex scripts that only work on windows tyty.
works perfectly .. just wanted to know how can i know is it zipling or not?
manan001 said:
works perfectly .. just wanted to know how can i know is it zipling or not?
Click to expand...
Click to collapse
The script zipalign the file right after it gets deodexed. If the zipalign process fails, the script will output "FAILED" and the file will remain untouched.
In other words, if you got "DONE" in the script, the file were successfully deodexed and zipaligned...
Nice tool but not working in windows 64bit but working fine in 32bit
Downloaded the latest update of smali/baksmali but the result is almost 50% ERROR, others DONE
modfiles said:
Nice tool but not working in windows 64bit but working fine in 32bit
Downloaded the latest update of smali/baksmali but the result is almost 50% ERROR, others DONE
Click to expand...
Click to collapse
The script works perfectly in 64-bit editions of Windows. However, you need also to install 64-bit edition of Java, otherwise it won't work. About your errors, check your input files, if possible, try to find another tool that successfully deodex them and tell me which tool is so I can take a look and fix Quick Deodex :good:
EDIT 2 : WAIT NO MORE! Thanx to our friend @joeldroid for his AMAZING TOOL that can batch deodex lollipop files.!
Head over HERE and learn more about it. It is in early stages but works perfectly!
EDIT : I didn't made these tools as I said I compiled (gathered) a set of tools and wrote the guide and so mentioned on XDA Portal that I created a "Quick Guide" please refer that point. Credit goes to the devs of these tool creator. I am extremely sorry for my ignorance but I don't know the devs, please PM me your names so I can give proper credits.
A related guide to this can be found here on this blog, here is the link http://softdx.kr/220200813802
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.
* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.
* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex
So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.
Procedure
1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.
2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter
3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.
4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.
5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.
6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".
7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"
Hope this guide makes you to deodex your required file(s) properly
P.S. I am not big of a dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide , if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :fingers-crossed:
Any suggestion(s) are welcome.:laugh:
For Example
Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then
1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.
Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.
In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.
Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.
Now, the recompiling process to generate classes.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SemcVideo.apk video files with file newly created classes.dex
Hope this helps.
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .
hlxanthus said:
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Click to expand...
Click to collapse
Yup working on the batch deodex thing hope some advanced dev can write a program and help in batch deodexing
hlxanthus said:
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .
Click to expand...
Click to collapse
Check Post 2 added an example
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
any method to do this on linux?
what do u push to phone? i pushed apk i drug over earlier and wont install?
---------- Post added at 07:42 PM ---------- Previous post was at 07:40 PM ----------
i did following:
1) unzipped the oat2dex archive
2) run command prompt
3) drag apk and apk.odex.xz
4) follow all steps successfuly
5) what gets pushed to phone? I found apk i drug over in step 3? or do i find in a folder or where lol.. is the apk.odex go too?
This doesn't touch your phone at all . . you put the apk and odex file in the tools directory and follow the guide, see the example in the second post.
Tech N You said:
For Example
Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then
1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.
Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.
In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.
Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.
Now, the recompiling process to generate classdex.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex
Hope this helps.
Click to expand...
Click to collapse
Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.
Regards
hlxanthus said:
This doesn't touch your phone at all . . you put the apk and odex file in the tools directory and follow the guide, see the example in the second post.
Click to expand...
Click to collapse
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
anyone know how to convert the modified dex file back to oat format odex?
i found dex2oat, but it is an android binary; would like to be able to convert on pc.
i'm hoping there's a way to do this to be able to make minor smali edits without deodexing the entire system.
hlxanthus said:
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
Click to expand...
Click to collapse
I am so sorry for late reply. Glad it worked. Some files that don't have .odex.rz can be deodexed simply by Xultimate. Give a try
Hi, no I am sorry but I have no expertise on Linux may be some of you can try this to port to linux
fhem said:
Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.
Regards
Click to expand...
Click to collapse
Great, If you face any FC issues try to avoid those apk's as this is still a beta phase but many devs out there can work on this to make it stable.
lewonsky said:
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
Click to expand...
Click to collapse
Hi, First refer this guide for difference b/w odex and deodex http://forum.xda-developers.com/showthread.php?p=40026270#post40026270
It will not make it compatible with Xposed, but you can manually theme it as many themers do or you can port apps to different android versions.
elliwigy said:
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
Click to expand...
Click to collapse
After deodexing the files successfully you can create flashable zip and flash via recovery, as I can see that Lollipop already has TWRP for it.
Tech N You said:
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.
* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.
* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex
So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.
Procedure
1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.
2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter
3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.
4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.
5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.
6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".
7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"
Hope this guide makes you to deodex your required file(s) properly
P.S. I am no dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide , if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :fingers-crossed:
Any suggestion(s) are welcome.:laugh:
Click to expand...
Click to collapse
don't be posting the you create this mode ..! i was the one the found how to get the job down ..thank you to (Goldie) and ( tdunham) and SAC23) for creating the tools ...NOT YOU ! give the credit to proper person.. .it's not about creating a conflict without you.
ORIGINAL
http://forum.xda-developers.com/gal...-5-0-gonna-t2961967/post57262607#post57262607
hlxanthus said:
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
Click to expand...
Click to collapse
You can find it on "/system/framework/arm/" directory.
---------- Post added at 11:18 PM ---------- Previous post was at 11:13 PM ----------
Tech N You said:
For Example
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex
Hope this helps.
Click to expand...
Click to collapse
Thank you very much!!But, do you know how to re-odex the modified dex file?