Skip to content

Commit

Permalink
[HOTFIX] Fix jadx and apktool failure due to JDK changes (#2269)
Browse files Browse the repository at this point in the history
* Fix jadx and apktool failure due to JDK zip64 changes
  • Loading branch information
ajinabraham committed Sep 17, 2023
1 parent 9a7182f commit abb4765
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 56 deletions.
2 changes: 2 additions & 0 deletions mobsf/DynamicAnalyzer/tools/apk_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, app_dir, tools_dir, apk_file) -> None:
def decompile_apk(self):
"""Decompile APK."""
args = [find_java_binary(),
'-Djdk.util.zip.disableZip64ExtraFieldValidation=true',
'-jar',
self.apktool_path,
'--frame-path',
Expand All @@ -53,6 +54,7 @@ def decompile_apk(self):
def recompile_apk(self):
"""Recompile APK."""
args = [find_java_binary(),
'-Djdk.util.zip.disableZip64ExtraFieldValidation=true',
'-jar',
self.apktool_path,
'-f', 'b',
Expand Down
2 changes: 1 addition & 1 deletion mobsf/StaticAnalyzer/tools/jadx/bin/jadx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ APP_NAME="jadx"
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and JADX_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC"'
DEFAULT_JVM_OPTS='"-Djdk.util.zip.disableZip64ExtraFieldValidation=true" "-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 1 addition & 1 deletion mobsf/StaticAnalyzer/tools/jadx/bin/jadx.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set APP_HOME=%DIRNAME%..
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and JADX_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC"
set DEFAULT_JVM_OPTS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true" "-Xms128M" "-XX:MaxRAMPercentage=70.0" "-XX:+UseG1GC"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
1 change: 1 addition & 0 deletions mobsf/StaticAnalyzer/views/android/manifest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_manifest_apk(app_path, app_dir, tools_dir):
output_dir = os.path.join(app_dir, 'apktool_out')
args = [find_java_binary(),
'-jar',
'-Djdk.util.zip.disableZip64ExtraFieldValidation=true',
apktool_path,
'--match-original',
'--frame-path',
Expand Down
53 changes: 0 additions & 53 deletions mobsf/StaticAnalyzer/views/android/win_fixes.py

This file was deleted.

1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ exclude =
build
mobsf/DynamicAnalyzer/tools/adb/
mobsf/StaticAnalyzer/migrations/
mobsf/StaticAnalyzer/tools/enjarify/
ignore =
D100,
D101,
Expand Down

0 comments on commit abb4765

Please sign in to comment.