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

Encountering weird problems when analyzing some APK files #16

Open
YangYiyu opened this issue Jul 16, 2023 · 0 comments
Open

Encountering weird problems when analyzing some APK files #16

YangYiyu opened this issue Jul 16, 2023 · 0 comments
Labels

Comments

@YangYiyu
Copy link

Question

Encountering weird problems when analyzing some APK files

I am a beginner, so please forgive me if these issues are actually easy to solve. I have been stuck with these things for a long time.

Description

When I load different APK files using the following Python code, three weird problems occur that prevent the program from returning the correct results.

Python code:

from pysoot.lifter import Lifter

android_sdk_path = "/home/yyy/Android/Sdk/platforms"
apk_file = "xxx.apk"
lifter = Lifter(apk_file, input_format="apk", ir_format="jimple", android_sdk=android_sdk_path)
print("{} has {} classes".format(apk_file, len(lifter.classes)))

Problem 1: Chosen the wrong API version.

The output is:

pysoot.errors.JythonClientException: JYTHON SOCKET CLOSED
STDOUT:
b'Soot CUSTOM: Scene created! >>> 3\n'b'Chosen APIVersion: [-1, -1, -1] --> 3\n'
STDERR:
......b'java.lang.RuntimeException: java.lang.RuntimeException: error: target android.jar (/home/yyy/Android/Sdk/platforms/android-3/android.jar) does not exist.\n'

or

pysoot.errors.JythonClientException: JYTHON SOCKET CLOSED
STDOUT:
b'Soot CUSTOM: Scene created! >>> 3\n'b'Chosen APIVersion: [63055, 28, 19] --> 63055\n'
STDERR:
......b'java.lang.RuntimeException: java.lang.RuntimeException: Required APIVersion (63055) is not available. maxAPI is: 34\n'

Problem 2: Encountered small uint that is out of range.

The output is:

pysoot.errors.JythonClientException: JYTHON SOCKET CLOSED
STDOUT:
b'Soot CUSTOM: Scene created! >>> 3\n'b'Chosen APIVersion: [29, 28, 19] --> 29\n'b"Using '/home/yyy/Android/Sdk/platforms/android-29/android.jar' as android.jar\n"b"Warning: exception while processing dex file '/home/yyy/apkfiles/testapk/Mijia/v6.0.214.apk'\n"b'Exception: org.jf.util.ExceptionWithContext: Encountered small uint that is out of range at offset 0x38\n'
STDERR:
......b'org.jf.util.ExceptionWithContext: org.jf.util.ExceptionWithContext: Encountered small uint that is out of range at offset 0x38\n'

Problem 3: The program took more than 4 hours to execute and did not return any results.

Environment

OS: Ubuntu 20.04
CPU:
Architecture: x86_64
Model name: Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz
CPU(s): 16
MEM: 128G
Python: 3.8.10
pysoot: 7.7.12.1

APK File

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant