Questions tagged [smali]

Smali is the assembly language for the Android Dalvik Virtual Machine and is based on the Jasmin Java assembly language.

Smali is the assembly language for the Android Dalvik Virtual Machine and is based on the Jasmin Java assembly language.

Smali as an assembler takes ASCII descriptions of Dalvik Virtual Machine Classes, written in a simple assembler-like syntax using the Dalvik Virtual Machine instruction set. It converts them into binary .dex class files, suitable for incorporating into an Android Package file (.apk) for execution on an Android powered device.

Questions with this tag should be specifically relating to the Android OS including decompiling, recompiling, and modifying legitimate apks . Please do NOT ask how to "hack", pirate, or otherwise work around a legitimate copy protection or licensing scheme put in place by the original developer.

See also:

  1. Smali/Baksmali Project
  2. Dalvik Bytecode Reference
  3. Jasmin
285 questions
1
vote
0 answers

why a field named "$r8$clinit" was generated in an interface in its smali code?

I have an interface A.kt like this in an Android app: interface A { fun f1(defaultValue: String): String fun f2(defaultValue: Boolean): Boolean private class B(context: Context) : A { // ... } companion object { …
Richard Hu
  • 811
  • 5
  • 18
1
vote
0 answers

How to append two Strings together in Smali language?

How to append two Strings together in Smali language? new-instance v9, Ljava/lang/StringBuilder; invoke-direct {v9}, Ljava/lang/StringBuilder;->()V invoke-virtual {v9, v5},…
1
vote
0 answers

Please help if this is a decent translation to java of smali code

After googling and trying to understand basics of smali and java, I could come up with this. Please correct me where I have gone wrong. Original code: .method public Start()Z .locals 1 const-string v0, "ABC" invoke-static {v0},…
Mtoklitz113
  • 3,828
  • 3
  • 21
  • 40
1
vote
2 answers

Why APK could not be installed after Smali patching?

Here is the TestClass and MainActivity. In order to always show the Toast, I changed TestClass constructor using smali patching to following: but after compiling and signing, the new patched apk could not be installed. where is the problem?? Here…
Mehran
  • 73
  • 7
1
vote
1 answer

How to find a java method using a string reference from a dex file

I'm using baksmali and dexlib2 library in Android Studio project. I'm trying to find a method from dex file. Inside method definition, there is a unique string in one of the method body statements. I want to find that method in the fastest possible…
Nobody
  • 13
  • 3
1
vote
1 answer

Frida call function of reverse engineered smali code (Android)

I want to call a function through frida in an apk while only having decompiled smali code. The code looks like the following: b.smali .class public final Lcom/company/a/b; .super Ljava/lang/Object; .source "" # annotations .annotation system…
pythonimus
  • 293
  • 4
  • 15
1
vote
1 answer

Smali - lots of "move-object"

I’m using mt manager to edit Smali in dex. I found that there are many move-object in some classes, most of them are unnecessary. Does it impact performance?
Ayaka_Ago
  • 89
  • 9
1
vote
0 answers

how to pass to ppatcher activity under any condition in main activity

hi iam trying to bypass login activity from an app with firebase database i think if i manage to edit main activity to get to ppatcher activity even if i didn't get auth i can use this app for self interest would that be a problem ? note i didn't…
Eslam Essa
  • 11
  • 2
1
vote
1 answer

ApkTool splits java files in to multiple files

Im using ApkTool to dessasemble DEX files from an APK to recover smali code. I have noticed that the .java file has been splitted in different files. For example: MainActivity.java -> MainActivity.smali, MainActivity$1.smali FirstFragment.java ->…
orapic
  • 23
  • 2
1
vote
1 answer

Deodexing with baksmali - missing java classes android implementation?

I'm trying to disassemble/deodex the ROM that came with my Samsung Galaxy S2 device. I'm using baksmali, But cannot get two files to do so properly, Email.odex and MobilePrint.odex. Both of them want java classes that don't seem to be included with…
Ran Sagy
  • 610
  • 7
  • 17
1
vote
0 answers

How to startForeground() service in smali code without showing notification by Android Reversing

I'm attempting to hide the Foreground notification without showing notification in android apk and the start foreground service working fine with this smali code: invoke-virtual {p0, v1, v0},…
Vicky Malhotra
  • 340
  • 1
  • 4
  • 13
1
vote
1 answer

dalvik bytecode verification - dex2oat

I have instrumented an app at bytecode level and getting the following verification error from dex2oat: 2020-09-23 19:39:04.005 4864-4864/? W/dex2oat: Verification error in int a.d.cg.b(byte[], int, int) 2020-09-23 19:39:04.005 4864-4864/?…
auermich
  • 130
  • 10
1
vote
1 answer

How to bypass iget-object method return with value

method public getPremium()Ljava/lang/String; .registers 2 .line 1 iget-object v0, p0, Lcom/myapp/android/api/models/User;->premium:Ljava/lang/String; return-object v0 .end method
PauL
  • 11
  • 2
1
vote
1 answer

Does this smali class decrypt data? what encryption is it using?

Q: Does this smali class decrypt data? what encryption is it using? I need help finding out what this code uses to decrypt the file text it receives? the encrypted text prints out as expected in a jumbled mess, is there a way to manually decrypt the…
1
vote
1 answer

Why one more parameter is passed in a method in smali code

In a piece of smali code that I decoded via apktool, I found a method call passes one more argument than these are declared in then method definition. That extra argument is definitely not used at all. But if I remove it, Error occurs when run,…
Roney
  • 143
  • 7