[Fix] Mobile Hotspot Hack Reposted for OTA 4.24.651.1 - EVO 4G Android Development

I didn't write this hack, but it appears to work with the new stock GB update.
I did edit the script and zip archive so it wouldn't need any external exe's or libs to apply. Just copy the newest framework.jar file to the script directory and run the HackHotspot.bat file. Then simply run these ADB commands from a dos window.
------
adb shell
mount /system
exit
adb push framework.jar /system/framework.jar
-------
clear Dalvik and fix permissions if desired
Reboot Phone
Done!

Much appreciated but way over my head (I've never done anything with ADB). Any chance of getting this, and the USB debugging notification fix, in a flashable form?

The debug fix is the one that doesn't display the statusbar icon when connected?
I'll see what I can do for ya

townsenk said:
Just copy the newest framework.jar file to the script directory and run the HackHotspot.bat file.
Click to expand...
Click to collapse
Awesome script. Thanks.

will this work for the revolutionary?

CAn i do this on a MAC?....
Can n e one verify that this works?

im getting errors in the script:
Code:
Extracting framework.jar
7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03
Processing archive: framework.jar
Extracting META-INF
Extracting META-INF\MANIFEST.MF
Extracting preloaded-classes
Everything is Ok
Folders: 1
Files: 2
Size: 65651
Compressed: 12413
Unpacking classes.dex
Can't find the file classes.dex
Putting HotspotHack into place
The system cannot find the path specified.
The system cannot find the path specified.
0 file(s) copied.
Repacking classes.dex
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Cannot find file or directory "out/"
at org.jf.smali.main.main(main.java:173)
Could Not Find C:\AddHotspotHack\classes.dex
The system cannot find the file specified.
Updating framework.jar
1 file(s) copied.
classes.dex : no such file or directory
Cleaning up...
Could Not Find C:\AddHotspotHack\classes.dex
The system cannot find the file specified.
Done if no errors listed above!
C:\AddHotspotHack>
and shouldnt it be
adb push framework.jar /system/framework/framework.jar

Related

32b dream->sapphire script (updated 20th august, new feature!)

So, as the title says a simple bash script to convert a dream rom to a sapphire rom.
To make this work you need unpack / repack boot img utilities from here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
testsign.jar from here:
http://forum.xda-developers.com/showpost.php?p=4008431&postcount=15
mkbootimg from here:
http://forum.xda-developers.com/showpost.php?p=3387504&postcount=26
since I'm a nice guy I've included these in the attached zip file.
extract the attached zip file into a folder (warning: make sure there's no spaces in the folder name!!) then run:
Code:
./convert.sh your_dream_rom.zip
this will:
extract the boot.img from the zip
unpack the boot image
rename init.trout.rc to init.sapphire.rc
repack the boot image
put the boot image back into a copy of the dream rom zip
NEW!! in v3: add anything in the 'addin' folder into the zip (see below)
resign the new zip
you'll be left with your_dream_rom-sapphire.zip which should (hopefully) work on the sapphire.
v3: new addin folder. Anything in this folder will be added to the resulting zip, overwriting if needed. So if you want to replace (for example) /system/etc/AudioPara4.csv just put the file in /addin/system/etc and it will automagically be merged in.
Deicist said:
So, as the title says a simple bash script to convert a dream rom to a sapphire rom.
To make this work you need unpack / repack boot img utilities from here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
testsign.jar from here:
http://forum.xda-developers.com/showpost.php?p=4008431&postcount=15
since I'm a nice guy I've included these in the attached zip file.
You'll also need to compile the mkbootimg executable that (I think!) comes with the android source.
extract the attached zip file inot a folder then run:
Code:
./convert.sh your_dream_rom.zip
this will:
extract the boot.img from the zip
unpack the boot image
rename init.trout.rc to init.sapphire.rc
repack the boot image
put the boot image back into a copy of the dream rom zip
resign the new zip
you'll be left with your_dream_rom-sapphire.zip which should (hopefully) work on the sapphire.
attached is a zip file containing everything you need except mkbootimg, since that needs to be compiled for your system.
Please note, I don't have a compiled copy of mkbootimg for my system, so I haven't been able to try the full process... but extracting and repacking the zip works, signing seems to work... and it's a pretty simple script so I can't see why it wouldn't work.
Enjoy!
Click to expand...
Click to collapse
Thanks! Do I need a boot.img and wlan.ko for pvt32A if I want it to work?
it won't work for 32a, but I'm sure you can mod the script to add in a new boot.img and radio thingy.
updated initial post with new attachment:
added mkbootimg to zip file
changed script slightly.
in case anyone was wondering, I tried this script on Drizzy's "superlight hero" rom from the dream forum and it worked perfectly.
[email protected]:~$ /home/ubuntu/Desktop/a/convert.sh Personal.zip
unzip: cannot find or open ./Personal.zip, ./Personal.zip.zip or ./Personal.zip.ZIP.
/home/ubuntu/Desktop/a/convert.sh: 3: ./unpack-bootimg.pl: not found
rm: Entfernen von „boot.img“ nicht möglich: No such file or directory
mv: Aufruf von stat für „./boot.img-ramdisk/init.trout.rc“ nicht möglich: No such file or directory
/home/ubuntu/Desktop/a/convert.sh: 6: ./repack-bootimg.pl: not found
cp: Aufruf von stat für „./Personal.zip“ nicht möglich: No such file or directory
zip warning: name not matched: boot.img
zip error: Nothing to do! (update.zip)
/home/ubuntu/Desktop/a/convert.sh: 9: java: not found
rm: Entfernen von „./boot.img-ramdisk“ nicht möglich: No such file or directory
rm: Entfernen von „boot.img-kernel.gz“ nicht möglich: No such file or directory
rm: Entfernen von „boot.img-ramdisk.cpio.gz“ nicht möglich: No such file or directory
rm: Entfernen von „update.zip“ nicht möglich: No such file or directory
Click to expand...
Click to collapse
What do i wrong ... ?
No idea, according to the error message it says it can't find 'Personal.zip'... is that file present in the same directory as 'convert.sh' ?
yes it is ...
can anyone convert this boot.img ... so that i can use on 32b?
you need to actually change directory to the directory containing the utility to run it.
try:
cd /home/ubuntu/Desktop/a/
./convert.sh Personal.zip
is ist possible that it doesn't work because i'm using the live cd now?
now it says
Archive: ./Personal.zip
inflating: ./boot.img
kernel written to ./boot.img-kernel.gz
ramdisk written to ./boot.img-ramdisk.cpio.gz
472 blocks
extracted ramdisk contents to directory ./boot.img-ramdisk/
472 blocks
sh: mkbootimg: not found
repacked boot image written at ./boot.img-ramdisk-repack.img
zip error: Nothing to do! (update.zip)
Click to expand...
Click to collapse
but mkbootimg is in this directory
This is what I end up getting. I ended up using a precompiled binary of mkbootimg for OSX since it didn't work on my Linux box.
./convert.sh NewVision_2.8.zip
Archive: ./NewVision_2.8.zip
inflating: ./boot.img
kernel written to ./boot.img-kernel.gz
ramdisk written to ./boot.img-ramdisk.cpio.gz
extracted ramdisk contents to directory ./boot.img-ramdisk/
usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]
[-F archive] < name-list [> archive]
cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]
[-I archive] [-F archive] [pattern...] [< archive]
cpio -p [-adlLmuvV] destination-directory < name-list
repacked boot image written at ./boot.img-ramdisk-repack.img
updating: boot.img (deflated 1%)
Exception in thread "main" java.lang.UnsupportedClassVersionError: testsign (Unsupported major.minor version 50.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Hello,
MarcoNieddu said:
extracted ramdisk contents to directory ./boot.img-ramdisk/
472 blocks
sh: mkbootimg: not found
Click to expand...
Click to collapse
You have to modify the script repack-bootimg.pl at line 19 :
replace : system ("mkbootimg ...
by : system ("./mkbootimg ...
Note the ./ before mkbootimg
Scargoll.
Got everything working.
1. Add ./ to the repack script before mkbootimg
2. make sure you have a 32bit OS, as the binary provided was compiled for it. I made an Intrepid machine on my VM server.
3. Use the latest version of Java. Even Karmic Koala Ubuntu doesn't have it. The class file in the jar was compiled with a very recent version of Java, so you'll error out since the jre version isn't equal to or above whats needed. You can simply do "export JAVAHOME=pathtojava" if you don't want to keep that version permanently.
4. Have fun!
Bugfixes:
removes boot.img when script is done
added ./ before mkbootimg (sorry!)
the provided mkbootimg *should* work on a 64bit machine, it does on my 64 bit arch linux box...as with all things linux though, YMMV.
I ve tried to convert a dream rom but it didn't work, does this method can be applied from a windows command shell ?
EDIT: can I take a dream rom, flash it, and push a boot.img from a hero 32B rom ?
EDIT2: Ok now that I have read the name of the topic I understand it wont work in windows. So here's my new question...
Is there a way to adapt this script (or to create something similar) so it works with windows ?
updated with 'addin' feature
ElChouch said:
Is there a way to adapt this script (or to create something similar) so it works with windows ?
Click to expand...
Click to collapse
A windows version would be great!
Nice work Deicist. Thanks for sharing.
some facts:
- i'm running Windows 7 RC (64-bit)
- i installed Cygwin and executed it as administrator
- i browse out to the correct folder where the rom zip file is located
i get the following errors. any suggestions?:
$ ./convert.sh modaco_hero.zip
unzipping...
./convert.sh: line 3: unzip: command not found
unpacking boot image
./convert.sh: ./unpack-bootimg.pl: /usr/bin/perl: bad interpreter: Permission de
nied
moving trout to sapphire
mv: cannot stat `./boot.img-ramdisk/init.trout.rc': No such file or directory
repacking boot image
./convert.sh: ./repack-bootimg.pl: /usr/bin/perl: bad interpreter: Permission de
nied
re-zipping
./convert.sh: line 12: zip: command not found
rm: cannot remove `boot.img': No such file or directory
Addin files found....
./convert.sh: line 18: zip: command not found
Re-signing zip (this may take a while)
tidying up
rm: cannot remove `./boot.img-ramdisk': No such file or directory
rm: cannot remove `boot.img-kernel.gz': No such file or directory
rm: cannot remove `boot.img-ramdisk.cpio.gz': No such file or directory
all done
Make it work on Fedora
Was having problems with this script working at the java part on a FC10 box.
Was able to get it to work by installing java-1.6.0-openjdk:
Code:
$ yum install java-1.6.0-openjdk
just posting that here in case anyone who needs it stumbles by.
Thanks for your great script Deicist
I'm getting this error. What am I doing wrong?
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
at java.lang.Class.initializeClass(libgcj.so.90)
Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:testsign.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.90)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.Class.initializeClass(libgcj.so.90)

[Tutorial] How to Deodex Lollipop System Files - One by One

Hey guys,
I write this tutorial to help guys deodex individual apps and not all apps or not to do batch deodex.
There are few good tools to Batch Deodex Roms but I found one by one tutorial which was not properly framed...
Though the credits goes to the creator of the tool.
I dont take any credits for that tool and here I just write up a tutorail on how to do it.
Step by Step Tutorial:
- First of all download this zip file of the tools required for the process - Link
- Now, extract the files of the zip to any folder.
- Head over to the directory you extracted the tools. It will contain many files such as baksmali, smali, 7zip etc..
- Now press Shift+Right Click and select Open Command Window Here.
- Now just copy the apk and the .odex.art.xz and odex.xz files in that directory.
- Now in command prompt type the following commands.
Note: Replace * With the name of the apk. (If you dont get it see the Post #2 for eg)
Code:
7za x *.odex.xz
Code:
oat2dex.bat *.odex
Code:
oat2dex.bat *.odex temp.dex
Code:
java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
Code:
java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Code:
7za u -tzip *.apk classes.dex
Now, the apk you initially coppied is now dexoded. Now you can use that apk the way you want
See post #2 for example
Reserved
Example:
Say I want to Deodex SystemUI for any lollipop rom.
Then, I would do the following
Code:
7za x SystemUI.odex.xz
Code:
oat2dex.bat SystemUI.odex
Code:
oat2dex.bat SystemUI.odex temp.dex
Code:
java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
Code:
java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Code:
7za u -tzip SystemUI.apk classes.dex
The apk is now deodexed successfully. Enjoy!
hey mate, any chance you can upload a few small .apk files and matching .odex.xz files?
ive got a few test to run for a tool i made but cant because i dont have any android 5.0 devices

Lollipop APK deodexing [commandline][scripts]

Lollipop deodexing
Deodexing apk's on lollipop is almost as simple as API < 21 and only invoves two extra steps.
The workflow for the new deodex process is as follows below. The <arch> is the architecture for the apk being deodexed.
oat2dex boot system/framework/<arch>/boot.oat
oat2dex <path/to/app/<arch>/app.odex> system/framework/<arch>/odex
baksmali as normal
smali as normal
The actual behind-the-scenes info
ART changes things with its 'Ahead of Time Compiling'. Android creates a boot.oat on boot containing the classpath jars that apks
link against for functionality. Before these the .odex for the classpath was compatible with baksmali/smali, but due to changes with
ART vs Dalvik this is no longer the case now. The classpath needs to extracted from the boot.oat. The resulting dex/ and odex/ are then
used to create a bootclasspath that can be used to create a baksmali/smali compatible odex, by essentially deoptimizing it. Once
the compatible odex is created, baksmali and smali can be used like normal - even allowing smali edits to exisiting APKs.
A working (manual) example
To get started you will need to pull the framework directory off the device.
Code:
mkdir framework
cd framework
adb pull system/framework
The next step is to pull the app's folder from system/app or system/priv-app.
For this example I will be using SecSettings2.apk from a Samsung Galaxy S6.
Code:
mkdir SecSettings2
cd SecSettings2
adb pull /system/priv-app/SecSettings2
The next step is to determine the architecture of the apk to be deodexed. This is done checking whether the directory that the
apk's folder contents were extracted to contains an arm or arm64 folder (32-bit or 64-bit, respectively).
The SecSettings2.apk is 64-bit as its folder contains an arm64 folder.
Once the architecture is determined, the next step is to extract the classpath from boot.oat. Replace arm64 with arm below
if your app is only 32-bit.
Code:
oat2dex boot framework/arm64/boot.oat
This will extract the classpath from the boot.oat and place the dex and odex into separate directories in framework/<arch>.
Now the classpath can be used to create a compatible odex that baksmali and smali is compatible with. Note that the result odex
will have a .dex extension. This is NOT to be placed into the apk as the app will NOT work.
Code:
oat2dex SecSettings2/arm64/SecSettings2.odex framework/arm64/odex
We now have a odex (labled SecSettings2.dex in SecSettings2/) that is compatible with baksmali and smali.
To baksmali the odex:
Code:
baksmali -a 21 -x SecSettings2.dex -d framework -o smali/SecSettings2
To deodex the smali into a dex:
Code:
smali smali/SecSettings2
The last command outputs a classes.dex that is going to go into the apk.
Code:
zip -gjq SecSettings2 classes.dex
Now we need to remove the arm or arm64 folder from the apk's location on the device.
Code:
adb shell su -c 'mount -o remount,rw /system'
adb shell su -c 'rm -rf system/priv-app/SecSettings2/arm64'
Now we simply need to push the apk to the device, fix permissions, and reboot.
Code:
adb push SecSettings2.apk /data/local/tmp/
adb shell su -c 'dd if=/data/local/tmp/SecSettings2.apk of=/system/priv-app/SecSettings2/SecSettings2.apk'
adb shell su -c 'chmod 644 /system/priv-app/SecSettings2/SecSettings2.apk'
adb reboot (You may need to wipe data depending on the app being deodexed)
That's it. Happy modding
But I have made it easy for ya.....
deodex-app makes it stupid simple to deodex an apk from the device by running one command
Code:
./deodex-app SecSettings2.apk
That's it. The script will determine the apk's location in system, check if it's already deodexed, pull the neccessary
files to perform the deodexing, and will push the apk back to the device and reboot.
/lazydev
Huge credits to @JesusFreke for baksmali and smali, and credit to @svadev for the updated oat2dex

Smali/Baksmali

Hey guys I'm wondering if someone could help me setup smali/baksmali on linux.
I downloaded the jar. Put the jar, the odex file, and the folder containing my framework files inside the same folder opened a command window inside that folder.
But when I try to call baksmali with
java -jar baksmali-2.2b4.jar -x LGEIME.odex -d ddt -o outclass
I get an error saying -x is an unknown command.
Thanks for any help anyone can provide.
Figured out the new smali/baksmali has new commands. Haben't had to deodex anything, but have smalied a dex file.

[Guide] Enable Signature Spoofing on S7 Edge

**Root access required**
**Rom should be deodexed**
Download Tingle-Master
1. Install JDK & Python 3
2. Reboot PC
3. Extract framework.jar from system/framework and place it in the input directory. Double Click main.py
4. Take modded framework.jar from output directory and replace it with the one in your phone at system/framework
5. Reboot your phone.
6. Done
TheMaanda said:
**Root access required**
**Rom should be deodexed**
Download Tingle-Master
1. Install JDK & Python 3
2. Reboot PC
3. Extract framework.jar from system/framework and place it in the input directory. Double Click main.py
4. Take modded framework.jar from output directory and replace it with the one in your phone at system/framework
5. Reboot your phone.
6. Done
Click to expand...
Click to collapse
How do i go about deodexing android 5.1? I have a full firmware upgrade dump as well as the ability to unpack and edit the boot.img. my end goal is stock rom with microG compatability
Tried this under Ubuntu 18.04. Result:
Code:
$ python ./main.py
MENU
1 - Patch file from a device (adb)
2 - Patch file from the input folder
> 2
*** OS: Linux 4.15.0-58-generic (linux)
*** Mode: 2
*** Working dir: /tmp/Tingle-vl7r7T
*** Decompressing framework...
DEBUG: Decompressing framework.jar
*** Disassembling classes...
DEBUG: Disassembling framework/classes.dex
Exception in thread "main" org.jf.util.ExceptionWithContext: framework/classes.dex is not an apk, dex, odex or oat file.
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:186)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:78)
at org.jf.baksmali.main.main(main.java:292)
Traceback (most recent call last):
File "./main.py", line 404, in <module>
smali_folder, dex_filename, dex_filename_last = find_smali(smali_to_search, "framework/")
File "./main.py", line 346, in find_smali
disassemble(dir+filename, out_dir)
File "./main.py", line 315, in disassemble
subprocess.check_call(disass_cmd)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/java', '-jar', '$PROJECT_DIR$/tingle-master/tools/baksmali.jar', '-lsx', '-o./smali-classes/', 'framework/classes.dex']' returned non-zero exit status 1

Categories

Resources