yashsingh1/xdaforums huggingface dataset:
[Galaxy S 5 General] svadev:
Too few info ...
[Galaxy S 5 General] AxAtAx:
lol using this version:

Ver 3.5 sva 32b -

Changelog (v3.2) from 02/07/2015:

1. Fixed copy folders without .apk, like mcRegistry to result folder (app, priv-app)

2. New oat2dex.jar v0.83 with full support Android 5.1.1 (thanks @_riddle) and with last smali/baksmali

trying to deodex G900T FOF6 5.1.1

[FONT=&quot]getting this error:

[/FONT]

[FONT=&quot]architecture (arm, arm64, x86, x64, mips, mip64) not defined

when I pick the system directory to convert.

[/FONT]
[Galaxy S 5 General] svadev:
Specify, please, the directory structure of /system folder
[Galaxy S 5 General] AxAtAx:
My apologies, I was trying to deodex a directory that I already had converted, I feel stupid, and it is working now, again, I am brain dead.:D

EDIT: Problem solved.
[Galaxy S 5 General] kliu888:
After run through deodexing, no errors were reported but nothing was actually deodexed. All the apks were just copied from original directory without the .odex files. Nothing was changed at all. What am I doing wrong? Thank you.

Here is the output:

32-bit Deodexer for Android Runtime (Version 3.5 ?? 20/07/2015) © Valery Studenikin, 2015

Path to stock /system directory: C:\Temp\system

Android 5.0.2: SM-T800, LRX22G.T800ZSU1BOD1, changelist 4609383, Wed Apr 1 22:31:04 KST 2015

Processor architecture: \arm\

Files deodexed succesfully: 127, with errors: 0. CPU time: 00:00:47 (47.210 sec.)

List of originally deodexed (within stock firmware) files, are left as they were originally:

/system/app/Books.apk

/system/app/Chrome.apk

/system/app/Drive.apk

/system/app/FactoryCamera_FB.apk

/system/app/Gmail2.apk

/system/app/Hangouts.apk

/system/app/KnoxAttestationAgent.apk

/system/app/KnoxSetupWizardClient.apk

/system/app/Maps.apk

/system/app/minimode-res.apk

/system/app/PlayGames.apk

/system/app/PlusOne.apk

/system/app/SCParser.apk

/system/app/SecurityLogAgent.apk

/system/app/secvisualeffect-res.apk

/system/app/SwitchKnoxI.apk

/system/app/SwitchKnoxII.apk

/system/app/YouTube.apk
[Galaxy S 5 General] Mohamed Yaser:
Cant deodex Android 5.1.1: Nexus 5, LMY48B

Attached Log
[Galaxy S 5 General] carl1961:
[MENTION=5133670]kliu888[/MENTION]

the files that get deodexed or in your SVADeodexer folder, SVADeodexer does not touch your original system folder, you have to manually delete the odexed and replace with the deodexed from the SVADeodexer folder
[Galaxy S 5 General] SpasilliumNexus:
Use Java 8. Worked flawlessly here for Nexus 5's LMY48B.
[Galaxy S 5 General] ADM!RAL:
nice tool [MENTION=6242674]svadev[/MENTION]

just one question please could someone explain whats next to be done ?

i have note pro 12.2 p905 which lacks developers sadly :(

hope someone could help

thank you!
[Galaxy S 5 General] svadev:
My Toolkit is intended only for deodex firmware.

And you should know what you're doing.
[Galaxy S 5 General] ADM!RAL:
Oh i understand you mean it's not for me

Thx for the reply tho

Keep up the good work man [emoji106]
[Galaxy S 5 General] Hilda.I:
5 star rated and thanked most of your posts although I don't use deodex ROM, but if it make it so easy to make one

but if you please copy the lib folders ( empty or not ) so one can replace the folder directly

thanks in advance for make it so easy
[Galaxy S 5 General] The Sickness:
Delete
[Galaxy S 5 General] stang5litre:
Hi I just used this awesome tool and got no errors what so ever great job!!!!! I do have a question though what do i do with the folders odex and dex? Thanks in advance Great work
[Galaxy S 5 General] svadev:
Nothing. It is working folders. Simply delete it .
[Galaxy S 5 General] Blackball:
hi,

i cant check the three boxes app,priv-app and framework with 3.5

Windows 7 64bit

does it work only with Samsung Devices ?
[Galaxy S 5 General] Raccoon_NL:
How to get the files on my phone

Hi everyone,

First let me say I am a noob, yes I am. I have used Odin to flash a new rom and that's about it.

I am trying to get my Galaxy S5 deodexed so that I can install xposed framework. I was redirected to this thread for information on how to deodex.

First I don't get how you get your system folder to your pc. Tried adb pull command and that somehow messed up my phone. Got errors of apps not working any more and my physical buttons also stopped working. A factory reset did not help so I used Odin to flash the original rom. Working fine now btw.

New approach: I extracted the system.img.ext4 file from the original Samsung rom and then extracted all the files inside it. Got a folder named "system" with all the usual files. I used your program to deodex and got no errors. All went well. But now I have to get these new files onto/inside the system.img.ext4 file or onto my phone somehow.

Can anyone help me? Either I replace the original files inside the system.img.ext4 file with the deodexed ones and then use Odin again to flash the altered rom (if that works), or I somehow replace them directly ( maybe using an update.zip) with the ones on my phone.

Does anyone have a clue or a hint for me on how to do this?

I work on a windows computer and have Ubuntu 14 on vmware.

Thanks in advance.
[Galaxy S 5 General] carl1961:
you replace the original's these also best to install as a custom rom
[Galaxy S 5 General] stang5litre:
Ok I have a serious concern about this tool.. I have ran this tool over 7 times and the tool actually takes random apks out. For example took alarm clock out .... why would it be taking apps away instead of deodexing? I counted 16 apks that were totally deleted and are needed for functions to work properly on the phone it self.

any help would be greatly appreciated. Just trying to start off with a perfect base with everything working before i mod it up.

Thanks again

stang5litre
[Galaxy S 5 General] bernardwu:
how do I extract my /system folder from my stockrom ???? please specify that too for noobs

EDIT: I got through extracting system folder and I ran SVADeodexerForArtx64 and now I got a bunch of folders : apps, dex, framework, odex, priv-app.

the question is which folder to use and how do I install these deodexed files to my phone?
[Galaxy S 5 General] carl1961:
that is a BIG question, it requires removing the odex file from where your system folder is and swaping them with the deodexed, apps, framework, priv-app and installing would require a rooted Phone with a custom Recovery and also using the Meta-INF from a known custom working ROM for your phone, so you will have to learn how to do that.

Like previous post stated

dex, odex or not used, there just folders used while SVADeodexerForArt did the deodexing
[Galaxy S 5 General] tdunham:
This is not for newbies as [MENTION=3271517]carl1961[/MENTION] already stated pretty much. ;)

That would require you have a full FLASHABLE & bootable odexed rom already in place. Simply put, all the files & folders from the odexed build are replaced with the deodexed files to convert the odexed build to deodexed.
[Galaxy S 5 General] ticktock666:
Just reporting in : I successfully used the app to deodex the the latest 5.1.1 rom from sony build .546 for the Z2 D6502, everything is working great and I'm a happy camper :)

Thanks you for your work good sir, and may good things and free beer come your way often.
[Galaxy S 5 General] Telesync:
Got an error "Can't add the file < classes.dex > to file <C:\Users\Telesync\Desktop\SVADeodexerForA...\ext-deodexed.jar>". There are several such messages for different frameworks. Android 5.1.1. It works well with Android 5.0. Please help.
[Galaxy S 5 General] Telesync:
Can you publish sources? I manually running oat2dex but firmware don't boot, I suppose I don't notice something important so want to look your code to understand my issue.
[Galaxy S 5 General] tx_dbs_tx:
FYI. From my experience this Lollipop deodexing tool IS the most reliable. However I have had instances where a single deodexed system file was bad and caused a non booting ROM. So if you fear this could be the cause of your non boot situation (after you exhaust all other possibilities) then start your troubleshooting by replacing the deodexed files with the stock odexed versions with their corresponding odex files & folders. There will be a higher chance of one of the framework files to be the cause but you would need to replace the entire framework folder & files with the stock odexed version to see if this is in fact where your possible bad deodexed file is located. This is my advice to help save someone a lot of time and heart ache. Again... this is IF there's a possible bad deodexed file. But like I said, this tool is absolutely the best and most reliable deodexer for Lollipop from my experience as another similar tool would fail, this tool was successful.
[Galaxy S 5 General] leonnn22:
How to flash it?

I downloaded a stock touchwiz rom to my laptop and got a md5 file, I managed to unpack it and got the system.img.ext4 out of it, I unpacked that file also so I got the system folder. Now I have deodexed it (0 errors everything worked fine) what do I need to do to flash/put it on my phone (I have a samsung galaxy s5 plus [SM-G901F])?
[Galaxy S 5 General] carl1961:
find a stock rom installer thats for your phone and replace the system folder with your deodexed folder

look here http://xdaforums.com/galaxy-s5/general/samsung-galaxy-s5-gs-g901f-user-thread-t2906438

or here http://xdaforums.com/galaxy-s5/development/rom-simplegx-rom-v1-0-0-t3072269
[Galaxy S 5 General] leonnn22:
Lets say i download this rom http://xdaforums.com/galaxy-s5/development/rom-simplegx-rom-v1-0-0-t3072269

and I change the system folder to mine. Will it be compatible in my country (I'm dutch and it says it is for Nordic country's) and will it be just like a stock rom (so without all the functions mentioned with that rom)?

Thanks
[Galaxy S 5 General] carl1961:
I don't have that phone but thats not a stock rom, that looks like CyanogenMod

you need to find a plain stock install from someone who may have just added root and not aroma unless it it a simple aroma that might just have a wipe option and no mods.

maybe this

http://xdaforums.com/galaxy-s5/development/rom-novarom-v1-0-t3175286
[Galaxy S 5 General] khsh97:
Thanks for this tool. It deodexed the stock HOF2 firmware successfully. It also deodexed framework.jar correctly as joeldroid tool did not deodexed framework.jar correctly.

On some pages back, I saw a log in which this tool also generated symlinks for libs file while in my log, It didn't generate symlinks. I am using 32bit version of this tool. Any idea why it did not generate symlinks for me. I need symlinks to add them to updater-script.
[Galaxy S 5 General] tdunham:
Symlinks for installer script are created by a rom builder tool such as Archikitchen. This tool does not create a full rom build, it just provides a method to deodex an already odexed rom created by such a rom building utility.

---------- Post added at 12:21 PM ---------- Previous post was at 12:19 PM ----------

And if your odexed rom is already bootable, the symlinks are already there too btw. ;)
[Galaxy S 5 General] carl1961:
The syslinks created or from the library files that or in system/app and /system/priv-app folders

Check and see if you're files contain a lib/art/ folder with lib files or maybe the deodex did not do write.

you can make these symlinks your self just look for the lib files and do them like below.

for example: symlink("/system/lib/libbluetooth_jni.so", "/system/app/Bluetooth/lib/arm/libbluetooth_jni.so");
[Galaxy S 5 General] xdadroidabc:
I am new here. Trying to deodex S6 5.1.1

I got this message in log

so finally what exactly I need to include in deodexed ROM framework folder.

Only framework folder created in SVADeodexerForArtx32 folder ? OR anything else?

Thanks in advance.
[Galaxy S 5 General] svadev:
Simply ignore it ...
[Galaxy S 5 General] d_ave:
I have an issue with v3.5 both 32bit and 64 bit. I run it as admin, but selecting a folder do not work. Manual input of the path to /system folder also do not work - i'm not able to select what to deodex and when i hit Execute i get an error saying i need to choose a right path to the /system folder. I've put the tool in C:\SVA and the rom extract is in C:\system, but this also doesn't help.
[Galaxy S 5 General] akapu01:
when i select system folder it shows me "processor architecture not defined" error.. please help... trying to deodex Galaxy S6 rom...

Edit: I have solved the problem.... the deodex process is completed... now I have 5 folders (app, dex, framework, odex and priv-app) and twframework.dex and twframework-deodex.dex

Now my question is what's the next step to create flashable zip to apply with recovery ... so that my Rom become deodexed one...

[MENTION=6242674]svadev[/MENTION] Please help...
[Galaxy S 5 General] leonnn22:
Great tool, appreciate your work!

---------- Post added at 10:08 PM ---------- Previous post was at 10:04 PM ----------

Used it too deodex my touchwiz rom, worked 100%!
[Galaxy S 5 General] svadev:
I am sorry, but this question not for this topic.

On XDA many topics for answer on your question.
[Galaxy S 5 General] akapu01:
Successfully applied with InstallerTemplate.zip. .. thanks very much...
[Galaxy S 5 General] chuman72486:
It might be helpful to include some kind of directions for this tool.

It asks for a path to /system, but then tries to select a path from my PC, not the phone. Am I supposed to pull all of /system from my device to a local folder beforehand? How do I do that? Why doesn't the tool do that for me like other deodex tools for previous versions of Android? Once I have the deodexed files, do I have to push them back to the device? Flash it through recovery? Does the tool do anything to automate this process?
[Galaxy S 5 General] carl1961:
you don't do it that way, you need a system folder on your PC with all the files well at least the priva-app, framework and app, plus the build.prop
[Galaxy S 5 General] clinthess:
I think that's what he asked, whether he should pull does from his system folder to his pc, then copy them back.

I too feel like a user guide might be beneficial. Might reduce questions and now with xposed linking this thread there is going to be more traffic here. Might cut down on questions if it was covered in the front end.
[Galaxy S 5 General] carl1961:
the main problems is that people or trying to do things with there phone without learning the basic's first, he could grab a backup with his phone and unpack the system.ext4.win000 and system.ext4.win001 and deodex that

but then he would need to also know how to do a installer to reinstall it with TWRP recovery.
[Galaxy S 5 General] carl1961:
Here is deodexing Android 6 Nexus 6 system.img

[YOUTUBE]DtLWVI6-64U[/YOUTUBE]

Hope this helps
[Galaxy S 5 General] arf8:
What is the best method/tool to re-odex an apk back up?

Thanks
[Galaxy S 5 General] Aijazji:
Hi All

I'm New To This Thread And I Really Want To Use This Tool For Deodex My Stock Rom But I Don't Know How To Use This Tool ( I'm Totally Noob In This Section ), I Download The Tool And Set The Java Path But It Give Me Error Like processor Architecture ( Arm , Arm64) Not Defined )

Can Any One Help Me For Deodex My Rom Please I really Want to Learn

---------- Post added at 03:18 PM ---------- Previous post was at 03:12 PM ----------

Can You Make Tutorial For This Tool

Complete Step by Step ?
[Galaxy S 5 General] carl1961:
in cmd prompt screen type java or java -version

you should see something if java path is correct
[Galaxy S 5 General] Aijazji:
Yes Java Path Is Correct
[Galaxy S 5 General] Mentalmuso:
Is there a thread or github where i can keep up to date with the oat2dex.jar? I cant find any downloads for it anywhere
[Galaxy S 5 General] Golv:
Have you more correct smali/baksmali for test? Please upload them.
[Galaxy S 5 General] _riddle:
Surprise to see my patch appears here...

Thanks to baksmali/smali author jesusfreke, the source has nice structure that is easy to extend.

For who may interest about the oat file format:

(Actually it is elf, oat header start from 4k address)

androidxref.com/5.0.0_r2/xref/art/compiler/oat_writer.h#34

The dex in oat file should be odex (not the same as dalvik) format.

Reference: androidxref.com/5.0.0_r2/xref/art/compiler/dex/dex_to_dex_compiler.cc

As below sample, optimized dex uses vtable offset to save function resolving time.

Correct(source) content

.line 76
const-class v1, [I
invoke-virtual {v1}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v1
sput-object v1, TYPE:Ljava/lang/Class;

Odex content (Only extract from oat will get this)

.line 76
const-class v1, [I
invoke-virtual/range-quick {v1}, vtable@20
move-result-object v1
sput-object v1, TYPE:Ljava/lang/Class;

Use original baksmali to force convert art's odex will get wrong instruction.

Pack these content to device will result unexpected runtime error.

.line 76
const-class v1, [I
iput-wide-volatile v0, v1, Landroid/system/OsConstants;->CAP_DAC_READ_SEARCH:I
move v0, v0
move-result-object v1
sput-object v1, TYPE:Ljava/lang/Class;

About the purpose of the tools I made.

It is to convert oat to legacy dex that allow original baksmali without patch can deassemble it correctly.

For example: SystemUI.odex (Actually it is an oat file)

1. Get odex/dex boot class

java -jar oat2dex.jar boot boot.oat

2. Deodex application (The parameter "odex" is folder path from step 1)

As dalvik, deodex application's odex will need to reference boot class to resolve what vtable mapping to.

java -jar oat2dex.jar SystemUI.odex odex

3. Deassemble the output of step 2 by original baksmali.

I only test on AOSP version, I am not sure whether manufacturer modified their own format.

If it does not work correctly, I have no idea without detail information (provide file, error message...).
[Galaxy S 5 General] tdunham:
[MENTION=6258761]_riddle[/MENTION]

Step 1 provides java.io.FileNotFoundException: boot (The system cannot find not find the file specified). Boot.oat file is placed in same work folder that I am running command prompt for commanline functions (under MS Windows).

And I think it is a necessary requisite before attempting #2 correct?

---------- Post added at 10:21 PM ---------- Previous post was at 09:47 PM ----------

Ok, I think step 1 is to get bootclasspath but no success there with boot.oat file.

---------- Post added at 10:26 PM ---------- Previous post was at 10:21 PM ----------

To get bootclasspath with ADB:

adb shell set > d:/bootclasspath.txt

(the '> d:/bootclasspath.txt' was to redirect display output to a text file for use later, otherwise it just displays on the screen)

---------- Post added at 10:29 PM ---------- Previous post was at 10:26 PM ----------

Raw output. Paths will need to be edited for use for deodexing.

BOOTCLASSPATH=/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/timakeystore.jar:/system/framework/seccamera.jar:/system/framework/scrollpause.jar:/system/framework/stayrotation.jar:/system/framework/smartfaceservice.jar:/system/framework/commonimsinterface.jar:/system/framework/imsmanager.jar:/system/framework/sprengine.jar:/system/framework/smartbondingservice.jar:/system/framework/secocsp.jar:/system/framework/secEmailBC.jar:/system/framework/simageis.jar:/system/framework/qcmediaplayer.jar:/system/framework/WfdCommon.jar:/system/framework/oem-services.jar:/system/framework/org.codeauro

Here is a really good guide explaining about deodexing, api levels, commandline, bootclasspaths etc...

[GUIDE] Deodexing APKs Manually
[Galaxy S 5 General] _riddle:
From the error message, it looks like the input file name is "boot".

Did you miss the file extension ("boot.oat" or "boot")?

And in art, it is not necessary to get bootclasspath manually.

boot.oat is compiled with all boot class path jars.

Once extract all dex from it, we have all boot classes.
[Galaxy S 5 General] Golv:
[MENTION=6258761]_riddle[/MENTION]

Thx for your great work!

Could I need deassemble with baksmali output files from boot from /odex/*.dex or from /dex/*.dex for correct deoxed framework's *.jar?

Files from which folder do I need deassemble?

Or can I rename each of the files in /dex/*.dex to classes.dex and to add this classes.dex in matching * .jar?

For example:

after successful:

java -jar oat2dex.jar boot boot.oat

/dex/android.policy.dex rename -> classes.dex and pack into android.policy.jar (with 7za)

Is that correct?

---------- Post added at 03:16 ---------- Previous post was at 02:35 ----------

[MENTION=6258761]_riddle[/MENTION]

I deodexed 1 file - SystemUI.apk and added it to the odex system for verification. Phone booted successfully and runs without errors (HTC One M7 with Google Play edition Android 5.0.1)

THANK YOU !!!

Now I need to check all odexed jar's from framework and all jar's from framework with odex from framework/boot.oat (That was my question in a previous post ...) ...
[Galaxy S 5 General] Golv:
Only one of all Odex files (from framework, app and priv-app) with error:

g:\oat2dex>java -jar oat2dex.jar Launcher2.odex odex

12-21 07:55:01:793 Preparing bootclasspath from odex

12-21 07:55:03:088 De-optimizing /system/priv-app/Launcher2/Launcher2.apk

Exception in thread "main" org.jf.util.ExceptionWithContext: Unsupported instruction format: Format22cs

at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1008)

at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:769)

at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:222)

at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:200)

at org.jf.dexlib2.writer.pool.DexPool.writeTo(DexPool.java:99)

at dext.OatUtil.extractToDex(OatUtil.java:271)

at dext.OatUtil.oat2dex(OatUtil.java:140)

at dext.OatUtil.main(OatUtil.java:160)

Odex original and apk - attached here: Launcher2.rar

[MENTION=6258761]_riddle[/MENTION] Could you see this app and odex? Why the error occurred and what can be done?

THX!!!
[Galaxy S 5 General] Golv:
Cheers!

I've my full DEODEXed ROM now, except Launcher2.apk (with Launcher2.odex)

Ffirst I was left in the /system /priv-app only odex Launcer.apk and /arm/Launcher.odex and removed from the /system/framework all /arm folder.

Phone successfully loaded, but gave error Laucher.

Then I added into /system/framework/arm folder two files: boot.oat and boot.art

The phone has successfully boot WITHOUT any errors. As a result, there is only one odex Launcher2.apk in the system. But I think it's no problem! Everything will be decided in the future!

Great respect [MENTION=6258761]_riddle[/MENTION] and other for their great work!
[Galaxy S 5 General] svadev:
@_riddle:

I try to use your tool for Samsung S5 and have get error.

Here is error, boot.oat, SystemUI.odex : ftp://79.120.63.235/err_oat2dex.zip

Added:

in Samsung boot.oat - oat header contains two additional fields:

oat_create_commands_info_size : uint32; // length of oat create command in bytes

oat_create_command:[FONT=&quot] ubyte[[/FONT][FONT=&quot]oat_create_commands_info_size] ; // aot create command command

and only after this follow dex files headers

[/FONT]
[Galaxy S 5 General] _riddle:
[MENTION=6242674]svadev[/MENTION]

Thanks for the information.

Finally I add a rough workaround to compatible with Samsung's format:

Read more 4 bytes as methods_offsets_ of structure OatDexFile when read unreasonable dex size.

Please try the attachment.
[Galaxy S 5 General] svadev:
Thanks!

It works finely for boot.oat and others apk!