[DEV] apkTools - Optimize/Edit/Pack/Sign - EVO 4G Android Development

A simple toolkit inspired by some others, primary goal is to provide a seamless solution for reliable apk editing/optimizing.
This tool uses aapt rather than 7zip for packing. That provides much better reliability and assurance of conformance to Android file standards, as the cost of slightly larger files.
Contains:
- 7zip
- roptipng
- aapt
- apktool
- zipalign
- signapk
I've also made sure all the libraries/binaries are up to date.

Reserved Post?

Does this work on a mac? Not at home to download it.
Sent from my PC36100 using XDA App

david279 said:
Does this work on a mac? Not at home to download it.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
Windows only, sorry.
I can look and see about porting to Mac/Linux though, to my knowledge I should be able to get binaries/source for each exe used.

Cool thanks....
Sent from my PC36100 using XDA App

Appreciate the kit will thank you when I get near my laptop.
Swyped From Eva Running Myn's RLS4!

40 downloads and no feedback?
Anyways, I'd like to encourage everyone to use ddms from the android sdk to check your boot errors when optimizing.
It helps alot, any apk related errors should always be addressed even if they seemingly work flawless.

I like that you have compiled all these things together. Shouldn't there also be a draw9patch.bat also for those who have to fix the things that noobs did? It is getting better these days but there are still those out there trying to take the easy way out.

I'm also on a mac. I'll probably run it within VirtualBox

good stuff... im happy someone put together a package for everyone.
btw... which versions u using here?
i can check... but i think more people would like to know.

aamikam said:
btw... which versions u using here?
i can check... but i think more people would like to know.
Click to expand...
Click to collapse
7za - 9.20
roptipng - 0.6.3
aapt & zipalign - SDK v8
apktool - 1.3.2
signapk - NA

thanks! i'll be putting this through its paces sometime after weekend
i'll report back with any issues.

Can AndroidManifest.xml be edited with this?

epakrat75 said:
Can AndroidManifest.xml be edited with this?
Click to expand...
Click to collapse
I think so, but I'm not sure.
Optimize/Edit/Pack/Sign
Click to expand...
Click to collapse
I think Apps have to be signed in the AndroidManifest.xml...
Sent from my HTC Desire using XDA App

I like your concept. Good work. I'm only experiencing 1 issue though...
When unpacking Motonav.apk, everything seems to be unpacked, but when looking at the files, they're wrongfully created.
Instead of creating the file data.gro for instance, it creates a folder data_gro. Which therefore can't be recognized by GROConverter.
Am I doing something wrong?

epakrat75 said:
Can AndroidManifest.xml be edited with this?
Click to expand...
Click to collapse
its using apktool so if its set to decompile then you would edit the decompiled manifest with something like notebook ++

this would be greeeeaaaat for a mac.

Awesome tool... Would love for this to be able to handle draw9patch! Might there be an update to include that?

For some weird reason im getting errors. saying java isnt a command

This is great, thanks....

Related

[UTIL][08.12.11] Apktool v1.4.3 - a tool for reverse engineering apk files

