yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
just one more question : how did you run the tool ? double click ? open with java SE ? or from command line ? if from command line did you open it from the same path as the tool or from a different folder ?

Edit : looks like the reason of the name not valid bug is a result of calling the tool's jar file from a directory that you don't have write access to ,I fixed that problem it will be available in the next build
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
I will totally consider that feature ,since I don't know a single thing about squashfs and from what I read so far there is no multi-platform way to unsquash so it's gonna take some time to figure out a way to add that feature without breaking the cross platfom feature of the tool ,to sum It gonna take a while so please be patient with me :)

ps : new version is up with fixed zip name error ! enjoy my friend
[Android Software/Hacking General [Developers Only]] tetsuo55:
[MENTION=4769531]lord-ralf-adolf[/MENTION]

Thanks for your effort, i will test the zip creation later because i don't have time now
[Android Software/Hacking General [Developers Only]] levone1:
Seems like not working for me.

Xperia Z1 compact AOSP MM - after click 'deodex now', stuck perpetually at 'deoptimizing boot.out'

Any ideas? Thanks
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
please attach the log file ,find it under tools folder /logs send me the xxxxx_full.log so I can see where is the problem
[Android Software/Hacking General [Developers Only]] levone1:
Thanks. Here it is. I don't know anything, bus all it is is a list of programs. Does that mean it was working fine and I just didn't wait longest enough? It was about 10 minutes.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
ok there is no thing useful in that log ,somehow it stops after the system folder validation , what version of the tool are you using ? and what version of java are you using ? did you click on the deodexNow button ? did you tried again without luck ?
[Android Software/Hacking General [Developers Only]] levone1:
Tool version is the one in op that says 'latest version'. Java version I'll check. I did click deodex now button, and have tried again 2 more times.

