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?
Is there a way to take certain themed apks from different theme zips and apply them to a rom without using metamorph? I am trying to take just the dialer and contacts themed apk from incognito thus bypassing the framwork to apply to a ruby rom?
http://www.mediafire.com/?ll51ycclfv7l9vy
down load this zip. extract it in your pc.
then get the app folder from the rom you want to port and put it in the "old" folder.
then put the app folder from the rom you want to mod and put it in the "new" folder.
run the script, and it will mod all your apps to the new folder. but only matching apps will mod.
now get the app folder from the "new" folder and adb push to your phone. (sytem/app)
this program is actually for porting themes. you put the framework folder and app folder from a theme not compatible with your phone or rom into the "old" folder, and the framework and app folder from the rom you are running in to the "new" folder, and run the script. it will theme all matching apps and framework. but they have to be matching systems (2.2-2.2 and 2.1-2.1). this is not my work so i take no credit for this!!! this is all Daneshm90 from the G1 forum......
ill give it a shot thanks!
No luck my phone boot loops is there another way of pushing the dialer and contacts from one them to a rom?
I would like to Theme Phone,Contact,Setting,Browser,Music and Vending.
Is this the right way? (Root Explorer)
Create a back up
Pull the apk.
edit the images
replace the images.
(I dont need to sign right?)
put them back on /system/app
set permissions
Reboot
thanks. I will be sharing after i'm done.
There's a lot more to theming than simply replacing images. That's just the tip of the iceberg.
i am new to android, but i read that you can open .rfs files with magic iso...and its true...
i have a question for experienced mooders... if i delete some files from .rfs, will the firmware still work?
i want to delete (as a plan...) from system.rfs
1. from apps:
TouchWiz30Launcher.apk & odex (i dont like touchwiz)
Dualclock.apk & odex (i dont need it)
SamsungWidget_FeedAndUpdate.apk & odex (i dont need it)
2. from media:
bootani.qmg & samsungani.qmg (i think ...no ani at boot => faster boot)
shutdown.qmg (a few seconds can save a little battery)
please help me to understand better...thanks
I cant answer your question directly, but perhaps offer an altarnative partial solution. check out titanium backup, requires root but will allow you to remove system apps. I would be wary of removing touchwiz though, just use another launcher, I like zeam, but there are others like adw, and launcherpro and helauncher, lots more in the market most are free.
im more intereested in using the stock one, i want to bring my samsung as close as possible to the stock android, and remove the useless junk that samsung put there,
Here's a tiny package to be installed with xRecovery, for people who would like to disable the boot animation.
It replaces the animation with a dummy bootanimation.zip (backup your bootanimation.zip if you use a custom animation)
Thanks to Oskar.k for the inspiration.
Tested on WB-XPERIA TW Gingerbread but should work on any rom.
If you install a new rom, theme, or wipe cache, the first boot can take more than 5 minutes. When installing this you will get a black screen instead of a picture from a boot animation, don't mistake it for a crash/freeze.
Installation:
- in xRecovery, install custom.zip, xRecovery-BootAnimationDisable.zip
or
- copy bootanimation.zip to /system/media/bootanimation.zip using a root explorer like Estrongs File Explorer (free from Market)
To install the stock animation, do the same with xRecovery-BootAnimationStock.zip
Apparently the clean way to disable the boot animation would be to add those lines to /system/build.prop:
ro.kernel.android.bootanim=0
debug.sf.nobootanimation=1
It works and it's a cleaner solution but it doesn't seem to be any faster.
I think a xRecovery package is the most convenient to use when installing/updating roms.
I see u uploaded, but there arent any credits for ideas :/
Sent from my own maded GB X10.
Sorry Oskar.k, It's not my style! I did wonder if I should mention it but I didn't think you'd consider it your idea or discovery that messing with the file disabled the animation, it was so trivial... the xRecovery package is so trivial too. To disable something, messing with a file is the first thing someone tries (right after deleting a file). But you did save me a couple minutes to test this for myself because I did open your file to notice why it disabled the animation (no files to be used in the 2MB zip), and your post is the inspiration for making a convenient solution for myself, that I'm sharing here in case it helps others, so I edited the post to mention you. No hard feeling?
ALL IS GREAT
Sent from my own maded GB X10.