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

Java to Smali instruction converter

I need to convert this instruction in smali code: Uri uri = Uri.parse("http://www.google.com"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); I want modify an application and I…
antoniodna87
  • 11
  • 2
  • 6
0
votes
1 answer

Smali - Undeclared static method

After compiling a certain apk and going through the smali code I stumbled upon this line in file com/name/name/r.smali: invoke-static {v1, v0, v2}, Lcom/name/name/p;->a(Ljava/lang/String;Ljava/util/List;Lcom/name/name/CallbackI;)V name is a…
NotGI
  • 458
  • 9
  • 21
0
votes
1 answer

Smali Unsigned short value out of range

> UNEXPECTED TOP-LEVEL EXCEPTION: org.jf.util.ExceptionWithContext: > Unsigned short value out of range: 92519 at > org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116) > at >…
ManDongI
  • 21
  • 4
0
votes
1 answer

How to do localization in smali files?

I have an app on forein language and I want to traslete it fully for example in the smali file I have this programming code: const-string v1, "Hello" How I can add reference to the string.xml file from this smali code?
0
votes
2 answers

How to call Smali in Java

I want to use Java to smali plugin, but I have to compile Java to class first, this is impossible for project like this The h.m is Javac don't understand this, but I just want to compile this java code to class, so I can convert it to smali. This…
wener
  • 7,191
  • 6
  • 54
  • 78
0
votes
0 answers

android.view.InflateException: Error inflating class FlowLayout

I've this problem with a Launcher3 customization method, resulting in an error inflating FlowLayout. Edit: Full Stacktrace: E/AndroidRuntime( 8596): FATAL EXCEPTION: main E/AndroidRuntime( 8596): Process: com.android.launcher3, PID:…
0
votes
1 answer

How can I override system time

I thought this should be be simple enough, but I can't figure it out. For testing purposes, I want to set an exact output in the function below. For example, I want V2 (wide) to equal 1349333576093 everytime. Normally, I would just put a line…
Raz Razman
  • 391
  • 2
  • 3
  • 14
0
votes
1 answer

How to use org.jf.dexlib2 get instructions’ byte code in a dexfile

I want to get the instruction's byte code,but this code can only get the opcode's byte code.Such as 0x38 01 FB FF means if-eqz v1, -0x5.I can only get 0x38 means if-eqz ,but I don't know how to get 0x01 FB FF which means v1, -0x5 for (ClassDef…
Dummy
  • 21
  • 3
0
votes
1 answer

Issue with smali code

Let's assume the following sample code public static int addition() { int result = 1; for(int i = 1; i < 10000 ; i++) result = result + i; } and the corresponding smali code (0002 is next to the if-ge): const/4 v0,#int 1 move v1,v0 const/16 v2,#int…
Nils
  • 1,705
  • 6
  • 23
  • 32
0
votes
1 answer

Running .dex file (written in smali) in Dalvik vm turns out to have a Verification Error

This 'HelloWorld' adds two numbers and prints out the answer .class public LHelloWorld; .super Ljava/lang/Object; .method public static main([Ljava/lang/String;)V .registers 5 .parameter .prologue const v0, 0x2 const v1, 0x4 …
walter
  • 89
  • 1
  • 11
0
votes
1 answer

Moving classes to multidex in existing APK

I am trying to move some frameworks from classes.dex to classes2.dex (MultiDex) from an existing APK. To do so I use smali. It seem it works for some apps and for some not: D/dalvikvm( 1401): GC_CONCURRENT freed 258K, 24% free 13896K/18268K, paused…
joe-jeff
  • 324
  • 1
  • 9
  • 27
0
votes
0 answers

Unknow encryption type?

So Im trying to view this modded apk's smali files, and as of the new update they encrypted the strings. I don't think its base64 because it doesn't translate correctly. All the folders, and important string names are changed to unicode characters.…
0
votes
1 answer

Method to add a trace in smali

I did a smali class with only one method so far to add a logcat trace to any method. I can compile and launch the app but the method prints nothing. I have one local parameter which is a simple tag for logcat this local paramater is v0, I get it…
aress31
  • 340
  • 5
  • 20
0
votes
1 answer

Android smali edition : Set jpeg quality?

Hello devs around here. Recently I modified a port of ColorOS Camera to make it work on my device (Xiaomi Mi4). Actually this app works pretty well with only XML editions. But the thing that sorts out is that this app uses default android jpeg…
0
votes
1 answer

what is relationship between Android and lua and SMALI languages?

I have noticed that some of the android applications as containing Lua scripts and bytecode. I think Android can under Java Davlik bytecode or native calls. How it can load lua scripts (.lua files) and lua bytecode (.o) at runtime ? Why the…
surya
  • 65
  • 2
  • 7