[Utility][Tool]baksmali/smali - Android Software Development

- What is baksmali/smali?
smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.
- Author of the tool
JesusFreke
- Why we need it?
Android apk and jar files will include java classes to execute certain functionality. With baksmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).
Since we have apk manager, do we still need this tool?
Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.
- What does this tool do?
Simply it baksmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).
- Will it affect apk and jar original signature?
No, it will preserve original signature.
- Got problem?
During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.
- What are the steps to work with this tool?
Run Baksmali_tool.bat file, this will create all needed folders in the first run.
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, push it to your device by option #3 if it was system apk or jar; and if it was non system apk file, install it by option #4.
- Latest stable version
Latest stable baksmali/smali version: 2.2.2 (30.10.2017)
baksmali v. 2.2.2 - Download (bitbucket.org)
smali v. 2.2.2 - Download (bitbucket.org)
baksmali/smaly previous versions - Download (bitbucket.org)
- Latest beta version
Latest beta baksmali/smali version:
- Changelog
baksmali/smali wiki and changelog (github)
- Where can I download latest source code?
You can visit
baksmali/smali source page (github)
and you can download the latest smali and baksmali code versions.
- Special Thanks to XDA Portal Team
Special thanks to XDA Portal Team for featuring this utility
XDA Portal Team
..

hi m8,
thanks for this nice tool
will try it next time I make a new theme
sent from my G-Note

great work majd keep it up

no credit to the author of smali/baksmali? :/

iBotPeaches said:
no credit to the author of smali/baksmali? :/
Click to expand...
Click to collapse
I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP

majdinj said:
I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP
Click to expand...
Click to collapse
Yes, thats the same person. I'd just put JesusFreke, as thats his username.

Version 1.1 is online

version 1.2 is online
some bugs fixed

Grate dev, Great tool...tnx majdini:fingers-crossed:

What a great idea to simplify life ^^.
Thanks majdinj.

