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

worng long value in smali editor #443

Open
ManojBhakarPCM opened this issue Jun 17, 2022 · 9 comments
Open

worng long value in smali editor #443

ManojBhakarPCM opened this issue Jun 17, 2022 · 9 comments

Comments

@ManojBhakarPCM
Copy link

decompiled with apkeasytools -

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 2
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .line 15
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 16
    const/high16 v0, 0x7f040000

    invoke-virtual {p0, v0}, Lbhakar/manoj/helloWorld/MainActivity;->setContentView(I)V

decompiled by byteCodeViewer

.method protected onCreate(Landroid/os/Bundle;)V
  .registers 4
    const/4 v1, 0
    invoke-super { p0, p1 }, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
    const/high16 v0, 32516
    invoke-virtual { p0, v0 }, Lbhakar/manoj/helloWorld/MainActivity;->setContentView(I)V

notice that 0x7f040000 is converted to 32516

i love this tool, because it shows live editing of smali. i open smali with editing in one pannel and java in second pannel. then when i edit smali, it shows java version of smali code by pressing refresh button.
you may not realise how revolutionary it is in world of modding.
i mean i do know now that where i am doing mistake in smali editing.

but this bug is a problem. recently i tried to mod a apk that had multiple resource ids in smali. after moding , there is no way saving back that to apk.
so what i did is , copied paste smali from this tool to the smali file generated by apktool so that i can recompile with one click. but code did not compile due to this error.
can anyone also add the option to replace compiled .class file in .dex file and then replace dex file with apk's dex file ?

@ThexXTURBOXx
Copy link
Contributor

This one may be harder to pin down. Which tool are you using in BCV exactly? Enjarify or Dex2Jar?

@ManojBhakarPCM
Copy link
Author

neither of them.
worng value appeares in Panel 2.
Panel 2 is set to Smali > bytecode with Editable checkbox checked.

@ThexXTURBOXx
Copy link
Contributor

You said that you opened an APK file. BCV cannot process APKs directly, but has to convert them to some other readable format beforehand.
In case I got that right, what are your settings here?
Also try switching from dex2jar to enjarify (or vice versa) in order to see if that fixes your problem
grafik

@ManojBhakarPCM
Copy link
Author

2022-06-18 19_06_40-Bytecode Viewer 2 11 2 - https___bytecodeviewer com _ https___the bytecode club

2022-06-18 19_08_21-Bytecode Viewer 2 11 2 - https___bytecodeviewer com _ https___the bytecode club

@ThexXTURBOXx
Copy link
Contributor

You did not show the relevant settings in your screenshots :)
See my screenshot for reference where to find them

@ManojBhakarPCM
Copy link
Author

2022-06-18 19_11_51-Bytecode Viewer 2 11 2 - https___bytecodeviewer com _ https___the bytecode club

@ThexXTURBOXx
Copy link
Contributor

Thanks, have you tried using Enjarify yet?

@ManojBhakarPCM
Copy link
Author

same problem with Enjarify. No Difference.
dex2jar doesnt convert to smali. it converts to jar. which has classes. whichever program converting classes to smali, has this problem. or might be it converts to smali correctly but the code it that put smali in view has the problem. IMHO.
why dont use smali and baksmali in this program ?

@ThexXTURBOXx
Copy link
Contributor

We are using smali and baksmali, but through dex2jar afaik. That's why I was asking you to do all of this :)
@Konloch any more details you could add to this?

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

No branches or pull requests

3 participants