简体   繁体   中英

How can i copy a file in smali

I'm reverse engineering an app. I want to copy an image from res/drawable to internal storage in smali The java code is FileUtil.copyFile("android.resource://com.package.name/drawable/app_icon.png", "/storage/emulated/0/App_name/icon/");

I just want this code in smali language

I want to convert it into smali. Thanks in advance...

There is an easy option to generate Smali code from Java code:

Just use AndroidStudio, create a new App project, and paste the Java code you want to have in the onCreate method of the main Activity (or add a custom method).

Then build the APK and decompile it using Apktool or Jadx (Jadx can display for each class also the Smali code) to get the Smali code. Just copy the relevant parts out of the shown smali code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM