Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX] Fix jadx and apktool failure due to JDK changes (#2269) #6

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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