yashsingh1/xdaforums huggingface dataset:
[Android Software Development] broodplank1337:
Haha, you're welcome! I hope you enjoy it :D

You're welcome ^^. And I might get Recognized Developer later, the moment when I received the Recognized Contributor title, the Recognized Developer title was closed for a few months (and still is). So maybe after that time I can get an upgrade :D
[Android Software Development] broodplank1337:
Updated to v0.6 BETA

changes:

1 2 3
[Android Software Development] YMYA:
I am happy you purchased i9001 ;)
[Android Software Development] broodplank1337:
Hehe, that's just typical me... every device (no matter if it's a smartphone or not) I want to optimize/tweak by default (when I've learned how to do this I always write a tut about it) also I like making little helpfull tools, so when you combine that you get this ;) My goal is to get this uber extended portfolio before I start working in a company, I think that way I can show my skills. (employees won't find AutoIT very special, but it's a start I guess)
[Android Software Development] EternalFame:
they won't find it usefull since it's just for automatic scripts!

and the syntax is different from important languages (:

i advise you to learn C and then C++ (there you have wxwidgets where you can do the same Windows GUI programms (:
[Android Software Development] broodplank1337:
My C/C++ is very bad, I'm learning Java now though. Developing Apps (aka java) is very popular at the moment. but I think C/C++ is nicer.
[Android Software Development] EternalFame:
java is also a good idea (:

i would also like to learn java and do some simple app coding for android (:

but im too busy with school :P

and right now i have to learn assambler for school xD the syntax is horrible O:

B2T:

your program could be very useful!
[Android Software Development] broodplank1337:
lol assembly? Horrible language, but very close to 0 and 1 ;p

If you know assembly you can hack/crack anything
[Android Software Development] broodplank1337:
NOTE: CRITICAL FIX TO PREVENT HANG!: https://github.com/broodplank/APKtoJava/commit/45dcbd5a956416883ee9c0e7a06300073ed4f1ca PLEASE APPLY!

It will be included in v0.7 beta
[Android Software Development] hypnos17:
U are a genius brood...awesome, as always

Inviato dal mio GT-I9001 con Tapatalk 2
[Android Software Development] broodplank1337:
Thanks ^^

btw, new version released! the option to convert to an Eclipse project is now available (still beta though)

See changes here
[Android Software Development] mrjraider:
Nice work brood :D

Edit: Your next step is to make an option to compile the files again :)
[Android Software Development] broodplank1337:
Idd. But first i want a perfect automated process. Its currently not 100% automated so it still needs improvement ;)

Edit: Damnit build 7 also needed a critical fix.. guess build 8 will do the trick? I hope so lol..

Check the fix @ github
[Android Software Development] broodplank1337:
V0.8 released!

Changes: 1 2 3

It's becoming much more stable luckily :)
[Android Software Development] broodplank1337:
v0.9 released

Changes: 1 2 3
[Android Software Development] zaclimon:
Does it have linux support? If not I can always try VM.
[Android Software Development] Senzune:
Can the Java code be run in an application, browser perhaps? As in, running the app on your computer?
[Android Software Development] WolfKaBaL:
Not to take anything away from the work you've done. But just so other's aren't confused, this is just an automated script/GUI for existing tools. It simply runs dex2jar, apktool, baksmali, etc.. I came into this hoping it was maybe a different decompiler, a better one that might do a better job of de-obfuscating the code. But seeing that it's just an automater/GUI takes away from that.

Great job on the automater though, and keep up the work towards your education. We all have to start somewhere. :good:
[Android Software Development] trter10:
This looks amazing!

I'm having an error though,

Thanks!
[Android Software Development] sUsH667:
first: thx for your great effort and work!

one question though: so this does not produce usable and compilable java-code, right? so we can not use this tool to decompile for example a SystemUI.apk, apply our mod to the produced java-code and then recompile it to a working SystemUI.apk?

greetz n thx,

sUsH
[Android Software Development] AndroidGraphix:
wow. I'm impressed bro. Good job.
[Android Software Development] SinisterChedda:
Im new to thread. I've used dex2jar years ago for help with my java II class making android apps for school. So does this just use dex2jar and some other tools to decompile with a GUI. Does this let you put it in eclipse and recompile?
[Android Software Development] mussieonlinux:
Looks amazing, this will really come in handy!
[Android Software Development] broodplank1337:
Unfortunately not, Maybe I will make a new version for linux also :) (I think all the external programs also so support linux)

No, this is no javascript, but java. You can run it in Eclipse for example

Yes that's what it does, I also mentioned the external tools used etc, so I think it's already clear that I didn't create an actual APK to Java decompiler, which would take me my whole life to only make a beta version :')

I used the most accurate tools, to bad JD-Core isn't available, really hate to work with a unnecessary gui which is also not fully controllable for some reason.

Thanks, In the current git commit (Early RC1) this problem is fixed. (Some one else mentioned it also, but It's kind of strange I think because I never received any error like that. however, it's fixed now.. (in the commit at least)

Will release RC1 probably today

You're welcome!, Well actually, It does generate a usable code, but it needs to be edited a little in most cases, I think all apks that are specially built for specific devices such as SystemUI.apk won't work without modifying some code.

for example, when you want to port a function from an other SystemUI.apk just decompile it, look up the source and paste it in your SystemUI.apk, probably it will have some errors because of invalid variable names or such, but the actually code just keeps intact, so that's the most important thing.

Thanks, Hope you like the tool^^

Basically it's an automated gui for several external tools yes, I'm still working on the Eclipse function to make the output less buggy, I think making an actual working eclipse project from an apk is the biggest challenge, But remember this is only a beta, so many new versions will release ;)

Thanks! It can become very handy sometimes idd :D
[Android Software Development] SinisterChedda:
Nothing wrong with GUI. Great job. About the eclipse portion of recompiling from source would be an elite defeat. I don't even think it can be done but with programming anything can happen. Downloaded now to check out. Just wondering if you can decompile jelly bean sys apps? Xda app sucks at search function.
[Android Software Development] exadeci:
I would love to be able to try it but I get an error

I'm on windows 8 x64

I tried RC1 couldn't compile (error adding splash) but I ran it instead and same error
[Android Software Development] SinisterChedda:
Which Java version do you have? Also try making java /bin folder as a environmental variable. I'm a little buzzed so hopefully it applies.
[Android Software Development] broodplank1337:
Yes the eclipse thing is the biggest part, It does create an importable eclipse project but when there's a lot of code it always has errors, I used it to port some small apps :) worked without any problems.

And yes you can decompile JB system apps! you're interested in porting functions from JB to ICS?

And the search function is okay, but only if you use "Search in titles only". else it's rubbish

I've identified that problem, It's either your apk doesn't have any source code (like framework-res.apk) or it's because the Heapsize set by java is to large for your system, I've indicated 2gb ram as minimal requirement. but the strange thing is that I have 8gb ram and still it gave me that error (at a very early build). So I edited the heapsize (https://github.com/broodplank/APKtoJava/commit/45dcbd5a956416883ee9c0e7a06300073ed4f1ca) to fix the problem. It seems you probably need a heapsize even lower then 512mb! try it, in RC1 final you will have the option to set the heapsize trough preferences menu btw.

I think that's not the problem, I already found out the reason 2 days ago. check the post above for explanation.
[Android Software Development] exadeci:
I'm running java 7 update 7, also I fixed my compile error by setting an env:

EnvSet("path", EnvGet("path") & ";" & @ScriptDir)
;Include splash image in exe
FileInstall("splash.jpg", @TempDir & "\splash.jpg", 1)

This way you can remove your absolute path and remove all the @ScriptDir & "\ from your script

[edit] I will try changing it but I have 8GB

I tried adding path to java jdk and Java_home but doesn't seems to work, I'm doing my test with cyanogenmod 10 deskclock.apk

There is nothing in preferences except 2 empty squares, so I guess it's all related to a java issue
[Android Software Development] :
Thanks . What are requirements of this? Is a certain version of windows need?

Thank you for this work
[Android Software Development] broodplank1337:
Thanks! I didn't know that command! I will update the source with EnvSet, I chose for the relative path since Fileinstall needs a relative path, but this way is much better :)

And the preferences screen is still empty idd, still need to fill it ^^ easy job tho, the commented part is al I need, just some changing and it's done

You're welcome, the minimal requirements are currently aimed at: (from helpfile)

- Windows XP / 7 (32 bit or 64bit)

- 2GB RAM

- Java Runtime Environment 6 or 7 (or JDK 6 / 7 )

And you could rewrite it in C, but how do you want to release it? since it already exists now. with the same name and functionality? please explain.
[Android Software Development] hypnos17:
Hey brood...does it work on Linux?

P.s....it's a great tool, why (if u didn't already done it) don't u post it in general section, too?

Sorry for bad english :)
[Android Software Development] broodplank1337:
No, exe's don't run on linux (you could try with wine, but no success guaranteed), I will try to make a linux version if im able to. ^^

