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

Add codes to smali sources

I have a smali code with the related source: original_file.java: package com.android.commands.locksettings; import android.os.ResultReceiver; import android.os.ServiceManager; import android.os.ShellCallback; import…
John
  • 165
  • 1
  • 12
2
votes
1 answer

Android Studio Debug How to view byte variable

I'm trying to debug a 3rd party app with an Android Studio. When I'm at the smali code, new-array v1, p1, I want to access p1 value. When I evaluate p1, it says p1 = byte[]@13648. After new-array v1, p1, v1 is 35. How can I see the content of p1?
Carol Ward
  • 699
  • 4
  • 17
2
votes
1 answer

How to pass imediate values in Smali Assembly language?

I have a smali code in which I want to inject a sleep function right at the beginning. To do so, I've created an app that just sleeps, generated its smali and copied into an app as the first instructions of the onCreate method and worked perfectly,…
Fnr
  • 2,096
  • 7
  • 41
  • 76
2
votes
1 answer

Can you convert a .smali into .jar

Is there a possibility to convert a smali byte code into a jar. I have tried using Baksmali to do the reverse from odex to smali but is there a way to go backwards to jar itself
Adshead
  • 107
  • 4
  • 10
2
votes
2 answers

How to use dexlib2 to instrument certain methods, especially allocating registers to add new instructions?

I'm using dexlib2 to programmatically instrument some methods in a dex file, for example, if I find some instructions like this: invoke-virtual {v8, v9, v10},…
HankZhang
  • 21
  • 1
2
votes
1 answer

React Native Multidex with smali file

Apk build with react native problem after enable Multidex and Dalvik problem with MainActivity with this Smali file. .line 25 invoke-super {p0, p1}, Lcom/facebook/react/ReactActivity;->onCreate(Landroid/os/Bundle;)V .line 26 invoke-static {},…
user6877676
2
votes
1 answer

How to set a boolean to true in smali

.line 71 invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean; move-result-object v0 iput-object v0, p0, Lcom/tadasa/tadasaful/zxs;->isTrial:Ljava/lang/Boolean; I want the isTrial to boolean True. How do I do this?
TFive
  • 31
  • 1
  • 7
2
votes
1 answer

recompile apk after using javadecompilers.com

Is there any way to recompile the APK after decompilation using javadecompilers.com ? it's a nice tool to decompile APK and have java files, but i don't know how to recompile. i tried to import the decompiled files to android studio, eclipse,…
Fariss Abdo
  • 481
  • 1
  • 4
  • 8
2
votes
2 answers

IntelliJ IDEA - Unable to evaluate the expression Cannot find source class for current stack frame

I'm debugging android application with linked correct smali sources. I'm using newest smalidea plugin. Everything goes well, breakpoint is reachable, I can see variables but I cannot see lists. Here's what I can see near List variable: Unable to…
Iks Ski
  • 370
  • 1
  • 5
  • 19
2
votes
1 answer

copy else statement to if statement

I am trying to copy the code of else state to the if statement. In here I see if-eqz as the if condition but I don't know where the else condition is here. Can someone help me find else condition so that I can copy it to become the if code also. I…
0xDEADBEEF
  • 590
  • 1
  • 5
  • 16
2
votes
1 answer

What does the following smali terminology mean?

I've been digging into some smali coded files lately and theres terminology that I just don't understand and is not explained ANYWHERE (not even in the dalvik opcodes site). Lets get started with the questions 1. What is ->? 2. What is…
GoldenAge153
  • 45
  • 1
  • 10
2
votes
0 answers

How to use org.jf.dexlib2 write or rewrite dex file?

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. And there is a demo here but I can't understand.I want to know whether dexlib2 can be used to write or rewrite the dex file DexRewriter…
Dummy
  • 21
  • 3
2
votes
2 answers

Smali multidex "has already been interned"

I am trying to rebuild a multidex (classes2.dex), however I get the following smali errors: shazaam.apk.dex2.smali\com\facebook\AdAction.smali[57,9] Class Lcom/facebook/ads/internal/action/AdAction; has already been…
joe-jeff
  • 324
  • 1
  • 9
  • 27
2
votes
1 answer

Creating an apk wrapper Android (no source code)

I'm working in some game portal catalog (kind of a PlayStore) based on a subscription model. I have a partnership with some editor that can provide me some game apks. But not their sources codes. So I have rights to modify stuff about them but I…
And Row ID
  • 169
  • 11
2
votes
1 answer

Smali: Increase number of registers

I need an additional register to store a string in a smali method. I am aware of the register logic in smali code (see https://github.com/JesusFreke/smali/wiki/Registers), but i am still wondering how to archive an increase in registers. Assuming i…
null
  • 1,369
  • 2
  • 18
  • 38