Brut.all said:
It is a tool for reengineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc.
It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like.
Features:
decoding resources to nearly original form
smali debugging: SmaliDebugging
helping with some repetitive tasks
Click to expand...
Click to collapse
http://code.google.com/p/android-apktool/
Brut.all said:
http://code.google.com/p/android-apktool/
Click to expand...
Click to collapse
Oh this may well be excellent. I've got a 3rd-party Market app which desperately needs sensor orientation disabled (good ol' FC on rotate). Will check it out!
Brut.all said:
http://code.google.com/p/android-apktool/
Click to expand...
Click to collapse
heh! cool man ... will look into this one! TY
~enom~
this.. could.. be.. godly..
I don't have time to try this right now, but I'm PUMPED.
Ok, now I see, that it still doesn't work for many apps. But you can try your luck ;-)
I've just released 0.9.1 version with wider apps support.
Subscribed! Thanks Brut.All! Will play around with this one
Brut.all said:
http://code.google.com/p/android-apktool/
Click to expand...
Click to collapse
Vaooo!!! Megathanx!
Use it first and then thank. Still I don't have any confirmation from anyone that it works :-/
Brut.all said:
Use it first and then thank. Still I don't have any confirmation from anyone that it works :-/
Click to expand...
Click to collapse
working for me under ubuntu karmic, great work as ever Brut.all
Had the chance to set this up and make my edit. Absolutely painless. Great work. Thanks!
Android 1.5 can also work?
itanczos said:
Android 1.5 can also work?
Click to expand...
Click to collapse
Why not? It just builds apps, not run them, so it's a question like: "Do smali can also work with Android 1.5?" ;-)
That "Android SDK installed with 2.1 platform" requirement doesn't mean, that it will build apps for 2.1 . It will just use 2.1 resources, but these are (must be) backward compatible.
Brut.all said:
Why not? It just builds apps, not run them, so it's a question like: "Do smali can also work with Android 1.5?" ;-)
That "Android SDK installed with 2.1 platform" requirement doesn't mean, that it will build apps for 2.1 . It will just use 2.1 resources, but these are (must be) backward compatible.
Click to expand...
Click to collapse
Okay, I'll try!
Another question: The framwork-res.apk could not be decrypted. It will be possible later on?
itanczos said:
Another question: The framwork-res.apk could not be decrypted. It will be possible later on?
Click to expand...
Click to collapse
Maybe much later :-/
Even if we will be able to decode it and rebuild, we'll have FC after FC. The point is: framework resources must have constant resName<->resID mappings (eg. @android:string/day must be a 0x01040298), because they are referenced by all apps and unfortunately aapt doesn't give us control over resIDs mappings. I think framework-res.apk and other system files are built using some Google's private tools.
We need to create aapt-like tool, that will use custom resIDs mappings - it should be possible and maybe not so hard, but currently I have other things to do.
want a windows version >.<
lolmensch said:
want a windows version >.<
Click to expand...
Click to collapse
I must buy one ;-)
For now you need VirtualBox (free) + Ubuntu (free) + ~5GB of space (nearly free) and you will be able to use it
could this be used to modify this skype .apk to allow use on other carriers?
http://forum.xda-developers.com/showthread.php?t=585211&highlight=skype
ekeefe41 said:
could this be used to modify this skype .apk to allow use on other carriers?
http://forum.xda-developers.com/showthread.php?t=585211&highlight=skype
Click to expand...
Click to collapse
I don't know, what are these "iskoot", "3 network" and other things - I don't use Skype. But if you need to change something in XML files, then you definitely want to try out apktool

(Tools) Avabox

