Post Reply

[MultiTool][28/5/13]ROM TOOLS v3(dex de/recompiler with extended features)

OP iamareebjamal

19th April 2013, 03:41 AM   |  #1  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Hi guys,

Here is third version of my ROM Tools PC Version (Automatic decompile classes.dex file to edit smali content). It is major release of this tool but further updates will follow.

After testing the third version on bunch of Devices successfully, here is the general release of it. This tool has been mainly constructed to decompile and recompile classes.dex of apk's and jar files without having to tediously type whole commands. However, there are few features I have added in it which in my opinion are useful bt not that much connected to dex operations.


What's New ?


Here is list of New features and detailed description of them:

Note:- No other fetaure except decompiling/recompiling will work if you have not connected your phone via USB cable and USB debugging is on.


Reboot Options:

Quote:

Reboot:

Will normally reboot the phone

Necessary when replaced some framework file or pushed a system file

Code used

Code:
adb reboot

Quote:

Recovery:

Reboot your phone in recovery mode

Necessary when thinking of flashing something and want to save time and instead of pressing a combo while phone is turned off.

Code used:

Code:
adb reboot recovery

Quote:

Hot reboot: *May not work on all phones*

Reboots your phone faster

It reboots your phone faster by just killing all system processes forcing the GUI to restart. Preferred as its fast and reliable when pushing themed files. Not recommended if doing more intensive replacing(Sometimes syetem needs rebooting normally to show changes)

Code Used:

Code:
adb shell killall system_server


Miscellaneous:

Quote:

logcat:

Quote:

1. Display logcat:

Displays logcat with v long formatting with 10000+ lines.

Easy than typing whole command. Its with formatting. Has more lines than normal command prompt display

Code Used:

Code:
adb logcat -v long

Quote:

2. Save logcat:

Saves logcat in main folder. A random prefix is added to each locat so that they do not get replaced by newer one.

Easier than typing the command. With good formatting.

Code used:

Code:
adb logcat -v long > logcat%random%.txt

Quote:

Fix permissions: *ignore errors*

Fixes permissions of /system/app, /system/framework/, system/etc/init.d

Necessary when replacing many files in system and saving time to set correct permissions. Sometimes, due to incorrect permissions, phone won't boot or scripts won't run. Very useful command to save you from these headaches.

Ignore errors because there may not be init.d folder present in your device. So it will show error for that, but all other permissions will be corrected

Code Used:

Code:
adb shell chmod 644 /system/app/*
adb shell chmod 644 /system/framework/*
adb shell chmod 777 /system/etc/init.d
adb shell chmod 777 /system/etc/init.d/*

Quote:

Reset Password: *May not work on all devices* *Ignore errors*

Resets your pin, password, pattern lockscreen

Ignore errors because it will try to delete 4 files and there will be only one correct file to be deleted based on what type of password you have set.

May not work on all devices because I have only tested it on Gingerbread Samsung devices. *Confirmed to be working on rooted mobiles only*

Code Used:

Code:
adb shell rm /data/system/gesture.key
adb shell rm /data/system/password.key
adb shell rm /sd-ext/system/gesture.key
adb shell rm /sd-ext/system/passwork.key


Screenshot:





Changelog :

Code:
Version 3

28 Ma 2013

-Added Reboot
-Added Recovery
-Added Hot Reboot
-Added logcat
-Added Fix Permissions
-Added Reset Password
-Added an ugly easter egg


Version 2

18 April 2013


- Changed it from a script to multi tool
- Added folders for convenience
- Made eye candy
- Made it noob proof
- It's like changing Baichung Bhutiya to Lionel Messi



Version 1


- Just one smali.bat file and one baksmali.bat file with one one line each of commands to Baksmaling and Smaling (duh!)
PHP Code:
I am not responsible for your device being dead
you flashing stock ROM
you using your device as a brick
or 
the decrease in love of your Girlfriend because you use your mobile so much 
What does it do?

As you are aware, there are smali files in jar files and apks you need to edit for adding 4-way boot into power menu, extending Power options, changing clock colour, adding CRT effect, changing the pop up that comes up when you touch the easter egg image, adding brightness slidebar, adding lidroid toggles, etc and so manyyyy things

In order to edit them, you need to decompile apk and classes.dex
It is not a problem in editing smali files of apk as they are decompiled itself by APK-Multitool(I use it)

But, it does not work for jar files

I know that there is smali.jar and baksmali.jar for it but I don't like repeatedly commading same operations when I can do it with one click


This program decompiles and recompiles classes.dex from any jar or apk in one click(very useful when you only need to decompile dex file only)




Pre-Requisites:-

*PC
*My Tool
*Java JDK(or JRE) (If you are running Windows 7 64 bit, you may need to add Java in environment variable)
*7-Zip (For in zip operations[pull out classes.dex])
*classes.dex file(on which you will operate)
*Android Phone to be connected to PC with USB Debugging on to use features other than decompiling and recompiling


Guide:-

1. Download my Tool.
2. Extract it in any folder.
3. Place classes.dex in the input folder. DO NOT RENAME IT.
4. Run script.bat. Choose Option 1, Decompile classes.dex . In a few seconds, there will be a prompt that it is "Done. Press anykey to continue" (Note:- If you have UAC [User Account Control] on, you may run it as administrator or it might not be able to create folder if you have extracted it in System Drive)
5. Go to decompiled folder. There will BE classout folder. Make any changes in smali in classout folder(ALWAYS USE NOTEPAD++). DO NOT RENAME CLASSOUT FOLDER.
6. Again open script.bat if you had closed it or if not, then return to the window.
7. Choose 2 option "Compile classes.dex" . A new classes.dex will be formed in output folder.
8. Enjoy


Note:- Once you change things in classout folder, and you decompile another classes.dex, previous version in decompiled folder will be deleted. So if you want backup of it, move it somewhere else
Same thing will happen to classes.dex on output folder when you compile another one.


Other options

1. Connect you phone to PC with USB Debugging on and not on USB Tethering. Make sure you aren't using adb before using the tool. If so, Go to Alt+Ctrl+Del and to Task Manager and close adb.exe process

2. Choose the option what you want.

a) Logcat, either view or save it

If you view it, a window will appear with logcat in it. If you are done, just close that window

If you save it, it will be saved in the same folder where Script.bat is present. To stop saving it, Press Ctrl+C and type Y and press Enter

b) Reboot, may take some time in rebboting and rebooting in recovery.

c) Fix permissions and Reset password

3. Try to find Easter Egg



Download:-
ROMToolsPCv3.zip
Last edited by iamareebjamal; 12th June 2013 at 05:41 AM.
The Following 60 Users Say Thank You to iamareebjamal For This Useful Post: [ View ]
20th April 2013, 03:06 AM   |  #2  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Reserved
The Following 4 Users Say Thank You to iamareebjamal For This Useful Post: [ View ]
20th April 2013, 05:07 AM   |  #3  
panda00's Avatar
Senior Member
Pandaville
Thanks Meter: 1,053
 
1,542 posts
Join Date:Joined: Mar 2013
More
Definitely easier than the "java -jar smali.jar..." command.
Thank you.
The Following User Says Thank You to panda00 For This Useful Post: [ View ]
22nd April 2013, 06:52 PM   |  #4  
Patambiz's Avatar
Senior Member
Flag Legazpi
Thanks Meter: 299
 
389 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Trying it out...
The Following User Says Thank You to Patambiz For This Useful Post: [ View ]
24th April 2013, 05:25 AM   |  #5  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Thank You all

If you have suggestions, please post them here.
25th April 2013, 08:42 PM   |  #6  
balliboxer's Avatar
Senior Member
Flag New Delhi
Thanks Meter: 5,246
 
1,352 posts
Join Date:Joined: May 2012
Donate to Me
More
Great tool .Try to make one for resources also :thumbup:

Sent from my GT-I9082 using Tapatalk 2
Last edited by balliboxer; 4th May 2013 at 05:59 AM.
26th April 2013, 02:39 AM   |  #7  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Quote:
Originally Posted by balliboxer

Great tool .Try to make one for resources.dex also :thumbup:

Sent from my GT-I9082 using Tapatalk 2

Sure

Didn't knew there were such files too
4th May 2013, 05:47 AM   |  #8  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Quote:
Originally Posted by balliboxer

Great tool .Try to make one for resources.dex also :thumbup:

Sent from my GT-I9082 using Tapatalk 2

Can you tell me which file contain these?

I searched it but did not find much

Are you talking about resources.arsc?
4th May 2013, 06:00 AM   |  #9  
balliboxer's Avatar
Senior Member
Flag New Delhi
Thanks Meter: 5,246
 
1,352 posts
Join Date:Joined: May 2012
Donate to Me
More
Quote:
Originally Posted by iamareebjamal

Can you tell me which file contain these?

I searched it but did not find much

Are you talking about resources.arsc?

Yea resources.arsc mistakenly written.dex

Sent from my GT-I9082 using Tapatalk 2
5th May 2013, 06:22 AM   |  #10  
iamareebjamal's Avatar
OP Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,731
 
3,615 posts
Join Date:Joined: Aug 2012
More
Quote:
Originally Posted by balliboxer

Yea resources.arsc mistakenly written.dex

Sent from my GT-I9082 using Tapatalk 2

Umm. That is automatically done by apktool

I did not find any way to do it separately

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Software and Hacking General [Developers Only] by ThreadRank