Thanks, and I did post it in Android Software Development ;)

http://xdaforums.com/showthread.php?t=1911084
[Android Software Development] vulcanfk:
Looks like a great tool; thanks brood! Unfortunately, I don't have any Windows boxes so I second (third, fourth) the vote for a Linux version. I'd be willing to help contribute if you need some assistance with the conversion.
[Android Software Development] acocalypso:
that a great and easy to use tool, thanks but your convert to eclipse project function is broken

AutoIt Error

Line 4506

"C:/path/to/APKtoJava.exe":

Error: Subscript used with non-Array variable.

any way to fix it by my self?
[Android Software Development] exadeci:
you could try porting it with http://www.ironahk.net/ and as for 7zip and jdgui there are binaries on linux

Broodplank1337 I tried to change the heapsize to 256 and it failed, I uploaded the apk so you can try with it.
[Android Software Development] broodplank1337:
I still find it very odd that I have never got this error myself.

If you want to fix yourself:

https://github.com/broodplank/APKtoJava/blob/master/APKtoJava.au3

check @ line 234 and 241, delete the "[0]" at both lines. and compile ;)

That language looks fairly easy, will take a look at it. And I managed to decompile your apk, but only with an updated apktool.jar ;), will add the updated binary in the next build. I guess the previous apktool.jar was for GB or GB/ICS only, the new version of apktool succeeds luckily :)

