JordanSamhi / AndroLog

An Android Instrumentation tool to compute Code Coverage
GNU Lesser General Public License v2.1
8 stars 1 forks source link

Exception in thread "Thread-48" soot.toDex.DexPrinterException #1

Closed Ad-Astra-Abyssosque closed 2 months ago

Ad-Astra-Abyssosque commented 4 months ago

I try to run the following command to instrument an app. java -jar -Xms2048m -Xmx30720m ./target/androlog-0.1-jar-with-dependencies.jar -p D:\AndroidSDK\platforms -l RUN_WCX_LOG -o ./outputs/ -a D:\Android_Automatic_Test\apks\googleplay\Runkeeper.apk -c -m -n But I got this error:

[*] Setting up environment...
[?] Done.
[*] Instrumentation in progress...
[?] Done.
[*] Exporting new apk...
Exception in thread "Thread-48" soot.toDex.DexPrinterException: Error while processing method <pl.droidsonroids.gif.GifImageButton: android.os.Parcelable onSaveInstanceState()>
        at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1078)
        at soot.toDex.DexPrinter.addAsClassDefItem(DexPrinter.java:660)
        at soot.toDex.DexPrinter.add(DexPrinter.java:1685)
        at soot.PackManager.writeClass(PackManager.java:1073)
        at soot.PackManager.lambda$writeOutput$1(PackManager.java:706)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.lang.RuntimeException: not found: [0..1]
        at soot.toDex.PrimitiveType.getByName(PrimitiveType.java:46)
        at soot.toDex.ExprVisitor.castPrimitive(ExprVisitor.java:668)
        at soot.toDex.ExprVisitor.caseCastExpr(ExprVisitor.java:636)
        at soot.jimple.internal.AbstractCastExpr.apply(AbstractCastExpr.java:136)
        at soot.toDex.StmtVisitor.caseAssignStmt(StmtVisitor.java:491)
        at soot.jimple.internal.JAssignStmt.apply(JAssignStmt.java:217)
        at soot.toDex.DexPrinter.toInstructions(DexPrinter.java:1559)
        at soot.toDex.DexPrinter.toMethodImplementation(DexPrinter.java:1191)
        at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1076)
        ... 7 more
Exception in thread "main" soot.toDex.DexPrinterException: Error while processing method <pl.droidsonroids.gif.GifImageButton: android.os.Parcelable onSaveInstanceState()>
        at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1078)
        at soot.toDex.DexPrinter.addAsClassDefItem(DexPrinter.java:660)
        at soot.toDex.DexPrinter.add(DexPrinter.java:1685)
        at soot.PackManager.writeClass(PackManager.java:1073)
        at soot.PackManager.lambda$writeOutput$1(PackManager.java:706)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.lang.RuntimeException: not found: [0..1]
        at soot.toDex.PrimitiveType.getByName(PrimitiveType.java:46)
        at soot.toDex.ExprVisitor.castPrimitive(ExprVisitor.java:668)
        at soot.toDex.ExprVisitor.caseCastExpr(ExprVisitor.java:636)
        at soot.jimple.internal.AbstractCastExpr.apply(AbstractCastExpr.java:136)
        at soot.toDex.StmtVisitor.caseAssignStmt(StmtVisitor.java:491)
        at soot.jimple.internal.JAssignStmt.apply(JAssignStmt.java:217)
        at soot.toDex.DexPrinter.toInstructions(DexPrinter.java:1559)
        at soot.toDex.DexPrinter.toMethodImplementation(DexPrinter.java:1191)
        at soot.toDex.DexPrinter.toMethods(DexPrinter.java:1076)
        ... 7 more

Many other similar apps have the same exception: soot.toDex.DexPrinterException

JordanSamhi commented 4 months ago

Hi, thanks for reporting this. Could you please share an app that has this problem?

Ad-Astra-Abyssosque commented 4 months ago

I download apps from Google Play. Here are some of the apps with this problem:

I download these apps using a script from Tammpermonkey: Direct download from Google Play

JordanSamhi commented 3 months ago

Hi @Ad-Astra-Abyssosque ,

I have made many tests and indeed I ran into the same issue for some of the APKs you mention while write the APK back to a file.

It seems the problem is a Soot/Dexpler problem, not an AndroLog problem, could you report it to the Soot repository?