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

Extracting all API calls from .smali files in android apk

I want to extract all API calls from an Android application's apk. I have used apktool to get the smali code files from the apk. Manually I can spot some API calls, but I need an automated method. For example, I can see the getNetworkInfo call in…
Zainab Abaid
  • 43
  • 1
  • 5
4
votes
5 answers

convert odex file to dex file

I would like to covert odex file to dex file. I already pulled framework folder from system. I tried the following command, java -jar baksmali-2.1.2.jar -d system/framework -x temp.odex but error was produced - error message is like below. Error…
임선빈
  • 61
  • 1
  • 1
  • 5
4
votes
1 answer

Smali code vs Java source code when reverse engineering an android app

I'm just looking at android reverse engineering tutorials and I notice that most of them are modifying the smali code instead of the actual java source code after apk has been decompiled, is there a reason for this? Any help is appreciated. Thanks
Rockyxz
  • 45
  • 5
4
votes
1 answer

understanding invoke-kind/range argument word count

I'm having trouble understanding the structure of invoke-kind/range opcode, Syntax invoke-kind/range {vCCCC .. vNNNN}, meth@BBBB Arguments A: argument word count (8 bits) B: method reference index (16 bits) C:first argument register (16 bits) N…
Kikapi
  • 369
  • 1
  • 2
  • 11
4
votes
1 answer

Smali function: Return an Integer

I know how to return a TRUE boolean from a function: .locals 1 const/4 v0, 0x1 return v0 Now I need to return an integer (10000 value). How?
runs
  • 95
  • 2
  • 7
4
votes
1 answer

looking for a parser for smali files

It exist a parser for the .smali files? Let me be more explicative: i need to code a program. the input of this program is a .smali file.this program ( thanks to the parser i'm looking for ) should catch every time a global variable is…
Fujitina
  • 129
  • 1
  • 2
  • 16
4
votes
1 answer

What does "L", "[" and ";" mean in smali code?

I'm trying to get a deep understanding of smali language. I found a page talking about opcodes online, but it never talks about these special symbols, which is L, ; and [, e.g invoke-static {v2, v3},…
daisy
  • 22,498
  • 29
  • 129
  • 265
4
votes
1 answer

Modifying existing methods in Smali

I've been looking at a simple method in smali (coming from Android here), and any I was wondering how I'd do something simple to it, such as return false. I've been trying to understand it from comparing with the Java counterparts to some examples…
whitfin
  • 4,539
  • 6
  • 39
  • 67
3
votes
0 answers

Smali: modify methods to return True

I've been struggling reverse engineering an apk for a few hours and now I think I'm stuck. I have a few methods to modify in order to always return True. For one I managed to simply set a constant an return it but for these ones I can't wrap my head…
Pablo
  • 138
  • 7
3
votes
0 answers

Modify Android Java source code and repackage to APK file

I decompiled an Android APK using Jadx-GUI to view the Java source code. I want to modify the application, but the only way to do that is to make changes to the smali code and repackage the files into an APK via apktool. I currently have made some…
hbdch
  • 103
  • 6
3
votes
1 answer

Questions about using the smali library

I have a smali file and I want to know how to convert the smali file into an org.jf.dexlib2.iface.ClassDef object via the smali library. I have an idea now: The dex file of the smali file will be obtained by the baksmali.disassembleDexFile() a…
李启初
  • 31
  • 1
3
votes
1 answer

How to set boolean to false in methods in Smali code

There is only one boolean that I need to set to false. This value is then returned when this method is called. But I have no experience of Smali so I need help. I decompiled apk to both java code (to know what to look for) and Smali (to edit and…
Shahbaz Talpur
  • 315
  • 4
  • 17
3
votes
1 answer

Smalidea plugin in Android Studio

I deal with Android reverse engineering at my school. I want to try this plugin: https://github.com/JesusFreke/smali/wiki/smalidea I use the last version of A.studio and Win7. I went with the guide on Github (Debugging an application) up to point 5.…
woodpecker
  • 53
  • 1
  • 5
3
votes
1 answer

invoke-virtual vs invoke-direct in constructors

I'm working on performance monitoring system, which could inject its routines into existing assembly. For that, I'm trying to understand how dalvik code works. Here's an illustration of what I'm trying to accomplish. Input class could look like…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
3
votes
1 answer

Custom Settings to Fire off Shell Script

So, I am working on a "custom settings" app for my android phone, and I am in need of a little help here.... Here's what I'd like to do... I'd like to be able to set a Preference in the /res/xml/file.xml that on tap fires off a shell script based on…
Kevin
  • 2,684
  • 6
  • 35
  • 64
1 2
3
18 19