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

[core] Multiple methods are not generated because of "Code variable not set in r1v0 ?" #775

Closed
bagipro opened this issue Nov 4, 2019 · 4 comments
Labels
bug Core Issues in jadx-core module

Comments

@bagipro
Copy link
Collaborator

bagipro commented Nov 4, 2019

Open com.ksmobile.launcher.LauncherModel, you will see that tons of methods are not generated because of error

        void mo22935a(
/*
Method generation error in method: com.ksmobile.launcher.LauncherModel.b.a(com.ksmobile.launcher.az, boolean, boolean):void, dex: classes.dex
        jadx.core.utils.exceptions.JadxRuntimeException: Code variable not set in r1v0 ?
        	at jadx.core.dex.instructions.args.SSAVar.getCodeVar(SSAVar.java:189)
        	at jadx.core.codegen.MethodGen.addMethodArguments(MethodGen.java:157)
        	at jadx.core.codegen.MethodGen.addDefinition(MethodGen.java:129)
        	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:297)
        	at jadx.core.codegen.ClassGen.addMethods(ClassGen.java:263)
        	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:226)
        	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:111)
        	at jadx.core.codegen.ClassGen.addInnerClasses(ClassGen.java:238)
        	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:225)
        	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:111)
        	at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:77)
        	at jadx.core.codegen.CodeGen.wrapCodeGen(CodeGen.java:49)
        	at jadx.core.codegen.CodeGen.generateJavaCode(CodeGen.java:33)
        	at jadx.core.codegen.CodeGen.generate(CodeGen.java:21)
        	at jadx.core.ProcessClass.generateCode(ProcessClass.java:61)
        	at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:273)
        
*/

APK: https://drive.google.com/file/d/1ITPTFbRKIvV9UlcctL-J5OcuMjaR3k8y/view?usp=sharing

@bagipro bagipro added bug Core Issues in jadx-core module labels Nov 4, 2019
@jpstotz
Copy link
Collaborator

jpstotz commented Nov 4, 2019

Are you sure you have tested this APK using the latest unstable build?
Because using the latest unstable version I don't see any Code variable not set errors in the mentioned class (the class is not fully decompiled but at least this message never occurs).

Even using full text search I am not able find any Code variable not set errors.

@bagipro
Copy link
Collaborator Author

bagipro commented Nov 4, 2019

@jpstotz
That's weird, I tried again to clone the repo and build it, issue is still reproducible. Maybe it's a regression bug, and you're using not latest build, so you don't see it?

@jpstotz
Copy link
Collaborator

jpstotz commented Nov 4, 2019

@sergey-wowwow OK, the error only occurs with show inconsistent code enabled.

com.ksmobile.launcher.LauncherModel.b is an interface and Jadx processes the usages of the method argument in the method's code. As it is an interface method this will of course fail as there is no code...

@skylot
Copy link
Owner

skylot commented Nov 5, 2019

@sergey-wowwow fixed! And that was a funny issue :)
In short: due to show inconsistent code one of the methods tried to generate code but failed with the exception which leads to class codegen restart. So, interface method first time was generated correctly but code var was not saved and this leads to an error on second code generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

3 participants