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

How to decompile .smali files to xml files?

I am decompiling an apk file to source code.I got all the class files but resource files are shown in smali format.How to convert this to xml files ?
Nevaeh
  • 1,519
  • 7
  • 24
  • 45
1
vote
0 answers

Possible to change ActionBarSherlock to AppCompat in compiled APK?

I have an actionbar-sherlock app, but just the APK. would it be possible to change the actionbar from sherlock to appcompat(support library) or even the normal Android 5.0 actionbar? When i decompile the app and getting the smali i could get Java…
Postback
  • 619
  • 2
  • 9
  • 27
1
vote
2 answers

set cancelable true in smali

I was reverse engineering apk file and i found that theres AlertDialog is cancelable false invoke-virtual {v0, v4}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder; (in java code it shows cancelable false) So i…
Jadeja RJ
  • 1,014
  • 3
  • 13
  • 27
1
vote
0 answers

Insert method call in smali code

I want to add the following call of method "send()" to a smali method: invoke-direct {p0}, X->send()V send() is a method of the current class. X is a wildcard for the current class name. Now i have two unresolved problems: Why does invoke-direct…
null
  • 1,369
  • 2
  • 18
  • 38
1
vote
0 answers

In modifying .smali files, Injecting some code crash at particular code point

I have a question. I'm trying to inject some code into particular code point. At almost point, Code injection were successful. But a code injection was failed at 'a' method in 'com/google/ads/e' package. The code point is between ':goto_2' and…
Ha Dongsoo
  • 11
  • 1
1
vote
1 answer

.smali invoke-virtual & invoke-super

I am trying to generate a call graph based on .smali file. However, I encountered a confusing case as follow: .super Landroid/graphics/drawable/Drawable; .source "SBarExp.java" .method public final setBounds(Landroid/graphics/Rect;)V .line 514 …
yi2ng2
  • 141
  • 2
  • 5
  • 14
1
vote
3 answers

How to return a static result in smali function

.method public c()Ljava/lang/String; .locals 3 const/4 v1, 0x0 const-string v0, "wifi" invoke-virtual {p0, v0}, Lcom/genwen/looltv/start/Appstart;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v0 check-cast v0,…
user3329615
  • 11
  • 1
  • 2
1
vote
1 answer

smali file: add one value to array

I need to add one value to a hard coded string array in my android app. Unforunately I have lost my hole code, so I decomplied the apk to smali. Can someone show me how I can add an entry between "1D" and "2A" (I added a comment to the code)? here…
Michael
  • 747
  • 2
  • 10
  • 22
1
vote
1 answer

Adding smali support for eclipse

I am trying to edit a smali project using eclipse. This should in theory allow me to use the whole java magic (opening class definitions, call hierarchies, etc) for smali, too. Is there already some kind of smali support for eclipse? As I did not…
michas
  • 25,361
  • 15
  • 76
  • 121
1
vote
1 answer

smali grammar files ".g4" for antlr4

The grammar files for smali present here are for antlrv3. I couldnt find any .g4 file for smali. How is this .g4 even created ? Is there a way to convert antlrv3 .g file to one compatible with antlrv4 ?
TheGT
  • 412
  • 8
  • 13
1
vote
1 answer

Converting .class file to smali files and packing up the .apk again

I was going through the Stack Overflow question decompiling DEX into Java sourcecode. I was successfully able to decompile the apk file, and I made some changes in the Java code. I converted them successfully to smali files so that apktool can…
1
vote
2 answers

No java imports in smali?

I was doing some experiments today in android source. Let me tell the complete thing, I compiled framework.jar from android source and decompiled it and generated smali source and kept it aside. Then from CyanogenMod repo I added the commits of a…
Varun Chitre
  • 3,050
  • 4
  • 23
  • 33
1
vote
1 answer

Confuse among smali code and dalvik bytecode specification and real hex of opcode in dex file

I defined a java class named DefineFields. It has an empty constructor. When I compile it, the hex code in classes.dex file shows like this: 7010 050C 0000 0E00 (show in little endian) after that i search the bytecode specification and i found it…
QianBin Piao
  • 271
  • 1
  • 2
  • 10
1
vote
1 answer

Android Debugging (Re-engineered APK and waitForDebugger)

I'm trying to work out methods for black box testing APKs with tools such as APKTOOL, Smali, and IDEs such as Eclipse and NetBeans. I have most of what I need - I can decompile/debug instrument/recompile/sign/align and run on a device. The problem I…
jww
  • 97,681
  • 90
  • 411
  • 885
0
votes
1 answer

Replacing/Rebuilding framework.jar in Android Source

This could be a rather crazy question, but I wanted to get some insight on it before I spend all the time trying it. Is it possible to rebuild framework.jar (like say pulling the framework.jar from MIUI), decompile it to smali and then rebuilt it…
yarly
  • 7
  • 1
  • 5