majdinj said:
Backsmali / Smali Manager​
What is Backsmali / Smali?
smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.
Why we need it?
Android apk and jar files will include java classes to execute certain functionality. With backsmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).
Since we have apk manager, do we still need this tool?
Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.
What does this tool do?
Simply it backsmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).
Will it affect apk and jar original signature?
No, it will preserve original signature.
Got problem?
During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.
What are the steps to work with this manager?
Run Backsmali_tool.bat file, this will create all needed folders in the first run..
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, just rename it to its original name and push it to your device; don't forget to fix permissions as well.
If backsmali and smali code are outdated, what to do?
Just visit codes owner page, and download the latest smali and backsmali code versions and put them in "tools" folder (make sure to rename them to baksmali and smali without version number)
Future development?
Feel free to report any bugs or suggestion to improve upcoming releases :good:
Download
- Backsmali-Manager_v1.2 @ 11/June/2013 (The most recent one)
- Backsmali-Manager_v1.1 @ 7/June/2013 (old)
- Backsmali-Manager_v1 @ 6/June/2013 (old)
Change-log:
@ 11/June/2013 (v1.2):
- Fixed bug of file path in Read Log option.
- Fixed number 10 file that was not shown in Set Current-file option.
@ 7/June/2013 (v1.1):
- Deleting the folder and file in project and finish folder of same project name before backsmali or smali (no more overlapping :fingers-crossed.
- Added Read log file functionality in the main menu.
- Ability to open classout folder after backsmali.
- Ability to open finish folder after smali.
- Ability to renamed finished modded file to its original name.
- Neat smali and compression processing (i.e, hidden processing ).
- Fixed set Current-file option to visualize only apk and jar files.
@ 6/June/2013 (v1.0):
- First release of Backsmali / smali manager
Click to expand...
Click to collapse
i don't know how to start editing this smali file

badagila said:
i don't know how to start editing this smali file
Click to expand...
Click to collapse
Editing smali means to modify your jar or apk file to do certain new function, check the second thread in my signature in OP... you will find a lot editing tutorials of smalis of some android apps :laugh:

majdinj said:
Editing smali means to modify your jar or apk file to do certain new function, check the second thread in my signature in OP... you will find a lot editing tutorials of smalis of some android apps :laugh:
Click to expand...
Click to collapse
ok dude thanks

Hi, your work is featured here: http://ajqi.com/baksmali-smali-manager-windows-tool/
Keep it up!

VERY NICE!
Good Work..
I dont know much about smali backsmali.. but one confusion..
Is this tool also applicable if the files (apks or jars) we want to modify are odexed?

OJ said:
Good Work..
I dont know much about smali backsmali.. but one confusion..
Is this tool also applicable if the files (apks or jars) we want to modify are odexed?
Click to expand...
Click to collapse
No, actually classes.dex are made from the odex files.
If files are odexed, then there will be no classes.dex in apks or jar files. That's why it won't be applicable then

Version 1.3 is online
Change log:
- Added adb push finished file to device system partition (for system files).
- Ability to choose whether to reboot device after pushing files to device.
- Added adb install finished apk (for non-system files).
- Adjustable Java heap memory size.
- Adjustable finished file compression level.
- Updated Smali and Backsmali codes (date 15/6/2013).

@ 23/June/2013 (v1.4):
- Added Pull apk or jar From Android Device to the main menu.
- Added zipaligning process during Smali (better RAM management).
- Fixed apk installing process (added signing process step for installing apk process).
- Added direct link to this xda page in update option.
- More script polishing...

@ 29/June/2013 (v1.5-FINAL):
- Fixed adb remount bug for some ROMs in push option.
- Baksmali argument is updated; now you can choose whether to baksmali with x argument (retain .line, .parameter, .prologue, and .local) or b argument (remove .line, .parameter, .prologue, and .local).

Hi,
i've XP&Backsmali / Smali Manager v1.5 and i want baksmali framework.jar but i got error message(attachment)
I think wrong is slash (should be a backslash)
the same error is after i select 1(baksmali*)and then x and Y or
--------------------------------------------------------------and then b and Y
*baksmali or backsmali?

Related

[UTILITY] Manila 3D Kitchen [BETA, with rhodium manila support]

Hi!
There a lot of kitchens avaialable for ROM building. Now this one is to ease TouchFlo3D building.
This kitchen uses the knowledge and works of 6Fg8, D-MAN666, xboxmod, chainfire and many others who are involved in Manila hacking.
If you use this kitchen and/or any of the decompiled scripts then be so kind and share back the source code of your modified scripts too!
This kitchen (v1.5) has the following utilities included:
6Fg8's mode 9 editor (v3.3.0.1)
sztupy's mode9 converter (v1.0)
chainfire's CFC compressor (v0.46)
MKT: a tool for batch converting/compressing/compiling mode9,qtc,png,xml,lua files (v1.1)
LuaDec (2.0)
A work in progress lua and xml IDE
And various other tools
In the center of this kitchen stands MKT aka manila_kitchen_tool, which is like 'make' but for manila kitchen developement.
It has the following functionality:
split hased _manila files back to their original filenames
join a bunch of files in a directory back to their hashed form
mass decompile mode9 files back to xml and save their lua scripts
mass convert qtc files to/from png files
mass compile lua files
It works like 'make' in sense that only the modified files will be recompiled/recompressed so after the firts setup it might be ideal for manila development.
The output of the kitchen was tested with the Rhodium manila (WVGA version) on a HTC raphael device and it works, so this project is no longer a prototype, but is still considered beta stuff
Kitchen set up
I uploaded a complete Rhodium2 Manila kitchen in case you want to use that as a base (download both the kitchen and the rhodium files, then copy them to the same directory), but of course you can use any other manila pakcage you get across. To set up the kitchen copy the package into the 'pkg' directory then run:
Code:
mkt split
to split the hashed files back into their filenames. (For this conversion it uses the same table as m9editor uses.)
You will get a "bin" directory. This will hold all "compiled" stuff, so here you will find all the files that don't need more preprocessing, and can be hashed/installed to the device
Next you want to get some editable files out from the luac, mode9 and qtc files, so use:
Code:
mkt -x bin frommode9
To decompile mode9 files back to XML (it will also extract the scripts out of the package)
Next:
Code:
mkt -c d,qp fromqtc
or
mkt fromqtc
Will convert all qtc files to png files. (the first type will work on cfc compressed qtc files, the second will work on non cfc compressed files)
After this only the scripts are remaining. Unfortunately these can't be decompiled easily, so grap the decompilation of someone (like me ), and put these files into the "insrc" directory. After this run
Code:
mkt -d insrc -o src split
so all the hashed _manila files will be converted back to their original filenames to ease searching through them.
After this you're ready with your prepared kitchen. These things were already done with the Rhodium manila so you might use that package to start manila modding.
Compiling
You can use tomode9, compile and toqtc commands to compile these files back to their binary counterpart. Alternatively you can use:
Code:
mkt -c pq,c,p make
to run this three command after each other. It's like a Makefile, so it will only compile things that have changed. Of course you might want to 'make all':
Code:
mkt -a -c pq,c,p make
This will build all files from the "src" directory into the "bin" directory
Creating the package
After you're done you can use
Code:
mkt -o outdir join
to hash all files from the bin directory back to hashed form, and put it into the 'outdir' directory. Next add the binaries and you're ready to flash
Alternatively I included createpkg that will create a cab package from the OEM apckage found in the 'pkg' directory
Download and other stuff: http://winmo.sztupy.hu/manilakitchen.html
Sounds great! Downloading now. Thanks sztupy!
Yeah, good job sztupy, this will be a great addition.
nice...gotta buy a bigger house...so many kitchens
pcarvalho said:
nice...gotta buy a bigger house...so many kitchens :d
Click to expand...
Click to collapse
roflcopter
pcarvalho said:
nice...gotta buy a bigger house...so many kitchens
Click to expand...
Click to collapse
what you need is a microwave
sztupy said:
Missing functionality / bugs:
Embedded decompiled scripts can't be re-embedded into mode9 files automatically (this would need a command line mode9 editor
Click to expand...
Click to collapse
I can help you out with that. Not that it's already done but copying the relevant parts from m9editor together isnt the big deal.
6Fg8 said:
I can help you out with that. Not that it's already done but copying the relevant parts from m9editor together isnt the big deal.
Click to expand...
Click to collapse
I hoped so
unfortunately it's hard to tell a command line tool where to inject the scripts... An XML export/import function would be cool (export it to XML, without the binary scripts, then add the decomp'd scripts, and the importer would do its job esolving everything), but I know that won't be possible until you resolve the mode9 files completely...
sztupy said:
I hoped so
unfortunately it's hard to tell a command line tool where to inject the scripts... An XML export/import function would be cool (export it to XML, without the binary scripts, then add the decomp'd scripts, and the importer would do its job esolving everything), but I know that won't be possible until you resolve the mode9 files completely...
Click to expand...
Click to collapse
hm, didnt do much with xml, but i think i can figure that out. mode9 is almost done, there's only one bytegrave at the end of a mode9 file still unknown to me.
6Fg8 said:
hm, didnt do much with xml, but i think i can figure that out. mode9 is almost done, there's only one bytegrave at the end of a mode9 file still unknown to me.
Click to expand...
Click to collapse
your visualization of the m9 files look like xml, that's why I thought about that (but yaml could be a good serializator too). But this is just an idea, if you can tel me an easy way to tell a command line script where to inject a script that would be fine
And a command line CFC compressor is also needed
sztupy said:
your visualization of the m9 files look like xml, that's why I thought about that (but yaml could be a good serializator too). But this is just an idea, if you can tel me an easy way to tell a command line script where to inject a script that would be fine
And a command line CFC compressor is also needed
Click to expand...
Click to collapse
mode9 is basically binary XML, so i had no choice
The easiest way (at least for me) is byte positions just kidding ...
I'm on vacation next week, maybe i'll get struck by an ocean of light while skiing on one of the wonderful austrian mountains
CFC compressor .... I've that lying around somewhere here, shouldnt be a problem to adapt it.
an ambitious project... thank you
nice work great addition
Scripts update addon with the newest decompiled stuff.
Kitchen is now tested and considered BETA. Also added a great new tool: MKT to the kitchen. Read first post.
sztupy said:
Kitchen is now tested and considered BETA. Also added a great new tool: MKT to the kitchen. Read first post.
Click to expand...
Click to collapse
Just downloaded kitchen and getting ready to start playing. Just wondering, will this make a installable cab file for rhodium manila for touch pro? Of course with vga adapted files. I've noticed that previous attempts of making a cab for it have failed, but oem packages work when cooked in. I'm making a theme, which shouldn't require a full install, but would be nice to know.
showaco said:
Just downloaded kitchen and getting ready to start playing. Just wondering, will this make a installable cab file for rhodium manila for touch pro? Of course with vga adapted files. I've noticed that previous attempts of making a cab for it have failed, but oem packages work when cooked in. I'm making a theme, which shouldn't require a full install, but would be nice to know.
Click to expand...
Click to collapse
I tried to install it as a cab on NATF's ROM I'm using, and it worked flawlessly. It might break on a stock ROM though. The whole convert to cab thingy is alpha currently, but hopefully it will be solved.
sztupy, So how do you go about fixing the main function? I have the LUA file I've been working on done except for the main function and all the Q16.16 instances. But looking at the src.lua file, it appears chunks of the main are scattered throughout the file. Literally, I have code parts at the beginning of the file, in the middle and at the end of the file.
That's how the luadec output that you ran for me (because luadecguess was inaccurate) outputted the decompile.
So I'm stuck because I'm not sure how to proceed with fixing it. What do you do, just leave it where it's at and search for what it's referring to and fix it where you find it? Or do you cut/paste (move) it at the top of the src code in the order it's supposed to be in?
EDIT: never mind, left the code where it was and just searched out and fixed what it referenced. Other then the Q16.16 lines, everything is good.
Hi sztupy. Excellent work. Im poor and unemployed so although Id like to, I cant donate any cash at the moment. I like this project enough to offer body parts though, if any of yours fail
EDIT - bug report removed. was related to luaconv.exe. moving to another thread.
smotrs said:
sztupy, So how do you go about fixing the main function? I have the LUA file I've been working on done except for the main function and all the Q16.16 instances. But looking at the src.lua file, it appears chunks of the main are scattered throughout the file. Literally, I have code parts at the beginning of the file, in the middle and at the end of the file.
That's how the luadec output that you ran for me (because luadecguess was inaccurate) outputted the decompile.
So I'm stuck because I'm not sure how to proceed with fixing it. What do you do, just leave it where it's at and search for what it's referring to and fix it where you find it? Or do you cut/paste (move) it at the top of the src code in the order it's supposed to be in?
Click to expand...
Click to collapse
You can consider every function in the file as a value. It's just like a number or a string in this case, because in the main body you assign functions to some variables. So if you find something:
Code:
SomeStuff = function(foo)
lots of stuff
lots of stuff
lots of stuff
end
SomeOtherStuff = function(bar)
lots of stuff
lots of stuff
lots of stuff
end
Then in the main body this will translate to:
Code:
SomeStuff = funtion1
SomeOtherStuff = function2
And in the disassemlby to something like this:
Code:
R0 := Function(f1)
SomeStuff := R0
R0 := Function(f2)
SomeOtherStuff := R0
And of course the definitions of these functions will be put after the main body (just as with any other inlined function, the only exception is that compare/luadec and the other tools I made will handle these functions separately to ease decompiling). So if you have to fix the main body you have to only look at the part of the script which is not in a function...end body

What software do I need to decompile a apk?

I need a program to decompile a apk for cm7, to make a rom and my question is what program do I need? from already thank :laugh:
frixed said:
I need a program to decompile a apk for cm7, to make a rom and my question is what program do I need? from already thank :laugh:
Click to expand...
Click to collapse
Try this guide: http://forum.xda-developers.com/showthread.php?t=1989533
you mean like extracting the files from apk file...........you can always use 7zip or winrar
it will extract the file in it like as if unzipping any file.....there you will find the xml files and any media and metadata folder dont know what else
you can use ApkMultiTool to decompile, edit, sign and install apks
apktool & the likes will generate smali code, which is a real mess. Here's how you should proceed to get readable java sources from an apk (for educational purposes only!)
Use apktool only to extract the /res folder from an apk
Extract the classes.dex from your apk (either with an archive manager or in terminal with the following command) :
Code:
unzip yourapp.apk classes.dex
Download dex2jar, put your classes.dex in the same folder and cd to it, then :
Code:
bash d2j-dex2jar.sh classes.dex
Download JD-GUI, put it in the same folder as dex2jar & classes.dex and cd to it, then :
Code:
./jd-gui classes.dex.dex2jar.jar /[COLOR="Green"]/or whatever the generated .jar file's name is[/COLOR]
This will open the jd-gui IDE with all the java sources of your apk, hit source/export all sources (or something like that, I don't remember exactly)
Add the /res folder you extracted with apktool to the /src folder you extracted with dex2jar/jd-gui and import the whole thing as existing Android code into Eclipse
There you go, you now have a full eclipse project out of an apk, the decompilation might have generated a few errors in the code during the process though, you'll need to fix them to be able to rebuild the apk.

[TOOL][GUI][Reverse engineer] Decompile APK to JAR Full Decompile :: One Click

Reverse engineer "Perfect software" , managed to convert apk to a jar file and decompile it using JD(via dex2jar)
The program uses 3 tools (apktool.jar, dex2jar.bat, jad.exe)
I've updated all lib/scripts ,apktool.jar 1.5.2, dex2jar 0.0.9.15
in attach you will find
Fragment.apk I've tested with this tool and works fully !!,look on OutPut_Fragment.zip to see the result
Download:
DeCompileAPK.zip
To Start
Works on Windows7/8
1. Scan dir for “apk” file or look for the file with “APK File Directory”.
Scan has a “subfolders” flag ,in the “Options” tab.
2. Double click on the found file it will be transferred to the “APK File Directory”.
3. Write or look for the output directory. Leaving this line empty will put all
the project output files under the directory “OutPut” where this program is executed.
If there is an output directory name, a directory “OutPut_” + APK file name
will be created.
3. Press the Decompile KEY.
4. All Dos messages will be seen in the “Decompile OutPut” panel.
5. It will be shown also in the “Edit log” panel.
6. The log can be edited and printed.
7. A java file editor is included. Scan project files, Scan any directory or open any file.
NOTE : USE ONLY ENGLISH CHARACTERS FOR FILE NAMES !
Credit and Thanks !
Tool Dev Website: http://www.limelect.com/android/
Reversed for new stuff
anyone tell us how it works with him?
codexc said:
anyone tell us how it works with him?
Click to expand...
Click to collapse
no download link to test

[SCRIPT] Quickly Convert *.java To *.smali Code

Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Nice bro :thumsup:
Thank you very much. This is exactly what I need
Thanks for the information..
I would like you to help me with this issue since I do not want to work the conversion
it not work
where is the converted smali jfile?
Hello.
I click the right button of mouse and click the Convert to*.smali.
But I didn't the converted file.
could you lend me a hand?
vaibhavpandeyvpz said:
Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Click to expand...
Click to collapse
Can you please update this. I tried running it on windows 10 and after that I don’t see the right click convert to smali
It's not working on Windows 10....Any updates on it?

[Tutorial] How to XML edit System apks without breaking Animations in Stock ROMs

There are already many tutorials and tips for editing Android XML files. However everything I tried resulted in choppy System Animations in Stock Motorola ROMs. It's most obvious in drop-down menu animations. This information is based on working with Android 6.0 Stock, however should apply to all previous versions of Android. Also this tutorial may be applicable to other Motorola phones - different generations of Moto E / G - Moto X / Z etc.
Requirements:
(*) Latest Apktool (v2.2.0 confirmed working)
(*) 7zip or alternative capable of exploring apk contents
(*) Notepad++ (if using Windows)
(*) Java 7 (JRE 1.7) or newer​
Sections:
(i) XML files in /res/xml (below)
(ii) XML files in /res/values (post #2)​
(i) XML files in /res/xml
Example #1: framework-res.apk
Step 1 - Install framework-res
apktool if framework-res.apk​
Step 2 - Decompile framework-res
apktool d framework-res.apk​
<edit files in /res/xml with Notepad++>
Step 3 - Build new framework-res.apk
apktool b framework-res​
Go to /framework-res/dist and find the new modified apk. DO NOT PUT THIS APK IN YOUR ROM OR ON YOUR PHONE.
Instead, you now need to extract (using 7zip) from this new apk - the modified file(s) in /res/xml - to a folder. These xml files will be encoded so cannot be viewed in Notepad++.
Next open the original (unmodified) framework-res.apk with 7zip and browse to /res/xml. Delete the files you want to replace. You can now drag and drop the modified xml files into the original apk and you are done.
Note: You may need to cleanly install the ROM on your phone with the modified 'original' framework-res.apk already included.
The above instructions should apply when editing the /res/xml/ files of any system apk, however always begin with Step 1.
(ii) XML files in /res/values (These files when encoded are contained within resources.arsc)
Example #2: SystemUI.apk
Step 1 - Install framework-res
apktool if framework-res.apk​
Step 2 - Decompile SystemUI
apktool d SystemUI.apk​
<edit files in /res/values with Notepad++>
Step 3 - Build new SystemUI.apk
apktool b SystemUI​Go to /SystemUI/dist and find the new modified apk. DO NOT PUT THIS APK IN YOUR ROM OR ON YOUR PHONE.
Instead, you now need to extract (using 7zip) the new resources.arsc from this new apk to a folder.
Next open the original (unmodified) SystemUI.apk with 7zip. Delete the resources.arsc and drag and drop the new resources.arsc extracted from the new apk into the original apk and you are done.
Note: You may need to cleanly install the ROM on your phone with the modified 'original' apk already included.
The above instructions should apply when editing the /res/values/ files of any system apk, however always begin with Step 1.
FAQ:
Why would I want to edit XML files?
This is a very easy way to recreate the Android experience in your own vision. Almost every aspect of Android can be changed via XML editing, from how it appears to how it behaves or functions. This tutorial / thread will not be explaining how to do any of that.
I get some error messages when using Apktool.
The following error messages can be ignored:
W: Config flags size > 52. Size = 56. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: string-mcc204-mnc4-ERR0
W: Config flags size > 52. Size = 56. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: array-mcc204-mnc4-ERR1
W: Config flags size > 52. Size = 56. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: bool-mcc204-mnc4-ERR2​
Nice job, I was having issues while replacing a recompiled Settings.apk from RR, with this tutorial I got it working.
is there any code that enable "show arrow key while typing"?
tutul2336 said:
is there any code that enable "show arrow key while typing"?
Click to expand...
Click to collapse
I stated in the FAQ not to ask questions like this. But, a google search suggests this is not a feature you can simply enable / disable in Stock Motorola ROMs. Your question is too vague, does not specify a ROM nor in exactly what form / placement the arrows would appear.
SwiftKey appears to support / or once did support this feature: (But again, it's not obvious if this is what you mean)
https://support.swiftkey.com/hc/en-...-arrow-keys-in-SwiftKey-Keyboard-for-Android-​

Categories

Resources