Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)

Do you find the latest beta functional ?

  • Yes

    Votes: 1,105 74.6%
  • No

    Votes: 376 25.4%

  • Total voters
    1,481
Search This thread

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Farmatito, i just realized my batch apk optimize option doesnt take out the .9 png's. This is wht the new apkopt file looks like

Code:
@echo off
if (%1)==() GOTO END
@echo Optimizing %1...
md "%~dp0apkopt_temp_%~n1"
md "%~dp0original"
md "%~dp0optimized"
7za x -o"%~dp0apkopt_temp_%~n1" "../place-apk-here-to-batch-optimize/%1"
[COLOR="Red"][B]mkdir temp
xcopy "%~dp0apkopt_temp_%~n1\res\*.9.png" "%~dp0temp" /S /Y[/B][/COLOR]
:: 
:: -o99 specifies how much the PNG is optimized. Lower numbers will make the optimization process faster, higher numbers will result in smaller PNGs.
::
roptipng -o99 "%~dp0apkopt_temp_%~n1\**\*.png"
copy "..\place-apk-here-to-batch-optimize\%1" "%~dp0original"
del /q "..\place-apk-here-to-batch-optimize\%1"

:: 
:: -mx5 indicates the ZIP's compression level. Set this from -mx0 to -mx9, higher compression levels may not work!
:: 
[COLOR="red"][B]xcopy "%~dp0temp" "%~dp0apkopt_temp_%~n1\res" /S /Y
rmdir "%~dp0temp" /S /Q[/B][/COLOR]
7za a -tzip "%~dp0optimized\%~n1.unaligned.apk" "%~dp0apkopt_temp_%~n1\*" -mx9 

rd /s /q "%~dp0apkopt_temp_%~n1"

::
:: runs zipalign
::
zipalign -v 4 "%~dp0optimized\%~n1.unaligned.apk" "%~dp0optimized\%~n1.apk"
del /q "%~dp0optimized\%~n1.unaligned.apk"
@echo Optimization complete for %1
:END
call apkopt_all
 
Last edited:

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
OK, I know this app is for total noobs, but I'm probably more than that. I wanted to edit an apk for fun and test whether it's working or not. What I did.

1. Copied the apk for xda application from /system/sd/app/ and put it on "place apk here for modding" folder. Uninstalled the app from my phone.
2. Opened the application for editing apks.
3. Clicked "extract apk".
4. Opened folder out/drawable and modified the "appicon" file, added small polish flag in paint there.
5. Clicked "zip apk", chosen normal apk.
6. Deleted the original "xda.apk" and left only the "unsigned" file.
7. Clicked "sign apk".
8. Put the apk on my mobile and tried to install it. It says it can't install, altough it shows me the modified icon.

What am I doing wrong? Do I have to put the folder with the APK Manager where my SDK/ADB is?
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Hmm you have followed the steps correctly. Fyi u dont have to delete the original unmodified app u are editing. Can u try installing it through adb ? im interested as to what error u are getting. The only thing i can think of is the compression level im using for making the apk's which is 9 (highest possible) perhaps lowering will allow compatibility.

Adb install is one of the options in the script and works if adb is in ur path.

Fyi, the app aint for noobs, i use it all the time since it makes the process of compiling/signing/installing easy as pie :)
 

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
I'll try to do it later. Now I'm studying for the final exams session. Studying at the university in Poland. Second year...

edit: what you mean in your path?

edit2: nevermind, just found the answer.
 

farmatito

Senior Member
Apr 28, 2009
569
130
Oppo Find 7a
Farmatito, i just realized my batch apk optimize option doesnt take out the .9 png's. This is wht the new apkopt file looks like

Code:
@echo off
if (%1)==() GOTO END
@echo Optimizing %1...
md "%~dp0apkopt_temp_%~n1"
md "%~dp0original"
md "%~dp0optimized"
7za x -o"%~dp0apkopt_temp_%~n1" "../place-apk-here-to-batch-optimize/%1"
[COLOR="Red"][B]mkdir temp
xcopy "%~dp0apkopt_temp_%~n1\res\*.9.png" "%~dp0temp" /S /Y[/B][/COLOR]
:: 
:: -o99 specifies how much the PNG is optimized. Lower numbers will make the optimization process faster, higher numbers will result in smaller PNGs.
::
roptipng -o99 "%~dp0apkopt_temp_%~n1\**\*.png"
copy "..\place-apk-here-to-batch-optimize\%1" "%~dp0original"
del /q "..\place-apk-here-to-batch-optimize\%1"

:: 
:: -mx5 indicates the ZIP's compression level. Set this from -mx0 to -mx9, higher compression levels may not work!
:: 
[COLOR="red"][B]xcopy "%~dp0temp" "%~dp0apkopt_temp_%~n1\res" /S /Y
rmdir "%~dp0temp" /S /Q[/B][/COLOR]
7za a -tzip "%~dp0optimized\%~n1.unaligned.apk" "%~dp0apkopt_temp_%~n1\*" -mx9 

rd /s /q "%~dp0apkopt_temp_%~n1"

::
:: runs zipalign
::
zipalign -v 4 "%~dp0optimized\%~n1.unaligned.apk" "%~dp0optimized\%~n1.apk"
del /q "%~dp0optimized\%~n1.unaligned.apk"
@echo Optimization complete for %1
:END
call apkopt_all

Will check when at home.

Enjoy
 

farmatito

Senior Member
Apr 28, 2009
569
130
Oppo Find 7a
Hmm you have followed the steps correctly. Fyi u dont have to delete the original unmodified app u are editing. Can u try installing it through adb ? im interested as to what error u are getting. The only thing i can think of is the compression level im using for making the apk's which is 9 (highest possible) perhaps lowering will allow compatibility.

Adb install is one of the options in the script and works if adb is in ur path.

Fyi, the app aint for noobs, i use it all the time since it makes the process of compiling/signing/installing easy as pie :)

You have to uninstall the original apk and then install or push the resigned
as the certificates don't match
 

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
me said:
OK, I know this app is for total noobs, but I'm probably more than that. I wanted to edit an apk for fun and test whether it's working or not. What I did.

1. Copied the apk for xda application from /system/sd/app/ and put it on "place apk here for modding" folder. Uninstalled the app from my phone.
2. Opened the application for editing apks.

But anyway thanks.. gonna try to do this with pushing the file and report back.
 

farmatito

Senior Member
Apr 28, 2009
569
130
Oppo Find 7a
Attached V0.5

# Changelog for linux version:
# v 0.1 Initial version
# v 0.2 added "other" dir to PATH
# v 0.3 removed "function" bashism
# v 0.4 removed more bashisms
# v 0.5 added ogg batch optimization and quoted some vars

Enjoy.
 

Attachments

  • V0.5-Script.sh.zip
    2.4 KB · Views: 29

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
OK I tried installing it through apk manager. What I get (this time I did quick modification and selected option number 7 to zip, sign and install):

Code:
1    System apk
2    Regular apk
Please make your decision: 2

7-Zip (A) 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
Scanning

Creating archive ../place-apk-here-for-modding/repackaged-unsigned.apk

