I've just kind of gotten into theming a lil bit and I was hoping to find more information. I've checked out the "Ultimate Theming Guide" and many other links and I've got a fairly good idea until you get into the xml (I'm reading up on this now) I was wondering if some of you could save me some google time and post links etc. to useful information. I've already got something to extract, repack and sign apks. I'm mostly looking for the actually theming itself, identifying the portions of the ui to tweak, particular xmls to edit etc. I'm still relatively new to this but if any of you ever played WoW there used to be an addon that would identify the frame/scripts responsible for whatever item you moused over.
jvegastn said:
I've just kind of gotten into theming a lil bit and I was hoping to find more information. I've checked out the "Ultimate Theming Guide" and many other links and I've got a fairly good idea until you get into the xml (I'm reading up on this now) I was wondering if some of you could save me some google time and post links etc. to useful information. I've already got something to extract, repack and sign apks. I'm mostly looking for the actually theming itself, identifying the portions of the ui to tweak, particular xmls to edit etc. I'm still relatively new to this but if any of you ever played WoW there used to be an addon that would identify the frame/scripts responsible for whatever item you moused over.
Click to expand...
Click to collapse
If I werent on my phone I would point you at the link... Search xda for apkmanager. This will allow you to decompile and recompile apk's easily after modifying xml filea. It utilizes apktool (smali and baksmali) to format the xml files to a usable format in a text editor such as notepad or notepad++
One catch with apkmanager is that it doesnt interpret 9.png files correctly. You will need to read tge log to see which of those files catch it up. Then cut these and just dip them back into the finished apk using 7zip. When I get back to my desktop I can look up links and try to post the steps I take.
Sent from my DROIDX using XDA App
Apkmanager is very helpful, I'm looking for more info on what images correspond to what. Quick easy xml alteration with being a code guru. Hope that makes sense.
The purpose of this thread is not to pirate swiftkey 3, but to edit the keyboard to allow custom smilies and hotkeys. Using APKtool 1.5 HERE I can decompile, but cannot recompile. Ideally it would be nice to be able to just replace the applicative xml file that is customized into the app that will then be installed. However, recompiling fails, and replacing the xml does not allow the apk to be installed (even after resigned).
When swiftkey is decompliled, /values/strings.xml has a list of all the keys and their outputs; if the app can be successfully recompiled, we can make completely custom layouts.
I have a feeling that swiftkey uses an encrỳpted apk; how can we get around that to edit the apk at will?
The underlying purpose here is to be able to convert xml from an apk to readable xml then reconvert into binary xml so that simple xml replacement can be achieved.
If it makes a difference, I downloaded swiftkey 3 from the amazon appstore. (I have a feeling that the amazon appstore has some sort of custom encrỳption)
shameless bump because I've been looking for an answer for months now
Same thing
Hey man, I've been trying to do this for the past few days. I could not get around it at all! Tried few different things, but no luck!
Developers are making their apps now so they can't be edited this way. I know of a few that are doing it so that the min they are decompiled they corrupt the code so it it can't be recompiled and ran. This is most likely what is happening
Wayne Tech Nexus
Hi,
The radio app that came with my Xtrons (Oreo) GS PX5 head unit, is OK but I think I could make a lot of improvements
So I've got ADB root to my device via Wifi and looking in the system/apps folder I can see MTCRadio4HCT which I presume is the radio app.
Inside that folder is ..
MTCRadio4HCT.apk
and the oat folder which contains an arm64 folder, which contains MTCRadio4HCT.odex and MTCRadio4HCT.vdex
I've decompiled APK's before to extract assets, but not odex or vdex
Before I go to the trouble of trying to decompile and recompile the radio app.. Does anyone know if its already been done by someone else ?
As I've never decompiled and recompiled an Android Apk before, I don't know whether this is practical or not.
I've decompiled and recompiled a lot of C# applications on Windows, and they always need a lot of work to clean up the decompiled code before they will compile and run, so I presume the APK / Java decompilers are similar (or possibly worse)
radio app...
this apk from Malaysk ROM Oreo v2.0, and has classes.dex.
good luck!!
rabbity417 said:
this apk from Malaysk ROM Oreo v2.0, and has classes.dex.
good luck!!
Click to expand...
Click to collapse
Thanks
I'll try decompiling that one, as well as the one I pulled from my HU.
BTW. List of things I'd like to fix
1. Current station preset / memory is not very obvious. There is a slight change to the text colour on the button for that preset / memory, but its hard to see at a glance when driving
2. Names can't be assigned to AM stations. Ideally, It would be nice if once a station / preset / memory had been assigned, that a name could be given to that preset / button, rather than just the frequency.
Additionally, on FM some stations cycle their name e.g. ABC Classical radio, seems to broadcast its name as "ABC" then "Classical" then "Radio". So on my radio it just shows this as ABC, but there are multiple ABC stations in Australia as its government funded, with Pop, Classical and News and General stations.
3. No way to change from AM to FM via the steering wheel controls.
4. FM station preset / memory buttons, all go back to displaying their frequencies when the App is scanning. I think the same may apply when changing memory / preset.
I can't see why this should happen. The name associated with the preset / memory , must be stored by the App as soon as it gets the name from the FM transmission its self.
And it can only get the name of the station its currently tuned to.
Hence it doesn't make any sense for it to only show the names on the FM preset, when its got the name of the current station via the FM signal.
5. It would be better if unassigned preset / memory channels were blank, and skipped by the steering wheel controls.
I'm sure there other annoyances that people have
RogerClark said:
Thanks
I'll try decompiling that one, as well as the one I pulled from my HU.
BTW. List of things I'd like to fix
1. Current station preset / memory is not very obvious. There is a slight change to the text colour on the button for that preset / memory, but its hard to see at a glance when driving
2. Names can't be assigned to AM stations. Ideally, It would be nice if once a station / preset / memory had been assigned, that a name could be given to that preset / button, rather than just the frequency.
Additionally, on FM some stations cycle their name e.g. ABC Classical radio, seems to broadcast its name as "ABC" then "Classical" then "Radio". So on my radio it just shows this as ABC, but there are multiple ABC stations in Australia as its government funded, with Pop, Classical and News and General stations.
3. No way to change from AM to FM via the steering wheel controls.
4. FM station preset / memory buttons, all go back to displaying their frequencies when the App is scanning. I think the same may apply when changing memory / preset.
I can't see why this should happen. The name associated with the preset / memory , must be stored by the App as soon as it gets the name from the FM transmission its self.
And it can only get the name of the station its currently tuned to.
Hence it doesn't make any sense for it to only show the names on the FM preset, when its got the name of the current station via the FM signal.
5. It would be better if unassigned preset / memory channels were blank, and skipped by the steering wheel controls.
I'm sure there other annoyances that people have
Click to expand...
Click to collapse
wow!!! it would be great!! :good:
if you have done, plz share it..:laugh:
rabbity417 said:
wow!!! it would be great!! :good:
if you have done, plz share it..:laugh:
Click to expand...
Click to collapse
Thats the list of things I'd like to change. I've not started to try to do it yet.
It all depends on how well the App decompiles, and how difficult it is to recompile it.
Its been a while since I did any Android dev using the SDK, as I generally use Cordova for the simple Apps I need - and don't get my hands dirty with the Android SDK / API.
But I am a professional developer, (mainly C# at the moment) but also Javascript, C , PHP etc. And I've done several decompiles / recompiles of obfuscated C# apps.
I don't know if you are new to APK modifications but Decompile/recompile is not hard, even understanding Java code is easy.
The pain come when you start modifying the smali code.
I suggest you to use "jadx"or similar tool to obtain Java code of the APK, then modify the smali and recompile.
Good luck
rabbity417 said:
this apk from Malaysk ROM Oreo v2.0, and has classes.dex.
good luck!!
Click to expand...
Click to collapse
I tried one of the online decompilers, and the APK from my HD just decompiled to the XML layout files and no Java code.
The APK from the Malaysk APK looks more promising as it does contain Java code, when decompiled, but looking at the graphical assets, it looks a lot different from the app in my (stock) ROM.
I'm doing to install the APK from Malaysk and see if it actually works on my HU. I'll update this thread when I find out.
I'll also see if I can decompile the vdex and odex that go with my APK file.
Edit.
Decided not to install the Malaysk as the Apkinstaller said it would overwrite the existing radio app.
as they both have package="com.microntek.radio"
Looking at the decompiled manifests, it looks like the APK from the Malaysk ROM requests more permissions to the APK in my "stock" ROM
ission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.cyanogenmod.lockclock.permission.READ_WEATHER"/>
I'll see if I can find any screengrabs of the Malaysk version to see if it looks different, as its strange that its requesting storage, when its just a radio app and not a music player
To view the Java code you need JADX or similar tool, follow this guide:
https://ourcodeworld.com/articles/read/387/how-to-decompile-an-apk-or-dex-file-using-jadx-in-windows
The obtained Java code cannot be used to recompile the APK.
To be able to recompile you have to use apktool to Decompile into smali code.
The smali code can be recompiled into the apk with apktool.
There are many custom apktool versions with GUI or batch commands that make easyer the process:
Batchapktool, Easyapktool etc...
KoTiX2 said:
To view the Java code you need JADX or similar tool, follow this guide:
https://ourcodeworld.com/articles/read/387/how-to-decompile-an-apk-or-dex-file-using-jadx-in-windows
The obtained Java code cannot be used to recompile the APK.
To be able to recompile you have to use apktool to Decompile into smali code.
The smali code can be recompiled into the apk with apktool.
There are many custom apktool versions with GUI or batch commands that make easyer the process:
Batchapktool, Easyapktool etc...
Click to expand...
Click to collapse
Thanks
I'll checkout the various apktools. BTW. I presume they handle odex and vdex files (as this app has both)
BatchApktool have a function for deodexing the apk.
I don't know if it deodex function work for Oreo too.
KoTiX2 said:
BatchApktool have a function for deodexing the apk.
I don't know if it deodex function work for Oreo too.
Click to expand...
Click to collapse
Probably a really stupid question, but I've tried apkeasytool on the Malaysk radio apk, and the source it generated is smali, which is really hard to read
But I also tried this online tool http://www.decompileandroid.com/ and it seemed to generate both smali and Java.
As far as I can tell the Java files the online tool created are the Java equivalents of the smali code.
I have some knowledge of programming in Java, but smali is a totally new language to me.
I guess I'll need to try creating an android studio project using the manifest and resources and Java code (and omit the smali) and see if it compiles ?
Smali is intended for small code modifications without the need of creating your own Studio project.
Is not so hard to modify but of course is just for small things.
Once you are used to it become a little more friendly but still not as much as Java or more normal languages
KoTiX2 said:
Smali is intended for small code modifications without the need of creating your own Studio project.
Is not so hard to modify but of course is just for small things.
Once you are used to it become a little more friendly but still not as much as Java or more normal languages
Click to expand...
Click to collapse
Thanks.
I'll need to work out the best way to do this...
I can decompile the Malaysk , to smali and could probably make small changes e.g. change the text colour on buttons etc. However to implement the more complex changes, would probably be impractical in smali.
I'm also not keen on overwriting my existing radio app by installing the version from the Malaysk ROM, as I don't know for sure if it would work (because there are potentially difference in MCU version).
I may have a go at renaming the Malaysk radio app, so it would install as a separate app, but I'd need to change a lot of files and it could be a pain to get it to recompile.
The Malaysk radio app apk seems to decompile to java via one of the online decompilers, so I may try creating a very basic / almost empty project in Android studio, with the same package name as the radio app, and then copy the decompiled xml, java and graphic asset files into that project, and see if it will compile
But I guess its probably not going to compile or probably not run.
I've also used the APK Easy tool to decompile the app thats in my ROM (system/apps), and used its separate odex decompiler to extract the smali for my stock app.
My concern is that if I try to change the app, and break it, then it could be hard to get back to a working version (and in the mean time I don't have a radio in the car)
I do have the system/app folder backed up to my PC, so in theory, if I break things, I could simply copy the backup of the odex file to the head unit, but I'm not sure if that would be sufficient to restore the operation of the radio
Another option is to just work out how the existing app (or the Malaysk version of the app), interfaces with hardware (MCU etc), and write a radio app from scratch.
As far as I can by looking at the current functionality, the radio only has a few functions, i.e control the "tuner" hardware to select the frequency, turn on an off various settings to do with TA etc.
But again, this would probably be big job.
Anyway, plenty for me to think about
It doesnt look like making changes to the radio app are possible because the smali files have decompilation warnings in them using the APK Easy tool
e.g.
#disallowed odex opcode
#iput-object-quick v0, p0, [email protected]
I've had a look at the decompiled java files from the Malaysk ROM version of the radio app (apk), and I don't think the radio app is controlling the hardware directly
It looks like the hardware handling is in android.microntek.CarManager;
But I'm not sure where that code is.
I presume its in the framework somewhere. e.g. possibly in
framework\arm\boot-framework.vdex
I've looked in my entire backup of the system folder, there is nothing named *.CarManager.*
Is it possible to listen to all events that are being broadcast, e.g. perhaps from the terminal, or via a debugging app ?
I've looked for an app to do this, but the best one I found is https://play.google.com/store/apps/details?id=lt.andro.broadcastlogger and it still only shows specific broadcasts
Perhaps I need to write my own debugging app to show broadcasts with com.microntek.* , and see whats flying around
(BTW. This is the limit of my Android knowlegde, so I'm not even sure if I can write an app to listen for any com.microntek.* message, or if it needs to be more specific ????)
Edit
I think I found the CarManager
Its probably priv-apps/MTCManager.
Just decompiled the odex, and I'm taking a look inside
Try logcat
you can specifiy what it shall display from the log it reads.
type in com.microntek. and it should only list the log entries with that.
The radio apps are almost the same for all MTC devices, you can even run the APK from Android 6 firmware on Oreo (if signature is not a problem) or even more the radio apk from px3 7.1 firmware.
The one in Malaysk is probably slightly modified by him.
I would look also in the Booroondook rom too:
https://4pda.ru/forum/index.php?showtopic=891403&st=0#entry70937201
Anyway if you need to change something in all the files all in ones, you can use the function "replace in all files" in notepad++
I'm on vacation until next week otherwise I could help you with smali and tests on my desk unit.
no need for smali, using APKRepatcher you can decompile, edit java code, build and compile APKs... unfortunately there are complie errors for the HCTRadio apk (CarManager related + other stuff)
k0sTi said:
.... unfortunately there are complie errors for the HCTRadio apk (CarManager related + other stuff)
Click to expand...
Click to collapse
Yep. That's the problem
None of the apps seems to cleanly decompile to valid smali code, which I presume means they can't be recompiled back to a usable app.
Unless perhaps the compiler is able to reconstruct the error opcodes in the smali back to the same odex / dex as before.
I have not tried decompiling then recompiling the odex to see if it would recompile. Or perhaps decompile , recompile and then decompile again - and see what the result it.
As my HU is now in the car, and I use the radio, I don't want to break the existing radio app.
KoTiX2 said:
Anyway if you need to change something in all the files all in ones, you can use the function "replace in all files" in notepad++
Click to expand...
Click to collapse
Yes. I used Notepad and its find in files and replace in files is great.
I may be able to replace MTCRadio by MTCRadioNew and change the app name, so I can run my own copy.
However, its dependant on being able to decompile and recompile the code... And I'm not sure if thats possible.
I guess I should give it a try when I get some free time.
PS. Thanks for the link to the other ROM. I've downloaded it, but I've not had time to look in the image files.
But it seems to have the same date as another ROM someone else posted in a different tread on XDA, called "PE 系列 gs5_PX5_8.0_升级包(20180118" ( Translates to PE series gs5_PX5_8.0_ upgrade package (20180118) )
BTW. I wonder how Malaysk managed to modify the radio app. He must have deodexed the APK, as the APK from his ROM does not have a separate odex file, and he also must have decompiled and recompiled it (either to smali or to Java)
Hope it helps... here seems that someone correctly decompiled the Java inside the CanBus App...
RogerClark said:
BTW. I wonder how Malaysk managed to modify the radio app. He must have deodexed the APK, as the APK from his ROM does not have a separate odex file, and he also must have decompiled and recompiled it (either to smali or to Java)
Click to expand...
Click to collapse
Of course he firstly deodexed the APK than he Decompiled, modified the smali and recompiled.
I did the same to add the numkeyboard to the radio apk in Android 6
Smali is always created correctly and recompile is always possible unless you make mistakes on the code.
the Java decompilers sometimes cannot generate part of the code.
You can give a try to Procyon too:
https://bitbucket.org/mstrobel/procyon/downloads/