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
1 answer

How to set numerical values to integer classes in smali

I'm editing some smali code in which I need to change the value of a certain currency parcel awarded as an achievement entity in a game. .method public writeToParcel(Landroid/os/Parcel;I)V .locals 0 invoke-static {p0, p1, p2},…
GoldenAge153
  • 45
  • 1
  • 10
1
vote
1 answer

Increase / Use / Modify smali registers

Background: We have a code, in which we are trying to insert some debug logs. We need two extra registers per method to enable these logs. What we have tried so far: 1) Increasing registers - Did not work as registers > v15 are breaking the code.…
alchemist
  • 1,081
  • 12
  • 17
1
vote
1 answer

Change the color of a string in Smali language (Android)

I need help from an expert in Smali language. I need to change the color of a string with public Id of 0x7f0f0042 in the program below. The reason for this is that I'm building a theme for an android application. How can I achieve this? Here's the…
Badboy
  • 151
  • 1
  • 6
1
vote
1 answer

is # symbol allowed in the name of a smali file?

like aux#.smali. this file name was created when i was using the baksmali.jar on the class.dex. is this is related with the any class property.(i.e if class is final then this issue come.). if it is then how at run time it will access by the code…
user5031843
1
vote
1 answer

How to return a static result in this smali code

.method private a()Landroid/content/Intent; .locals 5 .prologue .line 297 :try_start_0 iget-object v0, p0, Lcom/myapp/c/f;->b:Lcom/myapp/context/ApplicationContext; iget-object v0, v0,…
user3548321
  • 523
  • 2
  • 8
  • 18
1
vote
1 answer

Decoding and Rebuilding an App using Smali

I've generated a small test app consisting just of onCreate(). I can install it on my emulated Nexus 7 via adb install just fine. However, decoding it using apktool decode and rebuilding via apktool build -c (-c to copy signature) yields an apk that…
1
vote
1 answer

Editing framework.jar in android

I'm trying to modify framework.jar. My purpose is to modify the contents of SQLiteDatabase.java inside this jar. I've googled this quite a lot, and found that the way is to edit the .smali file and repackage and pushing the updated jar to the…
gaurav jain
  • 3,119
  • 3
  • 31
  • 48
1
vote
0 answers

Smali File Syntax

I am trying to get the value of a StringEntity. In the Java source the StringEntity is declared as this.se = new StringEntity("SomeValue") The Value is encoded via a different function after it has been declared. Now I don't have the full source…
Potman100
  • 151
  • 1
  • 10
1
vote
1 answer

Smali type cast to primitive type

I get the following dalvikvm verifier error: Line 1041: W/dalvikvm( 2610): VFY: register1 v5 type 13, wanted 5 Line 1042: W/dalvikvm( 2610): VFY: rejecting opcode 0x70 at 0x0032 Line 1043: W/dalvikvm( 2610): VFY: rejected…
joe-jeff
  • 324
  • 1
  • 9
  • 27
1
vote
1 answer

Putting additional library code to framework.jar

My APK is to big (to many methods) and as a solution I am trying to put some of the library classes (e.g. android/support/v4) to framework.jar. I pull framework.jar, extract the classes.dex, baksmali, add then android/support/v4, smali, build a new…
joe-jeff
  • 324
  • 1
  • 9
  • 27
1
vote
1 answer

smali - error copying double parameter

I'm fairly knew to using smali, so apologies if this is a beginners question. I am using Apktool to turn an apk file into smali, with the aim being to insert logging calls into the code. To do this, I have incremented .locals by one (to add a new…
westie
  • 13
  • 3
1
vote
0 answers

Change checkbox/list default-value in smali

I'm trying to change default-values in Settings.apk. At first I added "android:default value" (0=right, 1=centered) to status_bar_clock_style.xml without success.
1
vote
1 answer

Smali best place to inject code

I am making a python script to add a trace to each method to be able to get a runtime method call in logcat. My application crashes all the time, don't ask me to copy you the error log because that is not the point of my question. Actually I try to…
aress31
  • 340
  • 5
  • 20
1
vote
1 answer

Compiling snapchat with apktools fails to install

Alright, so I have a problem with decompiling apks with apktools. I am currently trying to edit the current version of snapchat so that I can have unlimited caption length without root. To do this I decompiled the apk with apktools, edited the smali…
GrapeSoda3
  • 583
  • 1
  • 7
  • 17
1
vote
1 answer

Smali byte format- what does the "t" mean?

I'm working on understanding some smali code and I'm trying to understand a variable declaration. The code is: .field protected static final VARIABLE_NAME:B = 0x16t I understand the variable must be a byte, but what does the "t" mean afterwards?…
Patrick Xu
  • 15
  • 2