Compressing  AndroidManifest.xml
Compressing  classes.dex
Compressing  resources.arsc
Compressing  res\anim\fade_in.xml
Compressing  res\anim\fade_out.xml
Compressing  res\anim\hyperspace_in.xml
Compressing  res\anim\hyperspace_out.xml
Compressing  res\anim\push_left_in.xml
Compressing  res\anim\push_left_out.xml
Compressing  res\drawable-hdpi\icon.png
Compressing  res\drawable-ldpi\icon.png
Compressing  res\drawable-mdpi\icon.png
Compressing  res\drawable\appbackground.xml
Compressing  res\drawable\appbackgroundlight.xml
Compressing  res\drawable\appicon.png
Compressing  res\drawable\back.png
Compressing  res\drawable\bg_blue.png
Compressing  res\drawable\blank_tile.png
Compressing  res\drawable\blank_tile_white.png
Compressing  res\drawable\bookmarked.png
Compressing  res\drawable\browseforums.png
Compressing  res\drawable\close_thread.png
Compressing  res\drawable\default_avatar.png
Compressing  res\drawable\default_category.png
Compressing  res\drawable\default_forum.png
Compressing  res\drawable\default_subforum.png
Compressing  res\drawable\divider_bright.png
Compressing  res\drawable\entrynewforums.png
Compressing  res\drawable\error.png
Compressing  res\drawable\expander_ic_minimized.png
Compressing  res\drawable\fastback.png
Compressing  res\drawable\fastforward.png
Compressing  res\drawable\favorites.png
Compressing  res\drawable\forward.png
Compressing  res\drawable\frame.9.png
Compressing  res\drawable\head.png
Compressing  res\drawable\icon.png
Compressing  res\drawable\ic_menu_gallery.png
Compressing  res\drawable\ic_menu_register.png
Compressing  res\drawable\imgback.png
Compressing  res\drawable\inbox.png
Compressing  res\drawable\logo_bottom.png
Compressing  res\drawable\menu_attachment.png
Compressing  res\drawable\menu_login.png
Compressing  res\drawable\menu_logoff.png
Compressing  res\drawable\menu_search.png
Compressing  res\drawable\menu_subscribe.png
Compressing  res\drawable\morefootlogo.png
Compressing  res\drawable\newpost.png
Compressing  res\drawable\next.png
Compressing  res\drawable\picture_frame.png
Compressing  res\drawable\quoteicon.png
Compressing  res\drawable\reply.png
Compressing  res\drawable\status_bar_background.png
Compressing  res\drawable\tabbookmark.png
Compressing  res\drawable\tabbookmarks.png
Compressing  res\drawable\tabbookmark_icon.xml
Compressing  res\drawable\tabforum.png
Compressing  res\drawable\tabforum_icon.xml
Compressing  res\drawable\tabforum_selected.png
Compressing  res\drawable\tablatest.png
Compressing  res\drawable\tablatest_icon.xml
Compressing  res\drawable\tablatest_selected.png
Compressing  res\drawable\tabmore.png
Compressing  res\drawable\tabmore_icon.xml
Compressing  res\drawable\tabmore_selected.png
Compressing  res\drawable\timepicker_down_btn.xml
Compressing  res\drawable\timepicker_down_disabled.9.png
Compressing  res\drawable\timepicker_down_disabled_focused.9.png
Compressing  res\drawable\timepicker_down_normal.9.png
Compressing  res\drawable\timepicker_down_pressed.9.png
Compressing  res\drawable\timepicker_down_selected.9.png
Compressing  res\drawable\timepicker_input.xml
Compressing  res\drawable\timepicker_input_disabled.9.png
Compressing  res\drawable\timepicker_input_normal.9.png
Compressing  res\drawable\timepicker_input_pressed.9.png
Compressing  res\drawable\timepicker_input_selected.9.png
Compressing  res\drawable\timepicker_up_btn.xml
Compressing  res\drawable\timepicker_up_disabled.9.png
Compressing  res\drawable\timepicker_up_disabled_focused.9.png
Compressing  res\drawable\timepicker_up_normal.9.png
Compressing  res\drawable\timepicker_up_pressed.9.png
Compressing  res\drawable\timepicker_up_selected.9.png
Compressing  res\drawable\twitter.png
Compressing  res\drawable\whosonline.png
Compressing  res\drawable\widgetbackground.PNG
Compressing  res\layout\appwidget_provider.xml
Compressing  res\layout\attachmanager.xml
Compressing  res\layout\attachpreivew.xml
Compressing  res\layout\categoryitem.xml
Compressing  res\layout\directoryitem.xml
Compressing  res\layout\directoryitem1.xml
Compressing  res\layout\entryfoot.xml
Compressing  res\layout\entryitem.xml
Compressing  res\layout\entryview.xml
Compressing  res\layout\foruminfo.xml
Compressing  res\layout\forummainview.xml
Compressing  res\layout\forummenuitem.xml
Compressing  res\layout\forum_item.xml
Compressing  res\layout\forum_radio_group.xml
Compressing  res\layout\forum_title.xml
Compressing  res\layout\fullscreenimage.xml
Compressing  res\layout\guestmainview.xml
Compressing  res\layout\imageinthread.xml
Compressing  res\layout\itemtext.xml
Compressing  res\layout\lasttopicitem.xml
Compressing  res\layout\last_topic_radio_group.xml
Compressing  res\layout\main.xml
Compressing  res\layout\menulistitem.xml
Compressing  res\layout\morefoot.xml
Compressing  res\layout\morefoot2.xml
Compressing  res\layout\moreitem.xml
Compressing  res\layout\moreview.xml
Compressing  res\layout\myinfo.xml
Compressing  res\layout\newpm.xml
Compressing  res\layout\newtopic.xml
Compressing  res\layout\next.xml
Compressing  res\layout\number_picker.xml
Compressing  res\layout\period_picker.xml
Compressing  res\layout\period_picker_dialog.xml
Compressing  res\layout\pmboxitem.xml
Compressing  res\layout\pmboxview.xml
Compressing  res\layout\pmitem.xml
Compressing  res\layout\pm_radio_group.xml
Compressing  res\layout\preference.xml
Compressing  res\layout\progress.xml
Compressing  res\layout\propularimage.xml
Compressing  res\layout\quotelayout.xml
Compressing  res\layout\searchdirectoryitem.xml
Compressing  res\layout\sectiontitle.xml
Compressing  res\layout\subscribe_topic_radio_group.xml
Compressing  res\layout\textentry.xml
Compressing  res\layout\threadfoot.xml
Compressing  res\layout\threadhead.xml
Compressing  res\layout\threaditem.xml
Compressing  res\layout\threadview.xml
Compressing  res\layout\topicfoot.xml
Compressing  res\layout\topicitem.xml
Compressing  res\layout\topicitem1.xml
Compressing  res\layout\topicview.xml
Compressing  res\layout\topic_radio_group.xml
Compressing  res\layout\userinfo.xml
Compressing  res\layout\whosonlineitem.xml
Compressing  res\layout\whosonlinetitle.xml
Compressing  res\layout\whosonlineview.xml
Compressing  res\xml\appwidget_provider.xml
Compressing  res\xml\searchable.xml