btw, the eclipse project is also included, since i have never received any error at making it so far XD. only happens on other computers it seems :x. anyways, attached smali/java/res/eclipse
[Android Software Development] wintel_mac:
Hi brood,

great project you created. Will surely test it out and look through the java code.

Great to see such posts of members you know on the portal page. :good:
[Android Software Development] exadeci:
Thanks to your previous post I found how to fix my issue, it's not (or not only) apktool that is not updated but you have to add aapt in your tools http://miui.connortumbleson.com/other/apktool/aapt/win/faapt/

Now I have acocalypso error \o/, but deleting [0] works
[Android Software Development] broodplank1337:
Thanks, please let me know what you think about the result (java code)

And im happy it got posted on the portal page :)

Thanks :)!
[Android Software Development] eyeb:
Anyone tried running the android java apps on webos? I'm just curious if it would work. I'll try later this weekend if I can figure it out and post results.
[Android Software Development] expeacer:
Hy!

First I want to say thanks for this app! IT will be very useful for me - if it'll work...

I have an issue: After I select the apk, set everything, the process starting. When I got the Ctrl+Alt+S, i pick OK, then I got an error message:

If I choose OK, the program freeze, so I can only shut down from Task Manager.

If I choose OK, then I open jd-gui, I select the for ex. Myapk.apk.zip, the script continue, and finish, but after that the output folder still empty.

I'm using Windows 8 x64, with Java 7.

Thanks for your help!
[Android Software Development] broodplank1337:
That problem can be caused by an app without source code (framework-res.apk for example) or with an incorrect heap size, but probably it's just because aapt.exe is missing as apktool is also outdated, I will release RC1 very soon so I hope it's fixed for everyone then ;)
[Android Software Development] expeacer:
Thanks a lot, waiting for it! :good:

Oh, and I forgot something. It don't want open jd-gui. Never. I tried a lot app (from self-complied AOSP apps too.).

I'll try it with the RC1, and report back :)
[Android Software Development] Malkaridae:
Hi, thank you for creating this brood. I am also in the progress of learning android development coming from c# background, this should help my learning progress faster.

I don't know what I may be doing wrong... I created a simple hello world app and I can't seem to get it generate java code sources (I checked all boxes).

Appreciate the help, thanks.

Cheers
[Android Software Development] USMC retired:
question

Not knowing a whole lot about Java, or your developement, will this work for decompiling and recompiling for us themers? As I'm sure you've heard these 4.0 apk's are stubborn.

THanks
[Android Software Development] broodplank1337:
I think this tool will help you with that (at least if it works correctly for you)