So this is the Avabox. original title i know
I put this to together back with the hero during some hard forums times in order to push further development with customizations. and it worked.
so here it is for the Evo devs. I set it up for windows but of course perl scripts run in linux so its universal. But if you want to learn/work on some customizations for the evo but you dont wanna dual boot linux or w/e here is something for you.
im hoping to see some good things soon any issues with this just comment or pm. good luck.
Avabox Download
What is it?
Avalaunchmods said:
So this is the Avabox. original title i know
I put this to together back with the hero during some hard forums times in order to push further development with customizations. and it worked.
so here it is for the Evo devs. I set it up for windows but of course perl scripts run in linux so its universal. But if you want to learn/work on some customizations for the evo but you dont wanna dual boot linux or w/e here is something for you.
im hoping to see some good things soon any issues with this just comment or pm. good luck.
Avabox Download
Click to expand...
Click to collapse
You are really doing us a favor. The Avabox's in the Hero forum were a life saver(but I lost the links to them).
Putting this in my Resources Guide. A must-have toolbox.
Decad3nce said:
You are really doing us a favor. The Avabox's in the Hero forum were a life saver(but I lost the links to them).
Putting this in my Resources Guide. A must-have toolbox.
Click to expand...
Click to collapse
good to hear. im staying busy so its hard to work on the evo. im honestly happy stock haha. but anyways yes lets keep this alive and get everyone in on some evo love
mrono said:
What is it?
Click to expand...
Click to collapse
its a compilation of scripts for windows to cook a rom and create/modify/extract/compile/unzip/deodex/sign/everything android 1.5 and up.
works with linux too.
Good timing. I'm here trying to remove yxplayer's trial / 2min time limit. Managed to decompile, edited smali files, recompile, sign. So far so good, worked as expected (re-mapping various functions to different buttons). Now gotta hunt down the code which actually triggers that 2min play limit, and with some luck, maybe the whole validate-the-serial-number routine
PS: was using only APKTool & Auto-Sign. Will check out the tools in Avabox and see if they will be useful.
This includes the installer for 64-bit ActivePerl. Here's the link for the 32-bit installer in case anyone needs it: http://downloads.activestate.com/Ac...ActivePerl-5.10.1.1007-MSWin32-x86-291969.msi
bump for life.
maybe a bump maybe not this is awesome is this the latest version? Oh stupid question? Someones gonna ask. this is great for unpacking boot.img signing zips everything to make your own rom. Wow even has a deodexer
This package is literally everything you need to make your own custom rom. So use it.
Thank you so much
I tried doing a search to see if anyone had the problem I am currently having, but I could not find anything (on the hero forums as well). So, I thought I would ask the community.
I am trying to deodex an apk. The program says that it deodexed it, but there is no classes.dex file in the apk. I am getting an error running it though. Here is the error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: java.lang.RuntimeException: error while dumping fiel
ds
at org.jf.dexlib.Util.Deodexerant.sendMultilineComman d(Deodexerant.java:
241)
at org.jf.dexlib.Util.Deodexerant.access$200(Deodexer ant.java:44)
at org.jf.dexlib.Util.Deodexerant$ClassData.loadField s(Deodexerant.java:
521)
at org.jf.dexlib.Util.Deodexerant$ClassData.lookupFie ld(Deodexerant.java
:473)
at org.jf.dexlib.Util.Deodexerant.lookupField(Deodexe rant.java:142)
at org.jf.dexlib.Util.DeodexUtil.deodexInstruction(De odexUtil.java:566)
at org.jf.dexlib.Util.DeodexUtil.deodexerizeCode(Deod exUtil.java:205)
at org.jf.baksmali.Adaptors.MethodDefinition$MethodIt emList.generateMeth
odItemList(MethodDefinition.java:183)
at org.jf.baksmali.Adaptors.MethodDefinition.getMetho dItems(MethodDefini
tion.java:144)
at org.jf.baksmali.Adaptors.MethodDefinition.makeTemp late(MethodDefiniti
on.java:61)
at org.jf.baksmali.Adaptors.ClassDefinition.getDirect Methods(ClassDefini
tion.java:272)
at org.jf.baksmali.Adaptors.ClassDefinition.makeTempl ate(ClassDefinition
.java:74)
at org.jf.baksmali.baksmali.disassembleDexFile(baksma li.java:112)
at org.jf.baksmali.main.main(main.java:183)
Caused by: java.lang.RuntimeException: error while dumping fields
at org.jf.dexlib.Util.Deodexerant.sendMultilineComman d(Deodexerant.java:
232)
... 13 more
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.jf.dexlib.DexFile$2.placeAt(DexFile.java:733)
at org.jf.dexlib.DexFile.place(DexFile.java:608)
at org.jf.smali.main.main(main.java:177)
Any clues? Thanks in advance for any response and help you might be able to offer.
Could a complete nub download this and make a ROM? I've been interested in getting into development, but I have no clue where to start. I catch onto things quickly, and I'm willing to learn. I just don't know where to begin.
athanos said:
I tried doing a search to see if anyone had the problem I am currently having, but I could not find anything (on the hero forums as well). So, I thought I would ask the community.
I am trying to deodex an apk. The program says that it deodexed it, but there is no classes.dex file in the apk. I am getting an error running it though. Here is the error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: java.lang.RuntimeException: error while dumping fiel
ds
at org.jf.dexlib.Util.Deodexerant.sendMultilineComman d(Deodexerant.java:
241)
at org.jf.dexlib.Util.Deodexerant.access$200(Deodexer ant.java:44)
at org.jf.dexlib.Util.Deodexerant$ClassData.loadField s(Deodexerant.java:
521)
at org.jf.dexlib.Util.Deodexerant$ClassData.lookupFie ld(Deodexerant.java
:473)
at org.jf.dexlib.Util.Deodexerant.lookupField(Deodexe rant.java:142)
at org.jf.dexlib.Util.DeodexUtil.deodexInstruction(De odexUtil.java:566)
at org.jf.dexlib.Util.DeodexUtil.deodexerizeCode(Deod exUtil.java:205)
at org.jf.baksmali.Adaptors.MethodDefinition$MethodIt emList.generateMeth
odItemList(MethodDefinition.java:183)
at org.jf.baksmali.Adaptors.MethodDefinition.getMetho dItems(MethodDefini
tion.java:144)
at org.jf.baksmali.Adaptors.MethodDefinition.makeTemp late(MethodDefiniti
on.java:61)
at org.jf.baksmali.Adaptors.ClassDefinition.getDirect Methods(ClassDefini
tion.java:272)
at org.jf.baksmali.Adaptors.ClassDefinition.makeTempl ate(ClassDefinition
.java:74)
at org.jf.baksmali.baksmali.disassembleDexFile(baksma li.java:112)
at org.jf.baksmali.main.main(main.java:183)
Caused by: java.lang.RuntimeException: error while dumping fields
at org.jf.dexlib.Util.Deodexerant.sendMultilineComman d(Deodexerant.java:
232)
... 13 more
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.jf.dexlib.DexFile$2.placeAt(DexFile.java:733)
at org.jf.dexlib.DexFile.place(DexFile.java:608)
at org.jf.smali.main.main(main.java:177)
Any clues? Thanks in advance for any response and help you might be able to offer.
Click to expand...
Click to collapse
What apk are you trying to deodex? Are you using the right BOOTCLASSPATH?
tjohnsonjr said:
What apk are you trying to deodex? Are you using the right BOOTCLASSPATH?
Click to expand...
Click to collapse
I'm a noob, so please forgive me. I am not sure about the BOOTCLASSPATH. I am trying to deodex htcmailwidgets.apk. I know there are already deodexed ones out there, but I wanted to deodex the one from the legend (it has a couple of options for the widget which are not able to be done with the standard mail widget) to use on my hero without changing to the Legend ROM. Hope that makes sense.
athanos said:
I'm a noob, so please forgive me. I am not sure about the BOOTCLASSPATH. I am trying to deodex htcmailwidgets.apk. I know there are already deodexed ones out there, but I wanted to deodex the one from the legend (it has a couple of options for the widget which are not able to be done with the standard mail widget) to use on my hero without changing to the Legend ROM. Hope that makes sense.
Click to expand...
Click to collapse
Sense bootclasspath is: core.jar:ext.jar:framework.jar:android.policy.jar:services.jar:com.htc.framework.jar:com.htc.android.pimlib.jar:com.htc.android.easopen.jar:com.scalado.util.ScaladoUtil.jar
I haven't used Avabox yet. I hope this helps until I can play around with this tonight.
athanos said:
Any clues? Thanks in advance for any response and help you might be able to offer.
Click to expand...
Click to collapse
That is a fairly old version of smali/baksmali. You really should either use smali/baksmali directly, or at least find a tool/script that has/uses an up to date version
JesusFreke said:
That is a fairly old version of smali/baksmali. You really should either use smali/baksmali directly, or at least find a tool/script that has/uses an up to date version
Click to expand...
Click to collapse
THE JesusFreke!!!?! Good reading ya,the original Android dev, much respect.
Sent telepathically via my Evo.
-_-
May not ever use this personally, but thanks for this.
Sent from my PC36100 using XDA App
I may have completely misread the OP, and forgive me if I did, but aren't there supposed to perl scripts in the package that would allow me to use this in Linux? I am not seeing anything but .exe and .bat files. I dont use Windows, and wouldnt trust wine to do development work. Is there another version of this floating around I can use?
Edit: I found the code repository http://code.google.com/p/smali/
Edit2: NM. I finally opened my eyes and found the perl scripts in Boot Scripts. The above code repo is the updated version of Smali.
Looking to unpack the data.img files that are created when you do a backup of your phone. Not seeing that this will work - do you have ideas on how?