Thanks
[Android Software/Hacking General [Developers Only]] levone1:
java version 7 update 80. I just saw your notice about new version. I'll give it a try...
[Android Software/Hacking General [Developers Only]] wertzPH:
some stock roms just cant be deodexed, right? in on lollipop 5.1 and im getting reboot and random stuck ups at boot logo, basically its unstable :( log doesnt seems to show errors
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
ok ,it looks like the native commands are stil hang on windows ,plus the tool was leaking files descriptors which causes TooManyOpenFiles exception I fixed all that in the new build of today + added support for squashfs roms ,I hope this will fix your problem if not please let me know
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
log doesn't show any errors ,but I wanna know how did you push the rom back to your phone ?
[Android Software/Hacking General [Developers Only]] wertzPH:
i used manual method, using twrp3's file manager to delete app, priv-app, and framework from /system then move each deodexed folder back to /system. and wipe dalvik-cache and cache before rebooting device.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
Did you set the right permissions ? Why didn't you use the create flash able zip feature ?
[Android Software/Hacking General [Developers Only]] wertzPH:
yup permissions granted. even replaced folders on the working flashable stock rom zip to properly set right set_metadata on files and flashed them in recovery..

the create zip method from your tools doesn't seem to work for me. gives me invalid filename error something.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
ok I see ,I got nothing then ,for the record the tool doesn't do any thing it just automate the deodexing process so the bootloops are not really a tool problem ,did you see the logcat from device to know exactly where the boot-up get stuck ?

ps : are you sure the zip fileName is still showing the invalid file name error ? I fixed it in the yesterday build (or at least I thought I did)
[Android Software/Hacking General [Developers Only]] wertzPH:
thanks for the reply. i will try to get my logcats later or this weekend.

keep up the great work.

thanks.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
ok , thanks for your feed back and keep me updated

if you can please confirm the zip file name error is fixed or not in version 1.10 of the tool when you run the tool again
[Android Software/Hacking General [Developers Only]] wertzPH:
oh, there's a 1.10 already? im still using 1.01-probably why i have errors. will give feedback if i can test this weekend the new v1.10.

Suggestion:

maybe you can add more information to you logs too? like windows version used, java version, tool version used etc so that you may also know if you are reviewing previous logs or latest version?

keep up the great work.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
ok , thanks and yes I will add more infos to the logs because I really need all those infos to support and fix bug reports noted and will be in the next version thanks for suggestion
[Android Software/Hacking General [Developers Only]] Rapha88:
Do you accept translation? Even if the answer is no, I would like to help pointing out that there are some small errors in en.prop
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
of course I accept translations it's even highly appreciated , if you wanna help please PM me , or email me ,you can also create pull request on github
[Android Software/Hacking General [Developers Only]] chuyennho184:
[MENTION=4769531]lord-ralf-adolf[/MENTION]: When I deodex rom with command line, I have issue like that. See my attach files. How to fix it? Thanks!
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
the tool needed more ram memory and JVM didn't allow it you can increase the amount of allocated ram memory for the tool by launching the command line tool with -Xmx JVM argument like this :

java -Xmx512m -jar Launcher.jar [program args]

Note ,512m is the minimum RAm needed my my tool ,it works better with more ram to alocate more use -Xmx*amount in mega-byte*m
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
New version is up ,All users using command line please not the arguments has change refer to the guide for more details ,enjoy my friends

remember : Hit that thanks button if you like this software !
[Android Software/Hacking General [Developers Only]] chuyennho184:
My laptop is using Windows 10 32bit with 3GB Ram. I think my laptop can process all normal tasks.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
I didn't say your laptop is the cause ,I said "the allocated memory" (Head size ) which is less than 1/4 on your laptops full memory java doesn't allow application to use more than that so unless told to by the user it self with the -Xmx*amount of memory needed*m see this answer on stackoverflow for more details http://stackoverflow.com/questions/511013/how-to-handle-outofmemoryerror-in-java
[Android Software/Hacking General [Developers Only]] levone1:
Updated Java, installed latest version, (1.2), increased memory size in Java to 2gb, and still frozen on "deoptimizing boot.oat". However, log is different... Take a look.

Thanks
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
1 / how did you increase memory to 2GB in java ? the program logs the max heap size 259522560 bytes which is : 247 mega bytes ,this is way to low for the tool deodexing boot boot.oat takes up to 512mb to fix this problem please run the jar from the command line with -Xmx512m like this

java -jar -Xmx[COLOR="Red"]512[/COLOR]m Launcher.jar

you can change 512 to a higher value to get better performances ,but the program should run just fine with 512 m allocated if less than that it will not work (this is not a bug this is a JAVA JVM thing the memory alocated is < 1/4 of all the available ram on the host machine )

2 / the log reported that the tool was under c:\Windows ,is that correct ? did you put the tool under c:\windows folder ?
[Android Software/Hacking General [Developers Only]] levone1:
1 / java control panel offers the option of alloted memory, (mentioned in earlier post), for the Java program in general. I'll try your command instead.

2 / yes, I ran it from there, since that's also my Java path. Is there a better way?

Thanks
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
I guess the java control panel didn't allocate enough memory because the reported one (in the tools log) was accurate ,I will post a quick fix for this little problem in new version it's not a big deal ,I know most people hate command line so I will make the tool allocate more memory to it self ;) (already did but didn't make a build yet )

2 / the tools location is not really important but I do not recommend putting the tool under c:/windows you can put it where ever you want even in paths with spaces and weird chars the tool can handle spaces and weird chars
[Android Software/Hacking General [Developers Only]] levone1:
You were right on with Java command. Success with AOSP MM. Thanks again
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
you're welcome ,thank you for the feed back
[Android Software/Hacking General [Developers Only]] levone1:
OK, update - I got deodex success, and flashable zip created. Zip flashes with success msg, and all apks and jars are replaced. However, oat and arm folders still there, and many apps fc. I've tried reflashing, and running 'delete.sh' file in recovery, (which runs without error), but no change. I don't want to take the time to manually remove all those folders, or manually replace all apps, but I did try manually replacing all 3 folders, which caused bootloop, (maybe just BC of app permissions, but again, I don't want to have to do each one manually). I did wipe caches after each attempt.

Any ideas?

Thanks again
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
what version of the tool did you use ? the 1.21 ? or the 1.20 ,if it is 1.20 I suggest you update and use 1.21 and test again if you already used 1.21 please attach a log file from the deodexing process and if possible one from the device
[Android Software/Hacking General [Developers Only]] wertzPH:
hi i made some test. logs posted and i have sent you PM.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
I think I found out the problem and yes the tool was the problem ,I made a mistake somehow all jars deodexed after framwork.jar will have classes2.dex and classes3.dex from framwork.jar copied into them which created boot loops ,I fix that in the new release ,if it's not much to ask please test and tell how it goes

once again thanks for your constructive feedbacks ,I wouldn't have found the problem if it wasn't for you guys thank you very much
[Android Software/Hacking General [Developers Only]] wertzPH:
quick test done. deodexed and installed. no soft reboots and random errors now. will observe this for the weekend, but so far its stable

great work at fixing the issues.
[Android Software/Hacking General [Developers Only]] levone1:
Tried again with new version. Black screen on reboot after Sony logo, so I wiped data, and rebooted, and now all apps work, (no fc), but odex files still remain. Going to try replacing folders manually and see what happens.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
you mean .odex files are still in the system folder ,or empty folders like oat and arm ?

use this script instead of the one in the zip

you can download the script from attachments and run it in your terminal or run those commands one by one in the terminal

#!/sbin/sh
busybox mount -o rw,remount,rw /system
busybox find /system/app -type f -name '*.odex' -delete
busybox find /system/app -type f -name '*.art' -delete
busybox find /system/app -type f -name '*.odex.xz' -delete
busybox find /system/app -type f -name '*.art.xz' -delete

busybox find /system/priv-app -type f -name '*.odex' -delete
busybox find /system/priv-app -type f -name '*.art' -delete
busybox find /system/priv-app -type f -name '*.odex.xz' -delete
busybox find /system/priv-app -type f -name '*.art.xz' -delete

busybox find /system/framework -type f -name '*.odex' -delete
busybox find /system/framework -type f -name '*.art' -delete
busybox find /system/framework -type f -name '*.odex.xz' -delete
busybox find /system/framework -type f -name '*.art.xz' -delete
busybox find /system/framework -type f -name '*.oat' -delete

rm -f /system/odex.app.sqsh
rm -f /system/odex.priv-app.sqsh
exit 0
[Android Software/Hacking General [Developers Only]] levone1:
Odex files were still there, (screnshot 1), but new delete script took care of it, (2). Also, after flashing zip initially, I would get 'optimizing apps' at every boot. Seems like that's better too. Thanks
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
So all problems are fixed now ? glad to hear that

All users still having issues with bootloops or (every boot android upgrade ) please download this blank_rom.zip file and replace the one in the /blanks folder of the tool by this one (see attachment) or download the new complete version with hotFix
[Android Software/Hacking General [Developers Only]] realtebo:
Just trying for the first time your tool, from commnad line.

[15:47:50][ INFO ] chosen system folder :/home/realtebo/Scaricati/miui_MI3WMI4W_6.3.10_e4ab565a90_6.0/system
[15:47:50][ INFO ]There is137 apks to be deodexed
[15:47:50][ INFO ]There is53 jars to be deodexed
java.io.IOException: Cannot run program "/home/realtebo/deodexer/re-dist/lordroid_ODTRTA_v1.22_ALL/bins/native/zipAlign/linux/linux": error=20, It's not a directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at deodex.tools.CmdUtils.runCommand(Unknown Source)

I launched your tool after building from source using

realtebo@realtebo-VirtualBox ~/deodexer/re-dist/lordroid_ODTRTA_v1.22_ALL $ java -jar Launcher.jar ~/Scaricati/miui_MI3WMI4W_6.3.10_e4ab565a90_6.0/s

What's the problem?

Also: must I zipalign? Must I re-sign?

---------- Post added at 03:56 PM ---------- Previous post was at 03:53 PM ----------

Another error, this is fatal, the execution stops

[15:52:55][ INFO ][MiDrop.apk][SUCCESS][zipaligned]
Exception in thread "Thread-419" java.lang.ArrayIndexOutOfBoundsException: 7
at net.lingala.zip4j.util.Raw.readShortLittleEndian(Raw.java:57)
at net.lingala.zip4j.core.HeaderReader.readExtraDataRecords(HeaderReader.java:471)
at net.lingala.zip4j.core.HeaderReader.readAndSaveExtraDataRecord(HeaderReader.java:420)
at net.lingala.zip4j.core.HeaderReader.readCentralDirectory(HeaderReader.java:338)
at net.lingala.zip4j.core.HeaderReader.readAllHeaders(HeaderReader.java:94)
at net.lingala.zip4j.core.ZipFile.readZipInfo(ZipFile.java:425)
at net.lingala.zip4j.core.ZipFile.getFileHeaders(ZipFile.java:688)
at deodex.tools.ZipTools.isFileinZip(Unknown Source)
at deodex.tools.Zip.addFilesToExistingZipAapt(Unknown Source)
at deodex.tools.Zip.addFilesToExistingZip(Unknown Source)
at deodex.controlers.ApkWorker.deodexApk(Unknown Source)
at deodex.controlers.ApkWorker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)

What am I doing wrong?
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
let's start from the first exception :

the first one is nothing it's there for logging even though it fails there the zipalign bin is excuted and working good see your log

[15:52:55][ INFO ][MiDrop.apk][SUCCESS][zipaligned]

the second one ,that's tricky ,I am not sure how did that happen ,it shouldn't so please can you give me the XXXXX_full.log fie to look it over ? may be the apk we were trying to add classes to have a bad zip file or a weird one

do I need to sign / zipalign ?

zipalign yes certainly ,don't zipalign if you are using some other kind of scripts that zipalign all apks on system boot or if you are planning to edit apks after deodexing them (long story short the zipalign should be the last step after all other edits or hacks )

so ,I will be waiting for the full log file because it has more information

ps : I noticed you are using Vbox ,the program run under any system (compile once run it any where ;) )
[Android Software/Hacking General [Developers Only]] Droid_Angel:
this is great ,I will test later and post the results ,let's hope it's worth it :D

thanks for you work
[Android Software/Hacking General [Developers Only]] realtebo:
I opened an issue on github because i'm unable to build against master or most recent tag. I used an old one.

realtebo@realtebo-VirtualBox ~/deodexer $ git log -n 1
commit a39c1143409bb2a6a83835e31011d2783a8339ec
Author: lord-ralf-adolf <rachidboudjelida@gmail.com>
Date: Fri Mar 11 19:15:23 2016 +0100

R : legalize , don't return null throw Exception instead

Anyway, when deodexing, I'm using this command

realtebo@realtebo-VirtualBox ~/deodexer/re-dist $ java -jar Launcher.jar ~/Scaricati/cancro/system/ zs

the 'cancro' folder is the Xiaomi ROM for MI 4

Android Version is 6.0.1

Miui Version: dev china full 6.3.3

unzipped from linux unzip 'unzip <file> -d <folder'>.

,

I attach my full log, it's full of Java exceptions. I've identical problems using GUI with same options
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
I have read your log ,some of your apks have odex files and have classes.dex in them which is weird because odex apk shouldn't have a classes.dex file in them

As a work around open the GUI version and change the compression method to J4Zip

For the other issue when building master I fixed that up 2 files were ignored by git you can build now normally

If you can give me a link of this ROM so I can run a series of test on it because it's not like all the other ROMs I have seen so far it will help me fix all those problems

Thanks and have a good day
[Android Software/Hacking General [Developers Only]] realtebo:
Is there any error in the way I launch your tool?

I need to run your tool from command line to automatize

Really nice, I'll try immediately to rebuild from master branch; we'll talk about this in the github issue

Oh, sure! Xioami Mi 4 Rom, FUll Dev China: http://bigota.d.miui.com/6.3.10/miui_MI3WMI4W_6.3.10_e4ab565a90_6.0.zip

It's freely downloadable.

Thanks and have a good day[/QUOTE]
[Android Software/Hacking General [Developers Only]] realtebo:
I'm using lastest master branch to build (now it's ok)

realtebo@realtebo-VirtualBox ~/deodexer $ git log -n1
commit e4c5025d2ad46735524b151a04d671fef7c1aea3
Merge: 463e92c 7ba90fa
Author: lord-ralf-adolf <rachidboudjelida@gmail.com>
Date: Wed Mar 16 22:51:11 2016 +0100

Merge branch 'Droid-Angel-patch-1'
fix spell errors

I downloaded this ROM: http://bigota.d.miui.com/6.3.10/miui_MI3WMI4W_6.3.10_e4ab565a90_6.0.zip

I unpacked the ROM

wget http://bigota.d.miui.com/6.3.10/miui_MI3WMI4W_6.3.10_e4ab565a90_6.0.zip
rm cancro/ -rf
unzip miui_MI3WMI4W_6.3.10_e4ab565a90_6.0.zip -d cancro/
~/Scaricati/cancro

Then I rebuilt your tool into ~/deodexer folder.

I relaunched from command line using :