Everything is Ok
Nazwa 'java' nie jest rozpoznawana jako polecenie wewnętrzne lub zewnętrzne,
program wykonywalny lub plik wsadowy.
can't find 'place-apk-here-for-modding/repackaged-signed.apk' to install

****************************** Apk Manager *******************************

Polish message says (dunno how to translate it correctly) something like "java is not a command, exe or bat file".

edit: I also did every step again, now manually selecting "zip" and "sign" and the problem is when I'm trying to sign this apk. Then the polish message pops up. Is it my java? I don't know. I'm using for a long time and it is working well. My OS is windows 7 home premium 64 bit. I have java for 64 bit operating systems.

edit: OK I found out that somehow my java wasn't in path, so I added it, but still nothing..

another edit...: nevermind. I found the java.exe and dll manually and I was adding wrong path to... path :D. I'm going to try this one more time..

final edit: for .... sake! I made it! Gah. I'm so tired, I'm going to sleep. Good night (it's almost midnight here).
 
Last edited:

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Lol BolecDST, atleast ur persistence paid off ;)

But that brings up an important point, i will try to add a check for java/adb in the script just like farmatito did for the linux version :)
 

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
Just one more thing. Do you think it is possible to edit the arsc file which contains the language/texts? I would like to localise some apps for my own use.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Im not sure, try using option 9, which will use apktool to decompile the apk. You should be able to edit the xml's and other resources.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Attached V0.5

# Changelog for linux version:
# v 0.1 Initial version
# v 0.2 added "other" dir to PATH
# v 0.3 removed "function" bashism
# v 0.4 removed more bashisms
# v 0.5 added ogg batch optimization and quoted some vars

Enjoy.

Nice. Here is apk manager 4.3 (Windows) :
- Checks if adb/java are in ur path
- added ogg batch optimization
- fixed batch apk optimize to avoid .9.pngs
 

BolecDST

Senior Member
May 4, 2009
294
38
Dublin
Hey dude :)

Thanks for the update, but there's just one thing. Maybe it's just me, but the new version cleans the history. After making any operation "clean" menu pops up. There's no way to scroll up and see if everything went fine or there was some error. Could you check on that? Thanks.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
I mostly did that to keep it clean otherwise the menu comes to the bottom half of the screen and the top half has previous processes :)

Yea i could do that or create a log file. I think ill create a log file then, cool thnx for the tip.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Hey dude :)

Thanks for the update, but there's just one thing. Maybe it's just me, but the new version cleans the history. After making any operation "clean" menu pops up. There's no way to scroll up and see if everything went fine or there was some error. Could you check on that? Thanks.

Regardless lol, i put up a slightly updated apk manager with your request in it. Now you can toggle *output* on/off with option 17.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 219
    So i have written a simple script to ease the process of editing apks. Got a lot of downloads so thought its in demand :rolleyes:

    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 :p

    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
    18
    Hi Download link dont work is there anything you can do to upload some other website or mirrior plzzz.:confused:

    New website http://apkmultitool.com
    7
    No lol i have windows 7, java is just not in ur path.

    Right click my computer, click properties, advanced settings, environment variables, in bottom window scroll to PATH click and edit it, at the end add ;<path to ur bin folder of java>

    so mine looks like
    c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Droid Explorer\SDK\tools;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\QuickTime\QTSystem\
    4
    For people having the:


    The program sox is missing or is not in your PATH,
    please install it or fix your PATH variable

    problem on linux, here's the fix:

    open Ubuntu Software Center and search "sox" without the quotes

    install it

    problem solved. If OP wants to update, it'll help a LOT of people out ;)