Fission Themes 2.5.6

can someone port these 2 themes over for fission 2.5.6?
http://androidforums.com/droid-x-all-things-root/248349-avalon-fission-2-4-x.html
http://androidforums.com/droid-x-all-things-root/248890-matted-blues-fission-2-4-x-dx.html
or if anything, tell me how i can do it? I'm a graphic designer so if i had the actual art files it wouldn't be too difficult. i just dunno how to access the art files and then re-save them to use for a theme
Search xda for theme-porter. It will help do exactly what you are looking to do. It pulls the .png files from framework and apps and ports them to your current framework and appa
Sent from my DROIDX using XDA App
SysAdmin-X said:
Search xda for theme-porter. It will help do exactly what you are looking to do. It pulls the .png files from framework and apps and ports them to your current framework and appa
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
brilliant thank you!
Any luck in making this happen? I want that avalon theme BAD. I will gladly flash back to fission for that...
Sent from my DROIDX using XDA App
btucker2003 said:
Any luck in making this happen? I want that avalon theme BAD. I will gladly flash back to fission for that...
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
If you guys really want this, feel free to attach your framework-res.apk. I can port this over tonight if I get the time
Sent from my DROIDX using XDA App
SysAdmin-X said:
If you guys really want this, feel free to attach your framework-res.apk. I can port this over tonight if I get the time
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
here ya go, im gonna have a crack at this too
http://www.mediafire.com/file/mmmogqb8fnord0m/framework-res.apk
alright i think i ported them over correctly. I used the port script program and then put them into update.zip files using the updater script program
I'm currently backing up my phone and then i'll test them out
If they work fine I'll upload them both
yeh i must have missed something, the update zips I created don't install. They get to "installing update" in recovery and just hang there....nothing actually happens
I'll upload the zip files if anyone wants to try and mess with them
http://www.mediafire.com/file/tnp58lq8fhkv36y/avalon 2.5.6.zip
http://www.mediafire.com/file/w18eq63xq8edxqk/matteblue 2.5.6.zip
davidukfl said:
here ya go, im gonna have a crack at this too
http://www.mediafire.com/file/mmmogqb8fnord0m/framework-res.apk
Click to expand...
Click to collapse
Sorry it didnt work out for you. I always just took the .apk files and pushed them to my phone after running the script. Im still away from my computer but will try as soon as I can
Sent from my DROIDX using XDA App
@Davidukfl
here is your framework man! Make sure that you rename the files to just framework-res.apk. I just renamed them for your convenience!
Take the following steps to put it back on your phone:
USUAL DISCLAIMER: I'm not responsible if you brick your phone...blah blah blah
Connect your phone to your pc in charge only usb mode. Make sure the phone is recognized by your computer. Place the .apk file in the location of your choice.
Command prompt 1:
1) type adb devices (make sure your phone shows up)
2) type adb shell
3) type adb remount
4) type adb push <location of framework-res.apk> /system/framework/framework-res.apk
5) type adb remount
Your phone should reboot, and then be good to go.
I dont use fission, and haven't tested this, but it has worked for me when I have ported ROM's.
Enjoy!
alright thanks, works great.
What i did was remove the old framwork from the original theme file, re-zipped it and then applied the theme like normal.
then I followed your instructions and applied the framework seperately
Has anyone had luck making this a flashable zip for the Avalon theme yet?
Or... maybe we can get Avalon for Apex as well?!
btucker2003 said:
Has anyone had luck making this a flashable zip for the Avalon theme yet?
Click to expand...
Click to collapse
im working on it.
i sort of had it working. The zip file installed everything but the framework
davidukfl said:
im working on it.
i sort of had it working. The zip file installed everything but the framework
Click to expand...
Click to collapse
You be da man! Let me know and if you dont mind posting a linky to zippy if you get it going? Please and thank you!
yeh im not getting it. Think i may just wait till someone else can port over these entire themes. I thought i had it
i was able to just delete framework from the zip files and install just the themed apps, but when trying to push the framework i'm running into issues. Command keeps telling me adb push not found and adb remount not found
davidukfl said:
yeh im not getting it. Think i may just wait till someone else can port over these entire themes. I thought i had it
i was able to just delete framework from the zip files and install just the themed apps, but when trying to push the framework i'm running into issues. Command keeps telling me adb push not found and adb remount not found
Click to expand...
Click to collapse
Well ive been on the lookout for Avalon for awhile so if I come across anything I'll post it for you, and do the same please. Damn I want this theme!
btucker2003 said:
Well ive been on the lookout for Avalon for awhile so if I come across anything I'll post it for you, and do the same please. Damn I want this theme!
Click to expand...
Click to collapse
someone over on androidforums ported it for 2.4.X however i don't think he has time to update it for the newest version.
the framework posted earlier is cool, but it's not the entire theme, plus im having troubles pushing it to my device.
An actual update.zip would be brilliant for us "less technical" folk
davidukfl said:
someone over on androidforums ported it for 2.4.X however i don't think he has time to update it for the newest version.
the framework posted earlier is cool, but it's not the entire theme, plus im having troubles pushing it to my device.
An actual update.zip would be brilliant for us "less technical" folk
Click to expand...
Click to collapse
No crap! Agreed...
so i take it we are still looking for someone to port matted blues to fission 2.5.7? Hopefully somebody does this soon, im not going to update until this theme is ready

