JesusFreke / smali

smali/baksmali
6.35k stars 1.07k forks source link

Bug baksmali ( decompile via apktool-2.2.3 ) #528

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello I encounter a decompile bug with apktool linked to baksmali See the bug on Mi-Drone.apk lien apk: http://app.mi.com/details?id=com.fimi.soul&ref=search

java -jar apktool-2.2.3.jar d Mi-Drone-1.0.60.11.apk I: Using Apktool 2.2.3-95f86f-SNAPSHOT on Mi-Drone-1.0.60.11.apk I: Loading resource table... I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: /home/fayz/.local/share/apktool/framework/1.apk I: Regular manifest package... I: Decoding file-resources... I: Decoding values / XMLs... I: Baksmaling classes.dex... La/ab;->(La/s;La/q;)V: Invalid debug offset La/aa;->(La/s;La/ae;La/q;Ljava/util/concurrent/Executor;)V: Invalid debug offset La/a;->(Ljava/lang/String;[Ljava/lang/Throwable;)V: Invalid debug offset La/ab;->(La/s;La/q;)V: Invalid debug offset La/a;->(Ljava/lang/String;[Ljava/lang/Throwable;)V: Invalid debug offset La/a;->(Ljava/util/List;)V: Invalid debug offset La/a;->(Ljava/util/List;)V: Invalid debug offset La/ab;->a(La/s;)La/s;: Invalid debug offset La/ab;->a(La/s;)La/s;: Invalid debug offset La/a;->a()Ljava/util/List;: Invalid debug offset La/aa;->(La/s;La/ae;La/q;Ljava/util/concurrent/Executor;)V: Invalid debug offset La/aa;->a(La/s;)Ljava/lang/Void;: Invalid debug offset La/aa;->a(La/s;)Ljava/lang/Void;: Invalid debug offset L0/0;->()V: Invalid debug offset La/ac;->(La/s;La/q;)V: Invalid debug offset La/ac;->(La/s;La/q;)V: Invalid debug offset La/ac;->a(La/s;)La/s;: Invalid debug offset La/ac;->a(La/s;)La/s;: Invalid debug offset La/ab;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/ab;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/ac;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/a;->b()[Ljava/lang/Throwable;: Invalid debug offset La/ac;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/ae;->(La/s;)V: Invalid debug offset La/ae;->(La/s;)V: Invalid debug offset La/ae;->(La/s;La/t;)V: Invalid debug offset La/ae;->(La/s;La/t;)V: Invalid debug offset La/ae;->a()La/s;: Invalid debug offset La/af;->(Landroid/content/Context;)V: Invalid debug offset La/af;->(Landroid/content/Context;)V: Invalid debug offset La/af;->a(Ljava/util/Map;Landroid/net/Uri;)La/e;: Invalid debug offset La/af;->a(Ljava/util/Map;Landroid/net/Uri;)La/e;: Invalid debug offset La/af;->a(La/af;)Landroid/content/Context;: Invalid debug offset La/af;->a(La/af;)Landroid/content/Context;: Invalid debug offset La/af;->a(Ljava/lang/String;)Landroid/net/Uri;: Invalid debug offset La/ae;->a(Ljava/lang/Exception;)Z: Invalid debug offset La/ad;->(La/q;La/s;La/ae;)V: Invalid debug offset La/aa;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/aa;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/ad;->(La/q;La/s;La/ae;)V: Invalid debug offset La/af;->a(Ljava/lang/String;)Landroid/net/Uri;: Invalid debug offset La/ag;->(La/af;Landroid/net/Uri;)V: Invalid debug offset La/ag;->(La/af;Landroid/net/Uri;)V: Invalid debug offset La/af;->a(Ljava/net/URLConnection;)Ljava/lang/String;: Invalid debug offset La/ag;->a(La/s;)La/e;: Invalid debug offset La/af;->a(Ljava/net/URLConnection;)Ljava/lang/String;: Invalid debug offset La/af;->a(Ljava/util/Map;Ljava/lang/String;)Ljava/util/List;: Invalid debug offset La/ag;->a(La/s;)La/e;: Invalid debug offset La/af;->a(Ljava/util/Map;Ljava/lang/String;)Ljava/util/List;: Invalid debug offset La/af;->a(Lorg/json/JSONArray;)Ljava/util/Map;: Invalid debug offset La/ag;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/af;->a(Lorg/json/JSONArray;)Ljava/util/Map;: Invalid debug offset La/ag;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/ah;->(La/af;La/p;Landroid/net/Uri;La/p;)V: Invalid debug offset La/ah;->(La/af;La/p;Landroid/net/Uri;La/p;)V: Invalid debug offset La/ae;->a(Ljava/lang/Exception;)Z: Invalid debug offset La/ah;->a(La/s;)La/s;: Invalid debug offset La/ae;->a(Ljava/lang/Object;)Z: Invalid debug offset La/af;->b(Ljava/util/Map;Landroid/net/Uri;)La/e;: Invalid debug offset La/ae;->a(Ljava/lang/Object;)Z: Invalid debug offset La/ae;->b(Ljava/lang/Exception;)V: Invalid debug offset La/ae;->b(Ljava/lang/Exception;)V: Invalid debug offset La/ae;->b(Ljava/lang/Object;)V: Invalid debug offset La/ae;->b(Ljava/lang/Object;)V: Invalid debug offset La/ad;->run()V: Invalid debug offset La/ai;->(La/ah;)V: Invalid debug offset La/ai;->(La/ah;)V: Invalid debug offset La/ai;->a(Landroid/webkit/WebView;)V: Invalid debug offset La/ai;->a(Landroid/webkit/WebView;)V: Invalid debug offset La/ai;->onLoadResource(Landroid/webkit/WebView;Ljava/lang/String;)V: Invalid debug offset La/ai;->onLoadResource(Landroid/webkit/WebView;Ljava/lang/String;)V: Invalid debug offset La/af;->b(Ljava/util/Map;Landroid/net/Uri;)La/e;: Invalid debug offset La/ah;->a(La/s;)La/s;: Invalid debug offset La/ah;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/af;->b(Ljava/net/URLConnection;)Ljava/lang/String;: Invalid debug offset La/ae;->b()Z: Invalid debug offset La/ai;->onPageFinished(Landroid/webkit/WebView;Ljava/lang/String;)V: Invalid debug offset La/ai;->onPageFinished(Landroid/webkit/WebView;Ljava/lang/String;)V: Invalid debug offset La/ae;->c()V: Invalid debug offset La/af;->b(Ljava/net/URLConnection;)Ljava/lang/String;: Invalid debug offset La/aj;->(La/ah;La/ae;)V: Invalid debug offset La/aj;->(La/ah;La/ae;)V: Invalid debug offset La/aj;->a(Ljava/lang/String;)V: Invalid debug offset La/ak;->(La/af;Landroid/net/Uri;La/p;La/p;)V: Invalid debug offset La/aj;->a(Ljava/lang/String;)V: Invalid debug offset La/ak;->(La/af;Landroid/net/Uri;La/p;La/p;)V: Invalid debug offset La/ak;->a()Ljava/lang/Void;: Invalid debug offset La/ak;->call()Ljava/lang/Object;: Invalid debug offset La/d;->()V: Invalid debug offset La/d;->(La/c;)V: Invalid debug offset La/d;->(La/c;)V: Invalid debug offset La/d;->execute(Ljava/lang/Runnable;)V: Invalid debug offset La/d;->execute(Ljava/lang/Runnable;)V: Invalid debug offset La/af;->b(Lorg/json/JSONArray;)Ljava/util/Map;: Invalid debug offset La/ah;->then(La/s;)Ljava/lang/Object;: Invalid debug offset La/e;->(Landroid/net/Uri;Ljava/util/List;Landroid/net/Uri;)V: Invalid debug offset La/e;->(Landroid/net/Uri;Ljava/util/List;Landroid/net/Uri;)V: Invalid debug offset La/af;->b(Lorg/json/JSONArray;)Ljava/util/Map;: Invalid debug offset La/e;->a()Landroid/net/Uri;: Invalid debug offset La/e;->b()Ljava/util/List;: Invalid debug offset La/e;->c()Landroid/net/Uri;: Invalid debug offset La/af;->a(Landroid/net/Uri;)La/s;: Invalid debug offset La/af;->a(Landroid/net/Uri;)La/s;: Invalid debug offset La/g;->(La/e;Landroid/os/Bundle;Landroid/os/Bundle;)V: Invalid debug offset La/g;->(La/e;Landroid/os/Bundle;Landroid/os/Bundle;)V: Invalid debug offset ect......

JesusFreke commented 7 years ago

Looks WAI to me, other than maybe the large number of messages in this case. An invalid debug offset is an obfuscation technique meant to exploit a bug in previous versions of baksmali, in order to prevent disassembly.

As you can see, it no longer prevents disassembly :)

ghost commented 7 years ago

Yes but application force close ???

JesusFreke commented 7 years ago

I don't see anything about a force close in your original bug description :). What is the exception+stack trace?

ghost commented 7 years ago

The long and enormous If you can test decompile then recompile Installed the application it will not launch

JesusFreke commented 7 years ago

No, I'm not installing a random untrusted apk from the web :)

ghost commented 7 years ago

Ok I'm copying the complete decompile

JesusFreke commented 7 years ago

I have no idea what that means. All I asked for was the exception and stack trace.

ghost commented 7 years ago

The application does not start And here is the logcat logcat.txt

JesusFreke commented 7 years ago

That... is not logcat. See https://developer.android.com/studio/command-line/logcat.html

Lanchon commented 7 years ago

obfuscators can add code to check the signature or other properties of the APK and FC if tamper is detected, and this has nothing to do with correctness of smali.