realtebo@realtebo-VirtualBox ~/deodexer $ java -jar Launcher.jar ~/Scaricati/cancro/system/ sz

Again, I got a fatal Java Exception

[07:36:31][ INFO ][MiDrop.apk][SUCCESS][signed][zipaligned]
Exception in thread "Thread-693" java.lang.ArrayIndexOutOfBoundsException: 7
at net.lingala.zip4j.util.Raw.readShortLittleEndian(Raw.java:57)
at net.lingala.zip4j.core.HeaderReader.readExtraDataRecords(HeaderReader.java:471)
at net.lingala.zip4j.core.HeaderReader.readAndSaveExtraDataRecord(HeaderReader.java:420)
at net.lingala.zip4j.core.HeaderReader.readCentralDirectory(HeaderReader.java:338)
at net.lingala.zip4j.core.HeaderReader.readAllHeaders(HeaderReader.java:94)
at net.lingala.zip4j.core.ZipFile.readZipInfo(ZipFile.java:425)
at net.lingala.zip4j.core.ZipFile.getFileHeaders(ZipFile.java:688)
at deodex.tools.ZipTools.isFileinZip(Unknown Source)
at deodex.tools.Zip.addFilesToExistingZipAapt(Unknown Source)
at deodex.tools.Zip.addFilesToExistingZip(Unknown Source)
at deodex.controlers.ApkWorker.deodexApk(Unknown Source)
at deodex.controlers.ApkWorker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)

I attach my full log.

A question: in the log I read this

07:30:33][Deodexer][W] detected heap size is too low running oat2dex in a separate process ...
[07:30:33][Deodexer][E] de-optimize boot.oat using oat2dex as library ....[failed]
[07:30:33][Deodexer][I] trying to de-optimize boot.oat using oat2dex as binary ....
[07:30:33]running command : java -Xmx512m -jar /home/realtebo/deodexer/bins/oat2dex/oat2dex.jar boot /home/realtebo/Scaricati/cancro/system/LOBDTRTA/boot/boot.oat

It talks about 'heap size is too low'. I've 2 GB of RAM in the VM. Are 2GB too less?

And I've a lot of 'not found' like this:

[07:30:58][MainWorker][I]Searching for miuipushsdkshared.apk
[07:30:58][MainWorker][I]not found skip ...

I know that MIUI v7 (Android 6) is a bad dog ... but I'm not able to understand what this problems are caused from...

Thanks for your work, your tool and your assistance.
[Android Software/Hacking General [Developers Only]] lord-ralf-adolf:
The way you launch the tool is the proper way , of course zs option means sign and zipalign after deodexing if you wich only zipaligning use z only

ok , no need to change it now because I added fail safe to aapt method ,if there is already classes.dex file we will force override it ,but if you run the GUI to configure the zip method ,the command line version will use the same configuration (I will add more options to the command line version of the tool to let you configure it)

thanks ,as you may already know MI is not really like other ROMs ,I will download and test and add support for it ,I hope I will be done before the end of the day stay tuned :D

upuntil here you are doing every thing right ,great

yes this is a fatal one ,this is the method I test if the classes.dex file was added to the apk or not ,this exception is weird to be thrown ,so I will add it to the bugs and when I download MIUI and test on it I will get back to you on this one

this is not a fatal error ,it's the method I used to by Pass java heap size limitation ,as you may already know when running a java application you JAVA virtual Machine or JVM allocate a portion of memory RAM to the application this portion is less than 1/4 of the total ram on the host PC and it can't be changed at runtime so when launching oat2dex I launch it with command as a binary that way I can allocate the needed memory which is 512m (for oat2dex.jar ) ,so basically this is just for logging the process succeed either way

this is also for logging purpose only ,some roms have apks and .jar file under framework ,so for every .odex file I search if there is a matching .apk file if there is no matching apk I assume the .odex file matches a .jar file

to sum up : the real problem here is PackageInstaller.apk is the one failing because of the fatal error ArrayOutOfBoundsException ,I don't know the source of it but I will know once I test your rom on my machine

ps : the full log is tagged

a line containing "" means information message and not an error

a line containing "[W]" means a warnning message here for logging only

a line containing "[E]" means an error can be catched or can be not catched the message tells you if it is catched or not

a line containing "[EX]" means Exception message this is a catched exception and didn't break the operaions

I will get back to you as soon as I finish testing