APKTool to Android

337 views
Skip to first unread message

nate

unread,
Jan 27, 2011, 7:02:23 PM1/27/11
to apktool
Seems like replying to the "Running APKTool on a device" thread won't
let me post a reply. So anyway, before the project source was released
I spent 4 days decompiling and building the code by hand. There
literally was over 9,000 errors to go through. I got it, and got it to
run on my phone.

It's not perfect and I can't take it any further because basically I
fail at resource decompiling. The code that's produced is good, but
not good enough and so I need better developers to help me get this
finished. I don't want to post my source because I don't know
Brut.All's terms but not for lack of trying.

There's tons of uses for getting this working correctly including
letting me decide that a bar code scanner doesn't really need access
to my browser history and contacts. Rather than doing the edits on a
computer and reinstalling, I'm waiting on this to work so I can make
the app. I volunteer.


TL;DR, can I post my source and can I get some support by the group to
get this running on our phones?

nate

unread,
Jan 27, 2011, 7:14:04 PM1/27/11
to apktool
Just to clarify on the current status:

-- Yes, I have it running on my phone and I've got a GUI started.
-- No, it doesn't properly decompile so recompiling can't happen yet.
-- You have to backport some 1.6 features to work on Android's 1.5
which I have done.
-- You can't use the snakeyaml library but.. I got and then modified a
version that will work on Android.
-- The smali issues look to be (I'm no expert) that it's confused
about similar declarations. I'd get "1" instead of a qualified
classname, etc.
-- The resource issues look to be painful and most notable are the
ninepatch images but I kind of wedged some "just fix the error"
patches into those classes again, because I'm no expert.

So with a little help, we'll have this going.

Ryszard Wiśniewski

unread,
Jan 28, 2011, 4:39:19 AM1/28/11
to apk...@googlegroups.com
I'm surprised that you have so many problems with running apktool on a device. It's Java, you know, I thought it will be quite easy to port it.

I know it's targeted at 1.6, but I think I didn't use many features from this version of Java. AFAIR some new methods from Collections or something like that. I think it would be good to lower Java version dependency in next releases of apktool.

Apktool also uses homedir for storing frameworks, etc. I guess this is a problem (but little) if we want to run it on a device.

But I really don't know, why there are some problems with decompiling, resources, 9patches, snakeyaml?

And what about aapt? Did you compiled it for Android?

Don Page

unread,
Aug 23, 2012, 7:06:44 PM8/23/12
to apk...@googlegroups.com

@nate What ever happened to this project. This is exactly what I have been trying to do the last couple of days. Please share what you have. I am trying to write a security app that identifies malware and in order to do so need to be able to decompile specific files inside the apk file. I also made the mistake of assuming this would be easy to port since it is java. But it is a huge mess. Any help would be appreciated.

nate

unread,
Aug 23, 2012, 7:26:31 PM8/23/12
to apk...@googlegroups.com

I gave up this shortly after my last post on this thread. It was just way too daunting to go forward on my own with it. Also, the APKTool source code was released right after I spent all of that time working around that. 

The issues that I had mostly stem from the XMLPullParser library but it's been a while since I looked at it. If you want to look at what I have, I'd suggest you use the latest source and mine for reference to get it to run on a phone. In short, I took the Main class in APKTool and called it from the launcher activity I made in the Manifest file. 

I'd be willing to work with you on it but there's no way I'm going to by myself. I remember the errors well..


https://www.dropbox.com/sh/qijil28kmbqfduz/y9kp_cG1KR

Gerald Baggett

unread,
Aug 23, 2012, 9:01:43 PM8/23/12
to apk...@googlegroups.com

Ban Dan

unread,
Feb 26, 2016, 1:54:23 AM2/26/16
to apktool
Any success with that yet?

Did you give it a try using the excellent AIDE (com.aide.ui)?

HGStyle

unread,
Sep 4, 2023, 10:46:33 AM9/4/23
to apktool
Have you tried Termux ?
Just install Termux from https://termux.dev/ (not from Google Play Store, its no longer updated and broken !)
Then run the app, type `pkg update` to update the sources,
then  `pkg upgrade -y` to upgrade packages (Termux packages, not real Android packages ! Termux is like an emulator, but it only emulates programms since Linux is the kernel of Android so its allready installed by default to make Android works)
Then lets install Java by doing `pkg install openjdk-17 -y`.
Then allow access to your phone storage by runnning `termux-setup-storage` and allowing access to storage,
then `cd /storage/emulated/0` to go to the root of your phone memory, then browse like on PC your files to go to your APK,
to download Apktool run:
`wget -O /data/data/com.termux/files/usr/bin/apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.8.1.jar` then
then you can run it like on PC:
`apktool d MyAPK.apk`
Reply all
Reply to author
Forward
0 new messages