Help - deodexing Oreo manufacturer specific APK and framework - Android Software/Hacking General [Developers Only]

Hi,
I'm trying to deodex and decompile some manufacturer specific apps from a Android car head unit (PX5 RockChip).
I've "pulled" the apps as I have ADB root to the device, and there is an APK (for each app), but that only contains the xml files.
With the apk, there is an oat folder, and inside that is arm64, which contains both odex and vdex files.
(I'm not sure why it has both odex and vdex. The vdex files seem to be about 4 times the size of the odex)
Anyway ... ApkEasyTool (which uses Baksmali) has errors when trying to decode the odex files, as it reports invalid opcodes
I've done a search on the various deodexers, but nothing seems that up to date, and most threads seem to end with people asking whether the deodexer supports Marshmallow or Lollipop, without any response from the tool developer.
Can anyone recommend any other tools, (apart from ApkEasyTool) which may be able to deodex a Oreo APK.
Or should I be using a tool to deodex the vdex files instead ?

Related

downloading jar files into handset

I can add a jar file into the apk package, however if multiple apps are using the same jar, ideally it should placed under /system.
The jar file is not really activities (so using intents/providers is not applicable here) but may contain some commonly utils by my apps.
This is somewhat similar to OSGI, but more modest.
Any pointers ..
-Dan

Can't Load res/raw Files After Modding

Hello xda-developers!
I'm new to Android hacking, but I have a general background in programming...
I've been modding an application recently, unpacked the .apk file, done my changes and repacked it, signed it and everything works well...But when I run the program, and the program wants to play an mp3 file, which was located in res/raw before packing the .apk file, it gives an error: "Can't load audio file."...What is the possible cause of this problem and how to solve it? Are the IDs of the raw resource files changed everytime I unpack and repack the .apk file or what?
Thanks in advance...
Edit: Issue fixed by unpacking and repacking using Apktool instead of WinZip.

[Q] Any option to detect changes in apk files

Hello guys.
I am wondering if there's any option/programme/app that can detect changes in apk files.
For example:
A dev releases a mod for something, let's say swaps a .png files to a custom .png and shares the mod in a thread.
And i want the same mod but in a different .png.
Now i can ofcourse ask the dev to do it, which is easy but i wont learn anything.
So i decide to try to make it for myself, but having no past experience with android i don't know how to do it.
And here's where the app/programme comes in (if there is one, ofc). A software that can detect any kinds of changes after decompiling apk files. Now many of you know that apk files have several folders inside, and inside those folder are various files.
So this software (if it exists) could be able to detect changes in the modded apk compared to my unmodded apk, and tell me where exactly the change(s) have been made.
In this way i don't need to bother a dev, and i maybe start to learn how to mod special areas of my phones UI.
Thanks for any reply!
Good day!

[Q] Problem Modding APK

Hello guys,
I am modding an apk to bypass an update check.
I have this outdated APK that functions fine since the URL and query and site address remains same but whenever it checks for and update it crashes. The thing is the developer made it topnotch but since then left and his site was recently taken down so check update query crashes it totally. What I need to do is update just the one function where it brings up the GUI after start. Otherwise it keeps saying download update or crashes randomly at time of starting up.
Now I have been browsing for a day or two for all the tutorials and right now I`m hell lot of confused. I have downloaded many tools and dependencies but I dont know how to proceed. I will tell you guys what I have and what I need.
I have de-compiled the APK using "dex2jar", I had a .JAR file which I decomplied using JD-GUI-Windows now after saving source I have .ZIP file in which I made the necessary editing. Next I downlaoded APKTool.JAR and extracted resource files and XML files that can be read in text editor. Along with some .SMALI files.
Now I am not familier with SMALI language at all and editing in it seems rather complicated and on the other side I have the .JAR file that decomlied all the classes just fine.
MY QUESTION IS:
How do I recompile the files I have ? I have the main coding extraced using dex2jar so in java format and JD-Gui to in .ZIP files, and resources/XML files also decoded using APKTools. What do I do next to recompile the APK ?
In short I have plain text based java source code and plain text XML and other resource file. How do I recompile it ?

[TOOL] Smali Reference Swapper

OK, so I'm just gonna throw this one out there as a feeler..
When porting packages from other devices, I've found myself modifying Smali reference IDs for ages. The goal being to get the references in a foreign package to reference the correct resource in e.g. the BASE framework-res.apk.
Finally, I got really fed up, and automated the process. The result is this very alpha SmaliRefSwapper JAR. Instead of spending endless hours of cutting and pasting references until your eyes bleed, this code does most of the process for you in a matter of seconds.
Now I'm trying to figure out if this is something which would be of interest to developers. If not I probably won't put much more work into this. So let me know what you think - yey or nay!
Definitions
BASE framework = framework-res.apk in the ROM you are trying to port the foreign package to.
BASE package = the APK in the ROM you are trying to port the foreign package code to.
PORT framework = framework-res.apk in the ROM you are trying to port the foreign package from.
PORT package = the APK in the ROM you are trying to port the foreign package from.
Preparations
You can place the files wherever you want, but for simplicity, I have provided a folder structure and instructions relative to this.
1. Place the Smali files (package.apk/smali/*) from the PORT package into SmaliRefSwapper/smali
2. Place the XML files (package.apk/res/values/*) from the BASE package into SmaliRefSwapper/xml/base/package_values
3. Place the XML files (framework-res.apk/res/values/*) from the BASE framework into SmaliRefSwapper/xml/base/framework-res_values
4. Place the XML files (package.apk/res/values/*) from the PORT package into SmaliRefSwapper/xml/port/package_values
5. Place the XML files (framework-res.apk/res/values/*) from the PORT framework into SmaliRefSwapper/xml/port/framework-res_values
If there is no XML in the BASE or PORT package, place a dummy public.xml file in these folders.
Usage Instructions
Run the JAR (through terminal to obtain some logs) and select the appropriate folders.
The output will be two folders:
SmaliRefSwapper/smali_new
SmaliRefSwapper/xml_new
smali_new content goes into the PORT package before recompilation. In it, all Smali references have been replaced with the correct reference from the BASE framework/package.
xml_new contains two folders:
SmaliRefSwapper/xml_new/framework-res
SmaliRefSwapper/xml_new/package
framework-res files contain references which should be added to the respective XMLs in the BASE framework before recompilation (e.g. public.xml content should be added to framework-res.apk/res/values/public.xml). In certain cases, for example when drawable references have been added, it is necessary to manually fix the dependencies they may infer (e.g. adding a PNG file from the PORT framework-res/package).
xml_new may also contain a UNHANDLED.xml, which lists references that could not be found in either PORT framework-res or package. In most cases these are hardcoded hexadecimal values, such as colors or numbers.
After recompiling the BASE framework with the new XML, and the PORT package with the new Smali and XML, it should be safe to include the PORT package in the BASE ROM.
Download
SmaliRefSwapper Alpha
Please do not mirror my work!
Reserved in case.

Categories

Resources