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
2
votes
2 answers

Interpreting and understanding smali. could someone help me translate?

i'm experimenting on my android device, trying to play with application code so i can learn it in the mean time. But i'm pretty much stuck at how to edit the smali code. It's not really that straight forward for someone who has only learn't OOP…
Scott_yers
  • 31
  • 1
  • 4
2
votes
1 answer

App not installed error on Android Device

I am trying to "reverse engineer" an android app, whatever you want to call it. Anyways, I change the apk to a .zip then I get the classes.dex file, get the smali files, alter one smali file, then convert back to dex and put it back into the zip,…
2
votes
2 answers

android dalvik verification error: register1 v1 type 0, wanted ref

I have been learning how to code smali files, and i had created a certain method which takes a string parameter and puts it in the log.Its java equivalent is something like this: public void log(String param){ Log.d(param, param); } And…
gkapagunta
  • 188
  • 1
  • 11
2
votes
1 answer

Dalvik operation for Thread.sleep()

Dalvik operation for Thread.sleep(100); is produced like below: invoke-static {v2, v3}, Ljava/lang/Thread;.sleep:(J)V It's a static method and takes one argument but two given: v2 and v3. Isn't it strange? Does anyone have an idea about this…
Ricardo Cristian Ramirez
  • 1,194
  • 3
  • 20
  • 42
2
votes
1 answer

Add Tapit to an APK made with GameSalad using smali?

Just to clear up my question a little more, what I need to do, is implement Tapit SDK to an android APK made by GameSalad. I know mostly the entire process already, and my only problem is getting the ad to show. To give you a quick run through of my…
JoeyMaru
  • 212
  • 1
  • 3
  • 10
2
votes
2 answers

Why the number of registers indicated in the invoke-kind/range instruction not matching with the number of argument types?

in the following example bytecode: invoke-virtual/range {v0 .. v5}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V The range of registers indicates registers v0,v1,v2,v3,v4,v5,…
monica
  • 1,035
  • 1
  • 9
  • 21
2
votes
1 answer

Is invoke-direct really invoking the methods that are defined in the instantiated object?

I have some test code, which is a ConcreteClass inheriting the AbstractClassForInterface1. In the generated smali code for the constructor of ConcreteClass: # direct methods .method public constructor ()V .locals 0 .prologue …
monica
  • 1,035
  • 1
  • 9
  • 21
2
votes
1 answer

smali (Android): Operating on an Instance Variable

i'm trying to do the following using smali: add a private instance ArrayList field to a class instantiate the instance field in the class' constructor do an add operation on the field in one of the class' methods. These are the relevant code…
Edwin Lee
  • 3,540
  • 6
  • 29
  • 36
2
votes
1 answer

Decompiled Java from APK - while loops that do nothing

I decompiled an apk and see many while loops that return immediately only to be followed by other code: while (true){ return; if (!cond1){ continue; } if (cond2){ continue; } } If you wanted to produce this code in a…
Error 454
  • 7,255
  • 2
  • 33
  • 48
1
vote
0 answers

how to calculate the number of fields in the smali file?

Need to calculate the number of methods and variables in the smali file, not through dex. How? It's better to use Python language, please I simply calculated the number of .field in the smali file and found a significant difference from the actual…
lhq
  • 11
  • 3
1
vote
1 answer

Smali: methods to return true using sget-object

I've tried to implement the suggested line that I got from here, but it didn't work and the app crashed. This is the original code: .method public final getHasDrawn()Ljava/lang/String; .registers 2 iget-object v0, p0,…
user516076
  • 61
  • 5
1
vote
0 answers

App crash on rebuild without any change using apktool and apklab

I am trying to rebuild apk after decompiling using apktool and apklab but app crash on splash screen. Following exceptions occur in logcat Error updating last accessed time for {Google Sans, wdth 100.0, wght 400, ital 0.0, bestEffort false}.…
1
vote
0 answers

What alternatives do we have for Smalidea to debug smali code on Android?

I'm trying to debug some low level smali code on Android Studio and the alternative I found is this plugin for Android Studio but some things in it doesn't work very well, for example: In the middle of debugging, if I press F9 so it continues until…
Fnr
  • 2,096
  • 7
  • 41
  • 76
1
vote
1 answer

Getting all class references from dex file in an efficient way

I am trying to find an efficient way for getting all classes references from a dex file. I have tried several solutions, but I want to generalize it while also maintain efficiency. The expected result is having a list of class names which are being…
tamirda
  • 13
  • 4
1
vote
0 answers

What is the java code to repackage by modifying the apk's smali code?

I'm trying to make a tool in java code that automatically triggers all events in android market app. To do this, after decompiling the apk file, I try to slice all the events and add them to one main method. But I don't know how to repackage the…
kgg
  • 11
  • 2