Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

RC3 Alpha Commit

Very early RC3 commit
  • Loading branch information...
commit 420d09807e05b5cfdd574791ddeac22f6b0a0faa 1 parent df5c3ea
@broodplank authored
View
150 APKtoJava.au3
@@ -5,7 +5,7 @@
#AutoIt3Wrapper_Outfile_x64=APKtoJava_x64.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=©2012 broodplank.net
-#AutoIt3Wrapper_Res_Fileversion=0.0.2.0
+#AutoIt3Wrapper_Res_Fileversion=0.0.3.0
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Run_Obfuscator=y
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
@@ -123,7 +123,7 @@ EndFunc ;==>_StringSearchInFile
;ExtractAPK
Func _ExtractAPK($apkfile)
- GUICtrlSetData($log, "APK to Java RC2 Initialized...." & @CRLF & "------------------------------------------" & @CRLF)
+ GUICtrlSetData($log, "APK to Java RC3 Initialized...." & @CRLF & "------------------------------------------" & @CRLF)
FileDelete(@ScriptDir & "\tools\classes.dex")
_AddLog("- Extracting APK...")
@@ -344,7 +344,7 @@ EndFunc ;==>Restart
-$gui = GUICreate("APK to Java Release Candidate 2 - by broodplank", 550, 470)
+$gui = GUICreate("APK to Java Release Candidate 3 - by broodplank", 550, 490)
$filemenu = GUICtrlCreateMenu("&File")
$filemenu_restart = GUICtrlCreateMenuItem("&Restart", $filemenu, 1)
@@ -362,7 +362,7 @@ $helpmenu_donate = GUICtrlCreateMenuItem("&Donate", $helpmenu, 2)
GUISetFont(8, 8, 0, "Verdana")
GUICtrlCreateLabel("Log:", 305, 5)
-$log = GUICtrlCreateEdit("APK to Java RC2 Initialized...." & @CRLF & "------------------------------------------" & @CRLF, 305, 22, 240, 420, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_MULTILINE, $ES_READONLY))
+$log = GUICtrlCreateEdit("APK to Java RC3 Initialized...." & @CRLF & "------------------------------------------" & @CRLF, 305, 22, 240, 440, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_MULTILINE, $ES_READONLY))
GUICtrlCreateGroup("Step 1: Selecting the file", 5, 5, 290, 140)
GUICtrlCreateLabel("Please choose the apk/jar file that you want to " & @CRLF & "decompile to java sources: ", 15, 25)
@@ -382,7 +382,7 @@ $destination = GUICtrlCreateInput("", 15, 205, 195, 20)
GUICtrlSetState($destination, $GUI_DISABLE)
$destdirbrowse = GUICtrlCreateButton("Browse..", 215, 205, 70, 20)
-GUICtrlCreateGroup("Step 3: Choosing decompilation preferences", 5, 240, 290, 155)
+GUICtrlCreateGroup("Step 3: Choosing decompilation preferences", 5, 240, 290, 175)
GUICtrlCreateLabel("Please choose the parts to decompile:", 15, 260)
$decompile_source_java = GUICtrlCreateCheckbox("Sources (generate java code)", 15, 280)
$decompile_source_smali = GUICtrlCreateCheckbox("Sources (generate smali code)", 15, 300)
@@ -390,10 +390,11 @@ $decompile_resource = GUICtrlCreateCheckbox("Resources (the images/layouts/etc)"
GUICtrlCreateLabel("Additional options:", 15, 350)
$decompile_eclipse = GUICtrlCreateCheckbox("Convert output to an Eclipse project", 15, 370)
+$decompile_zip = GUICtrlCreateCheckbox("Make zip archive of output files", 15, 390)
-$start_process = GUICtrlCreateButton("Start Decompilation Process!", 5, 400, 290, 25)
+$start_process = GUICtrlCreateButton("Start Decompilation Process!", 5, 420, 290, 25)
-$copyright = GUICtrlCreateLabel("©2012 broodplank.net - All Rights Reserved", 5, 433)
+$copyright = GUICtrlCreateLabel("©2012 broodplank.net - All Rights Reserved", 5, 453)
GUICtrlSetStyle($copyright, $WS_DISABLED)
GUISetState()
@@ -412,7 +413,27 @@ While 1
If $getpath_apkjar = "" Then
;
Else
- GUICtrlSetData($file, _GetExtProperty($getpath_apkjar, 0))
+ If StringInStr(_GetExtProperty($getpath_apkjar, 0), Chr(32), 0, 1) Then
+ Dim $msgboxfile
+ $msgboxfile = MsgBox(51, "APK To Java Error", "A space has been found in your apk name" & @CRLF & "This can lead to an invalid output and/or errors" & @CRLF & "The main reason is that DOS doesn't allow you to use spaces" & @CRLF & @CRLF & "Do you want to continue?" & @CRLF & @CRLF & "Press 'Yes' to auto remove the spaces from your apk file name and continue the operation" & @CRLF & "Press 'No' to keep the spaces in the apk name (you will regret it)" & @CRLF & "Press 'Cancel' to cancel operation and set apk field blank.")
+ If $msgboxfile = 7 Then
+ GUICtrlSetData($file, _GetExtProperty($getpath_apkjar, 0))
+ ElseIf $msgboxfile = 2 Then
+ GUICtrlSetData($file, "")
+ ElseIf $msgboxfile = 6 Then
+
+ $apknospace = StringStripWS(_GetExtProperty($getpath_apkjar, 0), 8)
+
+ FileMove($getpath_apkjar, GetDir($getpath_apkjar) & $apknospace)
+ GUICtrlSetData($file, $apknospace, 0)
+
+ $getpath_apkjar = GetDir($getpath_apkjar) & $apknospace
+
+ EndIf
+ Else
+ GUICtrlSetData($file, _GetExtProperty($getpath_apkjar, 0))
+ EndIf
+
If GUICtrlRead($filedex) <> "" Then GUICtrlSetData($filedex, "")
EndIf
@@ -500,7 +521,7 @@ While 1
_RunDos("start " & @ScriptDir & "\help.chm")
Case $msg = $helpmenu_about
- MsgBox(0, "APK to Java -- About", "About APK to Java" & @CRLF & @CRLF & "APK to Java" & @CRLF & "Version: RC2" & @CRLF & "Author: broodplank(1337)" & @CRLF & "Site: www.broodplank.net")
+ MsgBox(0, "APK to Java -- About", "About APK to Java" & @CRLF & @CRLF & "APK to Java" & @CRLF & "Version: RC3" & @CRLF & "Author: broodplank(1337)" & @CRLF & "Site: www.broodplank.net")
Case $msg = $helpmenu_donate
_RunDos("start http://forum.xda-developers.com/donatetome.php?u=4354408")
@@ -521,9 +542,43 @@ While 1
WEnd
+; #FUNCTION# ======================================================================================================
+; Name...........: GetDir
+; Description ...: Returns the directory of the given file path
+; Syntax.........: GetDir($sFilePath)
+; Parameters ....: $sFilePath - File path
+; Return values .: Success - The file directory
+; Failure - -1, sets @error to:
+; |1 - $sFilePath is not a string
+; Author ........: Renan Maronni <renanmaronni@hotmail.com>
+; Modified.......:
+; Remarks .......: I (broodplank) was to lazy at this moment to write this myself :D
+; ==================================================================================================================
+Func GetDir($sFilePath)
+
+ Local $aFolders = StringSplit($sFilePath, "\")
+ Local $iArrayFoldersSize = UBound($aFolders)
+ Local $FileDir = ""
+
+ If (Not IsString($sFilePath)) Then
+ Return SetError(1, 0, -1)
+ EndIf
+
+ $aFolders = StringSplit($sFilePath, "\")
+ $iArrayFoldersSize = UBound($aFolders)
+
+ For $i = 1 To ($iArrayFoldersSize - 2)
+ $FileDir &= $aFolders[$i] & "\"
+ Next
+
+ Return $FileDir
+
+EndFunc ;==>GetDir
+
+
Func _PreferencesMenu()
- $optionsGUI = GUICreate("APK to Java Preferences", 260, 265, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_MDICHILD), $gui)
+ $optionsGUI = GUICreate("APK to Java Preferences", 520, 215, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_MDICHILD), $gui)
GUISetBkColor(0xefefef, $optionsGUI)
GUICtrlCreateGroup("Java Generation Preferences:", 5, 5, 250, 65)
@@ -536,7 +591,6 @@ Func _PreferencesMenu()
GUICtrlSetState($options_app_jdgui, $GUI_UnChecked)
EndIf
-
$options_app_jad = GUICtrlCreateRadio("Use JAD to make Java Sources", 15, 45)
$options_app_jad_read = IniRead(@ScriptDir & "\config.ini", "options", "usejad", "")
If $options_app_jad_read = 1 Then
@@ -545,7 +599,7 @@ Func _PreferencesMenu()
GUICtrlSetState($options_app_jad, $GUI_UnChecked)
EndIf
- GUICtrlCreateGroup("Heapsize for decompiling classes.dex to jar:", 5, 75, 250, 50)
+ GUICtrlCreateGroup("Heapsize for decompilation (Java):", 5, 75, 250, 50)
GUICtrlCreateLabel("Heapsize:", 15, 98)
$options_app_heapsize_read = IniRead(@ScriptDir & "\config.ini", "options", "heapsize", "512")
$options_app_heapsize = GUICtrlCreateCombo("", 80, 95, 100, 20, $CBS_DROPDOWNLIST)
@@ -564,17 +618,55 @@ Func _PreferencesMenu()
GUICtrlSetState($options_app_jad_deepness, $GUI_DISABLE)
EndIf
- GUICtrlCreateGroup("Computer Speed / Interval between operations:", 5, 185, 250, 50)
- GUICtrlCreateLabel("Interval:", 15, 208)
+ GUICtrlCreateGroup("Computer Speed / Interval between operations:", 265, 130, 250, 50)
+ GUICtrlCreateLabel("Interval:", 275, 153)
$options_app_interval_read = IniRead(@ScriptDir & "\config.ini", "options", "interval", "250")
- $options_app_interval = GUICtrlCreateCombo("", 80, 205, 100, 20, $CBS_DROPDOWNLIST)
+ $options_app_interval = GUICtrlCreateCombo("", 340, 150, 100, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData($options_app_interval, "0|50|100|150|200|250|300|350|400|450|500|550|600|650|700|750|800|850|950|1000", $options_app_interval_read)
- GUICtrlCreateLabel("Miliseconds", 190, 208)
+ GUICtrlCreateLabel("Miliseconds", 450, 153)
+
+
+ GUICtrlCreateGroup("Output Stream (Advanced):", 265, 5, 250, 121)
+
+ GUICtrlCreateLabel("BakSmali", 275, 30)
+ $options_app_baksmali_stderr = GUICtrlCreateCheckbox("STDERR", 360, 26)
+ $options_app_baksmali_stderr_read = IniRead(@ScriptDir & "\config.ini", "output", "baksmali_stderr", "1")
+ If $options_app_baksmali_stderr_read = 1 Then GUICtrlSetState($options_app_baksmali_stderr, $GUI_CHECKED)
+
+ $options_app_baksmali_stdout = GUICtrlCreateCheckbox("STDOUT", 445, 26)
+ $options_app_baksmali_stdout_read = IniRead(@ScriptDir & "\config.ini", "output", "baksmali_stdout", "1")
+ If $options_app_baksmali_stdout_read = 1 Then GUICtrlSetState($options_app_baksmali_stdout, $GUI_CHECKED)
+ GUICtrlCreateLabel("APKTool", 275, 55)
+ $options_app_apktool_stderr = GUICtrlCreateCheckbox("STDERR", 360, 51)
+ $options_app_apktool_stderr_read = IniRead(@ScriptDir & "\config.ini", "output", "apktool_stderr", "1")
+ If $options_app_apktool_stderr_read = 1 Then GUICtrlSetState($options_app_apktool_stderr, $GUI_CHECKED)
- $options_ok_button = GUICtrlCreateButton("Ok", 5, 240, 80, 20)
- $options_cancel_button = GUICtrlCreateButton("Cancel", 90, 240, 80, 20)
- $options_apply_button = GUICtrlCreateButton("Apply", 175, 240, 80, 20)
+ $options_app_apktool_stdout = GUICtrlCreateCheckbox("STDOUT", 445, 51)
+ $options_app_apktool_stdout_read = IniRead(@ScriptDir & "\config.ini", "output", "apktool_stdout", "1")
+ If $options_app_apktool_stdout_read = 1 Then GUICtrlSetState($options_app_apktool_stdout, $GUI_CHECKED)
+
+ GUICtrlCreateLabel("Dex2Jar", 275, 80)
+ $options_app_dex2jar_stderr = GUICtrlCreateCheckbox("STDERR", 360, 76)
+ $options_app_dex2jar_stderr_read = IniRead(@ScriptDir & "\config.ini", "output", "dex2jar_stderr", "1")
+ If $options_app_dex2jar_stderr_read = 1 Then GUICtrlSetState($options_app_dex2jar_stderr, $GUI_CHECKED)
+
+ $options_app_dex2jar_stdout = GUICtrlCreateCheckbox("STDOUT", 445, 76)
+ $options_app_dex2jar_stdout_read = IniRead(@ScriptDir & "\config.ini", "output", "dex2jar_stdout", "1")
+ If $options_app_dex2jar_stdout_read = 1 Then GUICtrlSetState($options_app_dex2jar_stdout, $GUI_CHECKED)
+
+ GUICtrlCreateLabel("JAD", 275, 103)
+ $options_app_jad_stderr = GUICtrlCreateCheckbox("STDERR", 360, 100)
+ $options_app_jad_stderr_read = IniRead(@ScriptDir & "\config.ini", "output", "jad_stderr", "1")
+ If $options_app_jad_stderr_read = 1 Then GUICtrlSetState($options_app_jad_stderr, $GUI_CHECKED)
+
+ $options_app_jad_stdout = GUICtrlCreateCheckbox("STDOUT", 445, 100)
+ $options_app_jad_stdout_read = IniRead(@ScriptDir & "\config.ini", "output", "jad_stdout", "1")
+ If $options_app_jad_stdout_read = 1 Then GUICtrlSetState($options_app_jad_stdout, $GUI_CHECKED)
+
+ $options_ok_button = GUICtrlCreateButton("OK", 225, 190, 90, 20)
+ $options_cancel_button = GUICtrlCreateButton("Cancel", 325, 190, 90, 20)
+ $options_apply_button = GUICtrlCreateButton("Apply", 425, 190, 90, 20)
GUISetState(@SW_SHOW, $optionsGUI)
GUISwitch($optionsGUI)
@@ -621,9 +713,27 @@ Func _PreferencesMenu()
IniWrite(@ScriptDir & "\config.ini", "options", "usejdgui", "1")
EndIf
-
IniWrite(@ScriptDir & "\config.ini", "options", "interval", GUICtrlRead($options_app_interval))
+ If GUICtrlRead($options_app_baksmali_stderr) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "baksmali_stderr", "1")
+ If GUICtrlRead($options_app_baksmali_stderr) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "baksmali_stderr", "0")
+ If GUICtrlRead($options_app_baksmali_stdout) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "baksmali_stdout", "1")
+ If GUICtrlRead($options_app_baksmali_stdout) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "baksmali_stdout", "0")
+
+ If GUICtrlRead($options_app_apktool_stderr) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "apktool_stderr", "1")
+ If GUICtrlRead($options_app_apktool_stderr) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "apktool_stderr", "0")
+ If GUICtrlRead($options_app_apktool_stdout) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "apktool_stdout", "1")
+ If GUICtrlRead($options_app_apktool_stdout) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "apktool_stdout", "0")
+
+ If GUICtrlRead($options_app_dex2jar_stderr) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "dex2jar_stderr", "1")
+ If GUICtrlRead($options_app_dex2jar_stderr) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "dex2jar_stderr", "0")
+ If GUICtrlRead($options_app_dex2jar_stdout) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "dex2jar_stdout", "1")
+ If GUICtrlRead($options_app_dex2jar_stdout) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "dex2jar_stdout", "0")
+
+ If GUICtrlRead($options_app_jad_stderr) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "jad_stderr", "1")
+ If GUICtrlRead($options_app_jad_stderr) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "jad_stderr", "0")
+ If GUICtrlRead($options_app_jad_stdout) = $GUI_CHECKED Then IniWrite(@ScriptDir & "\config.ini", "output", "jad_stdout", "1")
+ If GUICtrlRead($options_app_jad_stdout) = $GUI_UnChecked Then IniWrite(@ScriptDir & "\config.ini", "output", "jad_stdout", "0")
$heapsize = GUICtrlRead($options_app_heapsize)
_FileWriteToLine(@ScriptDir & "\tools\dex2jar.bat", "23", "java -Xms" & $heapsize & "m -cp " & Chr(34) & "%CLASSPATH%" & Chr(34) & " " & Chr(34) & "com.googlecode.dex2jar.tools.Dex2jarCmd" & Chr(34) & " %*", 1)
View
2  APKtoJava.au3.tbl
1 addition, 1 deletion not shown
View
BIN  APKtoJava.exe
Binary file not shown
View
BIN  APKtoJava.ico
Binary file not shown
View
9,965 APKtoJava_Obfuscated.au3
5,024 additions, 4,941 deletions not shown
View
18 config.ini
@@ -1,6 +1,16 @@
[options]
-usejdgui=1
-usejad=0
-jaddeepness=5
+usejdgui=0
+usejad=1
+jaddeepness=7
heapsize=512
-interval=250
+interval=450
+
+[output]
+baksmali_stderr=1
+baksmali_stdout=1
+apktool_stderr=1
+apktool_stdout=1
+dex2jar_stderr=1
+dex2jar_stdout=1
+jad_stderr=1
+jad_stdout=1
Please sign in to comment.
Something went wrong with that request. Please try again.