Next build will solve many problems, because I'm so used to have android sdk / java jdk installed I don't even notice when a file is missing since it will search in an other directory for it. however in the next build I will add all binaries that are possibly needed. (quick fix = download aapt.exe and apktool.jar and place them in the tools directory)

Yes I have heard that they are a pain in the ass, but I managed to decompile JB apks completely without errors (but with updated apktool.jar and aapt.exe added to the tools dir)
[Android Software Development] Malkaridae:
Thanks for the quick reply, I downloaded the aapt.exe, and apktool.jar placed them in the tools, didn't seem to fix the problem. I will wait for your RC1, and see how it goes.

EDIT:: I've downloaded all the files from your git, and it worked perfectly, thanks!

Cheers
[Android Software Development] josuearisty:
Excellent, I'll try this as soon as possible to watch how it works!

Thank you!
[Android Software Development] sniper:
Thank you so much :) this is absolutely amazing.

edit: ok, I'm having a problem with generating the java code. Everything else is working fine. The classes.dex file is there and it opens up the java decompiler fine. I hit save all and the script does it's thing but then this is the log in the program:

- Extracting APK...
- Extracting APK Done!
- Converting classes.dex to classes-dex2jar.jar...
- Generating Java Code Done!
- Extracting Java Code....
- Extracting Java Code Done!
- Copying Java Code to output dir....
- Copying Java Code Done!
- Cleaning Up...
- Cleaning Done!

Decompilation has been aborted due to missing classes.dex file!

Now obviously the classes.dex file is there and I can even see the java files fine in the decompiler but it seems they're not being saved right.

I can open up the classes-dex2jar.jar fine with the jd GUI and save them manually.

Saving them manually in the same directory as the rest to /javacode I could just choose convert to eclipse and it set up all the files correctly.
[Android Software Development] expeacer:
So I downloaded the source from Git, and Complied it. Same problem.

Interesting, but if I execute commands from script in command prompt, everything working fine.

So I think AutoIt doesn't like Win8...
[Android Software Development] sniper:
I'm using Win7 x64.
[Android Software Development] Kostas1601:
I'm getting the same "Decompilation has been aborted due to missing classes.dex file!" problem with the stock jelly bean keyboard apk "LatinimeGoogle.apk"

I'm using Win7 x64 as well... :/

It looks like an awesome tool so I will check back to see if you fix this :)
[Android Software Development] sniper:
A workaround for the decompilation aborted error is this:

1. Set your apk and output folder and check the first 3 boxes (just the java one if you only want the java and not the eclipse project)

2. Hit start process

3. Once the prompt comes up telling you to manually hit ctrl alt s don't hit ok yet

4. Navigate to your APKtoJava/tools folder and copy the classes-dex2jar.jar file to the output folder you made

5. Follow the prompt after hitting ok (it should decompile everything else)

6. Execute jd-gui.exe in the tools folder

7. Open up the classes-dex2jar.jar file and save all

8. Extract the contents of the zip to the output folder inside a folder named "javacode"

9. In APKtoJava uncheck all boxes but "Convert the output to an Eclipse project" and hit start. You will now have a functioning eclipse project :)

10. ???

11. Profit
[Android Software Development] hitvan:
WHITE SPACES are not allowed in the apk...which causes one of the errors.

I fixed mine by renaming the apk.
[Android Software Development] sniper:
True, but that is not fixing the java decompiling error. It's a general rule of thumb to not use white spaces in most things android except xml. Also, the command prompt hates white spaces too ;)

Click here for custom mods for your E4GT
[Android Software Development] broodplank1337:
I've had more problems like that with AutoIT in the past, I think it's because the working directory isn't set correctly, that's why I added this line to the batch files:

cd /d %~dp0

which cd's to the dir of the batch script, but still no 100% success, I think I will try to make it run directly from the script, without a batch file, maybe it solves a lot of problems. I will post the source later^^

edit: so I tried to run the command like this now:

$run = RunWait("java -jar tools/baksmali-1.4.0.jar -o tools/smalicode/ classes.dex", "", @SW_HIDE)

and it works, but i'm kinda skeptical about that line, I'd rather use: _RunDOS("java -jar tools/baksmali-1.4.0.jar -o tools/smalicode/ classes.dex") but that continues right away,

so then another alternative is:

ShellExecuteWait, but that command doens't initialize the path environment whatsoever, you will just get can't find java...

So the thing that remains is:

RunWait(@ComSpec & " /c " & "java -jar baksmali-1.4.0.jar -o smalicode/ classes.dex", @ScriptDir&"\tools", @SW_HIDE)

which is actually RunWait and _RunDOS combined. and the working directory set to the tools directory. I hope that way it works for everyone

working example for first bat file that is called:

;REPLACEMENT FOR extractapk.bat
FileCopy(@ScriptDir & "\tools\" & _GetExtProperty($getpath_apkjar, 0), @ScriptDir & "\tools\" & _GetExtProperty($getpath_apkjar, 0) & ".zip", 1)
RunWait(@ComSpec & " /c " & "7za.exe x -y " & _GetExtProperty($getpath_apkjar, 0) & ".zip *.dex", @ScriptDir & "\tools", @SW_HIDE)

hmm when arriving at dex2jar.bat i suddenly remember how complicated that batch files it to run in 1 command.

set CLASSPATH=
FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i

java -Xms512m -cp "%CLASSPATH%" "com.googlecode.dex2jar.tools.Dex2jarCmd" %*

how the hell would I run that in 1 line! haha

I could make a loop

like this:

;REPLACEMENT for dex2jar.bat
Local $searchlibs = FileFindFirstFile(@ScriptDir & "\tools\lib\*.jar")

While 1
Local $file = FileFindNextFile($searchlibs)
If @error Then ExitLoop

RunWait(@ComSpec & " /c " & "call " & @ScriptDir & "\tools\lib\" & $file, "", @SW_HIDE)
WEnd

RunWait(@ComSpec & " /c " & "java -Xms512m -cp " & Chr(34) & "CLASSPATH=" & @ScriptDir & "\tools\lib" & Chr(34) & " " & Chr(34) & "com.googlecode.dex2jar.tools.Dex2jarCmd" & Chr(34) & " classes.dex", @ScriptDir & "\tools", @SW_HIDE)

but that just won't work.. hmm ;p
[Android Software Development] atif4ever:
thanks will give it a try..
[Android Software Development] TwoPointZero:
Hi broodplank,

I do not mean to diminish your achievements, new tools is always great.

However the grunt of the work is performed by external tools; don't you think it be proper to better credit/acknowledge those authors, say on the CHM frontpage?

Best regards.
[Android Software Development] broodplank1337:
The help file clearly makes all references to external programs:

References to External Apps

broodplank.net

External Apps used:

- 7za.exe

-- Description: 7zip command line tool

-- Author: Igor Pavlov

-- Site / Source: http://www.7-zip.org/

- apktool.jar

-- Description: Android Asset Packaging Tool

-- Author: Ryszard Wisniewski

-- Site / Source: http://code.google.com/p/android-apktool/

- aapt.exe

-- Description: Multifunctional tool for manipulating APKS

-- Author: Google AOSP Team

-- Site / Source: http://www.android.com/

- baksmali-1.4.0.jar

-- Description: Multifunctional tool for manipulating APKS

-- Author: JesusFreke's

-- Site / Source: http://code.google.com/p/smali/

- jd-gui.exe

-- Description: GUI version of JD-Core, this tool generates the actual java code

-- Author: Emmanuel Dupuy

-- Site / Source: http://java.decompiler.free.fr/?q=jdgui

- dex2jar.bat (with included libraries)

-- Description: Tool that converts classes.dex to a jar file which can be converted to javacode

-- Author: pxb1988

-- Site / Source: http://code.google.com/p/dex2jar/

;)

But I will also add the authors names to the first post

and btw, the batch file dex2jar.bat

@echo off
cd /d %~dp0
REM
REM dex2jar - Tools to work with android .dex and java .class files
REM Copyright (c) 2009-2012 Panxiaobo
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM

set CLASSPATH=
FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i

java -Xms512m -cp "%CLASSPATH%" "com.googlecode.dex2jar.tools.Dex2jarCmd" %*

maybe the top line (cd /d %~dp0) causes the problem? It's to get local dir, but maybe that just not right in this situation.

Can someone who has the problem try it?

Tried it myself, along with:

RunWait(@ScriptDir & "\tools\dex2jar.bat classes.dex", @ScriptDir & "\tools", @SW_HIDE)

and it worked perfectly, hope this solves the issue for good
[Android Software Development] broodplank1337:
Ok guys, I've figured it out! (I think). It works perfectly now for me in any directory :D

Check github for latest commit!

https://github.com/broodplank/APKtoJava