[Q] Advanced reboot for Sense 5 4.2.2

hi
so one of the features I would like to add to a stock deodex 4.2.2 ROM is the advanced reboot feature. I want to do this nativly but I dont know how. can someone point me in the right direction.
thankyou
phonegeekjr said:
hi
so one of the features I would like to add to a stock deodex 4.2.2 ROM is the advanced reboot feature. I want to do this nativly but I dont know how. can someone point me in the right direction.
thankyou
Click to expand...
Click to collapse
use SENSE 5 toolbox in development thread http://forum.xda-developers.com/showthread.php?p=46837064
Or else VIPER XL it pretty much has all the options one can need!
Have tried that and it doesn't seam to work. I am building and testing the Rom and this is a feature I want to include. I use viper when I'm not testing and love it. What do I have to edit to have this feature in my rom
Sent from my HTCONE using xda app-developers app
phonegeekjr said:
Have tried that and it doesn't seam to work. I am building and testing the Rom and this is a feature I want to include. I use viper when I'm not testing and love it. What do I have to edit to have this feature in my rom
Sent from my HTCONE using xda app-developers app
Click to expand...
Click to collapse
Most of the guides that I have found are for non HTC phones. I have a few links for you to check out. From what I have read, they are mostly framework-res.apk and android.policy.jar edits.
I have extracted the classes.dex out of the jar and tried to wade my way through all of the .smali files. It looks as if the GlobalActions.smali points to either GlobalActions3 or GlobalActions4.smali for reboot options.
The guides also point to certain edits which need to be made to the framework-res.apk. Mainly strings.xml. They say to then recompile, then decompile the new framework-res.apk and lookup certain hex values in public.xml.I thought I had it figured out, but then I saw that some of the hex codes were 4xxxxxx hex codes, which points to framework-HTC-res.apk. That's kindof where I got stuck because I could not get that apk to successfully decompile.
Looking at the GlobalActions.smali I saw references to com.HTC.resources, so I kinda knew this was to be expected. I seem to be having trouble getting the necessary framework installed through apktool to successfully decompile.
Additionally, I have taken apart quite a few Roms frameworks (Roms that aren't using Sense 5 toolbox or exposed mods) to try to decipher how they applied the necessary changes, yet they are all so different. Some look to have used arrays, others strings. I know the arrays are probably for multilingual options.
Links coming as soon as I get to my pc.
Click button below for links:
http://forum.xda-developers.com/showthread.php?t=1169443
http://forum.xda-developers.com/showthread.php?t=811532
https://docs.google.com/document/d/11a7ghZpdTcZbeDtneTnEHkHLn5_XQ9k2FDFFh-os-q0/edit
http://forum.xda-developers.com/showthread.php?t=776495
When reading the hex values in the files, the chart below should point you in the right direction:
0x10xxxx is in framework-res.apk
0x20xxxx is in com.htc.resources.apk
0x40xxxx is in framework-htc-res.apk
I too am trying to learn how to do all of this. Please let me know if you figure anything out. It seems to be who you know around here that directly reflects what you know.
Thanks. Do u know of a apk to tool to fix these apps with
Sent from my HTCONE using xda app-developers app
phonegeekjr said:
Thanks. Do u know of a apk to tool to fix these apps with
Sent from my HTCONE using xda app-developers app
Click to expand...
Click to collapse
Not quite sure what you meant here. An .apk to do what exactly?
Also, if I've helped and you want to show appreciate for my comment, just hit the thanks button, instead of thanking me in your posts. I believe that is the recommended way of doing things around here. Check the forum rules for clarification.
http://forum.xda-developers.com/showthread.php?p=30899605
Sent from my HTC One XL using XDA Premium 4 mobile app
Black!Jack said:
Not quite sure what you meant here. An .apk to do what exactly?
Also, if I've helped and you want to show appreciate for my comment, just hit the thanks button, instead of thanking me in your posts. I believe that is the recommended way of doing things around here. Check the forum rules for clarification.
http://forum.xda-developers.com/showthread.php?p=30899605
Sent from my HTC One XL using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I need a tool to decompile and recompile apk
Sent from my HTCONE using xda app-developers app
Zarchiver
Sent from my Evita
timmaaa said:
Zarchiver
Sent from my Evita
Click to expand...
Click to collapse
what about for a linux computer are there any tools I can use with that.
Not sure about on Linux, you should be able to find something via Google. There should also be guides on XDA.
Sent from my Evita
phonegeekjr said:
I need a tool to decompile and recompile apk
Sent from my HTCONE using xda app-developers app
Click to expand...
Click to collapse
Apktool... ApkMultiTool (really just a UI to take command line work out of the equation-not really my style though), Virtuous10 Studios, many more I'm sure I forgot. I have some .bat files for executing necessary commands if your not sure how to use command line.
Sent from my HTC One XL using XDA Premium 4 mobile app
---------- Post added at 05:32 PM ---------- Previous post was at 04:32 PM ----------
timmaaa said:
Zarchiver
Sent from my Evita
Click to expand...
Click to collapse
Not sure that Zarchiver is a tool for Decompiling and Recompiling .apks.
From what I have read about it, it looks more like a File Manager/Archiver.
@ PhoneGeek... for Linux I would have to say that apktool is going to be your best bet. You can find the XDA thread here. And the main page for apktool is here.
Black!Jack said:
Most of the guides that I have found are for non HTC phones. I have a few links for you to check out. From what I have read, they are mostly framework-res.apk and android.policy.jar edits.
I have extracted the classes.dex out of the jar and tried to wade my way through all of the .smali files. It looks as if the GlobalActions.smali points to either GlobalActions3 or GlobalActions4.smali for reboot options.
The guides also point to certain edits which need to be made to the framework-res.apk. Mainly strings.xml. They say to then recompile, then decompile the new framework-res.apk and lookup certain hex values in public.xml.I thought I had it figured out, but then I saw that some of the hex codes were 4xxxxxx hex codes, which points to framework-HTC-res.apk. That's kindof where I got stuck because I could not get that apk to successfully decompile.
Looking at the GlobalActions.smali I saw references to com.HTC.resources, so I kinda knew this was to be expected. I seem to be having trouble getting the necessary framework installed through apktool to successfully decompile.
Additionally, I have taken apart quite a few Roms frameworks (Roms that aren't using Sense 5 toolbox or exposed mods) to try to decipher how they applied the necessary changes, yet they are all so different. Some look to have used arrays, others strings. I know the arrays are probably for multilingual options.
Links coming as soon as I get to my pc.
Click button below for links:
http://forum.xda-developers.com/showthread.php?t=1169443
http://forum.xda-developers.com/showthread.php?t=811532
https://docs.google.com/document/d/11a7ghZpdTcZbeDtneTnEHkHLn5_XQ9k2FDFFh-os-q0/edit
http://forum.xda-developers.com/showthread.php?t=776495
When reading the hex values in the files, the chart below should point you in the right direction:
0x10xxxx is in framework-res.apk
0x20xxxx is in com.htc.resources.apk
0x40xxxx is in framework-htc-res.apk
I too am trying to learn how to do all of this. Please let me know if you figure anything out. It seems to be who you know around here that directly reflects what you know.
Click to expand...
Click to collapse
first link is for samsung. last link is for mod for a sense 4 or sense 4+ rom. the samsung link, is it ok to folow the steps in it. and the mod isnt even for the at&t htc one xl sense 5. will it work
phonegeekjr said:
first link is for samsung. last link is for mod for a sense 4 or sense 4+ rom. the samsung link, is it ok to folow the steps in it. and the mod isnt even for the at&t htc one xl sense 5. will it work
Click to expand...
Click to collapse
That is what I was originally trying to let you know. The one for the HTC MOD is device specific (HTC Desire I believe). I have gone through the .smali files as these guides instructed and noticed a wide variety of variance. If you decide to attempt the instructions per those guides, you do so at your own risk; especially if you have no idea what you are really doing. The Devs around here are labeled that for a reason. Chances are... they really know what they are doing when messing around with files that could deem our phones inoperable.
One bit of advice I will give you before you start messing with the .smali files, is to learn Java, if you don't already, and then head over to the Smali page and read through all of the documentation in their wiki (it will be hard to understand if you don't know Java though). After taking the time to learn these things, when you open up the .smali files you will have a better understanding of what you are actually looking at and how things are structured. For example, when you open one up, you will perhaps see some variance of :
invoke-direct {v0, v1, p0, v2}
Well, what do all of these v's and p's mean - what do they point to?
There are two naming schemes for registers - the normal v naming scheme and the p naming scheme for parameter registers. Confused?
Read the wiki! Confused by the wiki? Learn Java! This is really the best advice that I can give you. By no means am I downing you or questioning your intelligence. I am simply trying to help you by pointing you in the right direction. Spoon-feeding you all of the answers isn't going to help you learn. I am by no means an expert; not even dillusional enough to think that I am- though my wife may disagree!
In addition, when you get to the Smali page, on the Project home tab, there is a link for an IRC chat room and an example of how the entry level "Hello World" app is broken down into .smali.
Hope that I have helped, to at least point you in the right direction. If I have click the Thanks button!
Edit: Here are some links that may be useful in your quest for knowledge of this subject matter:
Modifying .smali files
Convert .smali to .java
Dalvik opcodes
Android opcodes
Bytecode for the Dalvik VM
Another place with useful links
All of these resources were found with the help of my good friend Google, and her red-headed stepchild XDA!
Hi. I have tried yet again to make sense 5 toolbox apm work. Still not. Latest version of framework used. Any ideas
edit: foumd the problem and apm is now working.
Sent from my HTC One XL using xda app-developers app

[toolkit][tutorial][linux]apk munky-rench

APK MUNKY-RENCH
FOR LINUX​\
A minimal dependency toolkit​
WINDOWS IS TERRIBLE
Everybody knows it. Linux is a better platform for developers. No matter how much you themers hate it, it's true. You can't compile android from source in Adobe Photoshop. Linux Distros are built with developers in mind.
Well, what about those of us that aren't developers yet? Linux is hard, right?
Right!
Linux CAN be hard coming from Windows, where everything is all pretty and you just click away on your GUI. Setting up a build environment on Mint was a huge pain when I first made the switch. No install wizard, no tech support, no hope. While Linux can be very powerful, simple tasks like decompiling apps can be a killer. Gotta love that terminal.
Well, Apk munky-rench is here to help fix all that. As I was learning all these steps, I remember wishing that all the kits were a little more educational and the tutorials were a little more functional. So instead of just fighting my way through the learning process and leaving the rest of you to suffer, I have decided to build something that is part tool, part tutorial. Now you can enjoy a little functionality without having to fight with dependencies, and hopefully learn something along the way.
APK MUNKY-RENCH
SUPPORTS SAMSUNG DEVICES THROUGH ONBOARD HEIMDALL!!!
FEATURES​At initial release, apk munky-rench features the following:
Unzip Apk
Zip APK
Install Frameworks
Decompile Apk
Compile Apk
Sign Apk
Zipalign Apk
Compile System Apk
ADB Install
ADB Push/Pull
Fastboot Flash Recovery
Heimdall Flash Recovery
Flashable Zip Generator
Lollipop Compatibility
Brief Explanations of Features
Version 1.1 fixed broken menu option and updated to apktool 2.0 RC4
As time goes on, I will be adding more features and more tutorial functionality. Munky-rench is dependent only upon a proper installation of JAVA. All other tools are onboard.
INSTRUCTIONS
Download v1.1 from MEGA and extract, or visit my git to download a zip or clone (recommended, as I plan to add quite a bit of functionality). Run the munky-rench script. It should all be pretty straightforward from there. but post any questions here, and I will be happy to help. Also, feel free to suggest features or submit pull requests.
If you need a windows kit, markbencze has an updated one here.
​
CREDIT
Brut.all for apktool
The lovely folks over at signapk.jar
The zipalign team
Glass Echidna for Heimdall
markbencze for motivation
and absolutely anyone else who would like some credit.
The script is mine, the tools are not.
Remember to thank all the devs
And Google.
Heck, send Sergey a letter with your regards.​
mine
and why not take one more?
This is awesome buddy. Great job on it. You've worked very hard on this!
Top well!!!
markbencze said:
This is awesome buddy. Great job on it. You've worked very hard on this!
Top well!!!
Click to expand...
Click to collapse
Thanks man. I hope to turn it into something pretty cool.
Can I use this on my note 2? Or does it have to be executed on PC? I have an apk that I want to try and resign. I'm a total noon when it comes to all this compile, decompile, sign apk and all. Thanks
DCOCH13 said:
Can I use this on my note 2? Or does it have to be executed on PC? I have an apk that I want to try and resign. I'm a total noon when it comes to all this compile, decompile, sign apk and all. Thanks
Click to expand...
Click to collapse
Has to be run on linux PC. It is a bash script with included apktool, signapk, and zipalign. If they ever release an apktool that works natively on android, I will build a similar .sh script, but for now, as far as I know, PC is the only way to compile apks
Now supporting ADB Push/Pull, Fastboot Flash Recovery, Heimdall Flash Recovery, and a Flashable zip generator that generates a flashable zip to test system apps AND another zip to flash the original apps back if you bootloop -- and gives you the option to push them to your sd. I will be expanding the fastboot and heimdall features eventually, and adding some kitchen features if I find the time, as well as making it more functional as a tutorial for noobs.
Excellent
anttaz said:
Excellent
Click to expand...
Click to collapse
Thanks. If you have any feedback, let me know. I'm gonna try to make it a useful as I can.
Will be testing lots believe me. And yes Will
Much top kit for decompile of apps in linux machine! Everything works out of the box much well, with no install of extra software! Much thanks for well tool.:thumbup:
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Rahul³™ said:
Much top kit for decompile of apps in linux machine! Everything works out of the box much well, with no install of extra software! Much thanks for well tool.:thumbup:
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Click to expand...
Click to collapse
Thanks, I just wanted to automate some of the features that we need all the time for themes and mods, and I remember how much of a pain initial setup of environment can be with linux, so I wanted to eliminate alot of those dependencies and extra steps. With this kit, you just put it in your file system (I keep mine in my ~/android folder), and it works. No adding anythint to path or weird errors.
apktool for Android does Exist !!!
mike the inkman said:
Has to be run on linux PC. It is a bash script with included apktool, signapk, and zipalign. If they ever release an apktool that works natively on android, I will build a similar .sh script, but for now, as far as I know, PC is the only way to compile apks
Click to expand...
Click to collapse
APKTool.apk for ANDROID does Exist for years my friend
Wolf Tatoo said:
APKTool.apk for ANDROID does Exist for years my friend
Click to expand...
Click to collapse
I know apktool for exists. I have decompiled with it, but I have never been able to recompile successfully. If you recompile successfully, shoot me a pm. I would for sure appreciate knowing what I was doing wrong.
Yes, native apktool has exist for years, also not update for years. It top idea for mek, but it take 10 minutes to compile just so can see many errors. Decompile with pc much weller, and top fast!
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Rahul³™ said:
Yes, native apktool has exist for years, also not update for years. It top idea for mek, but it take 10 minutes to compile just so can see many errors. Decompile with pc much weller, and top fast!
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Click to expand...
Click to collapse
Yeah. It would be nice if I could get it to work. It would be convenient for minor smali and xml stuff.
Yes, but good for at least to have a top well kit for easy apk modding in linux OS. Much thanks for share with Xda community!
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Rahul³™ said:
Yes, but good for at least to have a top well kit for easy apk modding in linux OS. Much thanks for share with Xda community!
Sent from Marican Bacon Cannogen fone running initial build of TurbanCMRom
Click to expand...
Click to collapse
Thanks man. I figure if I make something useful for myself, it isn't going to hurt me to add a couple more features I normally wouldn't use and share with the community. I have gotten a lot of help from these forums since my first android device, and it's just cool to give something back.
Great tool! There are so many for Windows and I had been searching a good Linux alternative for ages.
Just one query. Am I doing something wrong or 99 doesn't exit? It shows me the options for 11 instead
Keep up the good work

Categories

Resources