[Q] apktool no java files - General Questions and Answers

I'm attempting to adjust an application, that is currently not recieving updates, so that the gyroscope/accelerometer axis are reversed to fit the default axis of the Motorola Xoom. The Xoom is meant to be held in landscape and it's axis are setup accordingly, but this app assumes the axis are set for portrait.
I installed apktool for windows and was under the impression that it would attempt to convert my .smali files to java files so I can atleast see the methods more clearly. I use apktool in the command prompt and have it output the contents of the apk to a folder. But once I open the folder there is no "source" folder with java files, it just contains a "smali" folder with all the smali files.
I've located the smali files that contain the "sensor" methods which is what the gyroscope/accelerometer is being refered to as. But I'm not familar with this level of code to be able to edit it. I planned on simply reversing the variables that the data is stored into but in the smali files it seems like the same variables used over and over again.
Is there an extra step I'm missing to decomplie the smali files into a java-like file?
If I locacted the listener for the "sensor" would anyone be able to help me modify the smali to simply swap which axis is stored into which variable?
Thank you for reading this,
BoostHungry

Related

Problems with PROVXML files

I've spent the last 6 hours trying to get PROVXML files working with 1.60 ROM and I just can't... Here is what I've tried:
Created my own PROVXML files in Notepad, Notepad++ and XML Notepad, following existing examples and documentation from http://msdn2.microsoft.com/en-us/library/aa456134.aspx
Modified existing PROVXML files (e.g., 'copy' command to 'move' command for OEMDrivers\mxip_HtcApps_HTC_Ringtone.provxml) and re-touched with proper timestamp and file attributes (+s +r +h +a)
Cut up portions of Menu_Operation.XML and placed into renamed files, such as mxipupdate_package_ver.provxml and mxip_package_ver.provxml
Saved in ANSI & Unicode
Used BuildOS.exe and BuildOS+Package_Tools-2.7.exe
And no matter what I do, the file operations I'm trying to perform within the PROVXML never happen!!!
I would be greatful for any help or insight. Thanks much!
I've had issues adding new provxml files but have always been able to add operations to existing ones w/o problems. This is essentially how I split out MMS from SMS on my latest ROM. Timestamp/file attributes weren't an issue for me. Instead, my biggest issue was the fact that my ROM wasnt running the MASD provxml that was part of the ArcSoft package. I ended up working around the problem my placing the MMS account provisioning into another provxml. Interestingly, looking at these files with WinHex shows a 3 byte sequence that proceeds the non-unicode provxml files themselves. Definately not a checksum since I've been able to change the contents w/o adjusting this info and the provisioning itself still runs. In fact, deleting the sequence entirely seems to have no effect on whether the provisioning doc runs at cold boot or not. Consequently, I've always been interested in understanding the mechanism that controls what provxml files get run.
The hex bits are only found in provxml files contained with the OperatorPKG folder. Other provxml files have no special hex bits, and unfortunately, I've added those hex bits to my files and still have not had any success.
The main reason why I want to use provxml files is to replace initflashfiles.txt in every package and reduce the amount of memory used by having duplicate copies in the windows folder and the copied folder.
Any additional insight would be appreciated...
Thanks again.
_Alex_ said:
The main reason why I want to use provxml files is to replace initflashfiles.txt in every package and reduce the amount of memory used by having duplicate copies in the windows folder and the copied folder.
Any additional insight would be appreciated...
Thanks again.
Click to expand...
Click to collapse
You ever have the option to pack the soft into a CAB and install on first boot trough customizacion OEM... i know is not the same, but you gain control about the space on storage.
Cheers.

[REQ] HTC HD2 - Java Games Resizer

I searched on the xda Forum, but i found nothing, so i decided to create this request post.
I have a lot of different Java Game, but the resolution is just 176x220 or 240x320 with no touch support.
So i can't play with the HD2, because it is too small and i can't move.
We have a lot of different tools to change the resolution and add the touch settings, but i never found for HTC.
I hope someone will help me and in the same time, help other person who want to play on their old Java Game like me.
Nobody have a solution to my problem.
Noboby want to play to old huge Java Game on his HTC HD2.
It is very dommage and sad.
Open the jar file with winrar and open the folder meta-inf and open the file inside with notepad.
Find this:
Nokia-MIDlet-Original-Display-Size: xxx, xxx <----- Original display (No need to change)
Nokia-MIDlet-Target-Display-Size: 480x800 <----- Desired resolution
Than you're done!
(Note: This may not work for some games.)
firetiger said:
Open the jar file with winrar and open the folder meta-inf and open the file inside with notepad.
Find this:
Nokia-MIDlet-Original-Display-Size: xxx, xxx <----- Original display (No need to change)
Nokia-MIDlet-Target-Display-Size: 480x800 <----- Desired resolution
Click to expand...
Click to collapse
I already tried it, and it didn't work.
I try with four free java games.
I try also with freeware to change size and add touch, because we can't play even if we change size.
But it doesn't work also.
So i decided to open jar file and decompress all class files to have java files and to can edit them.
But i can't correctly compile new java files to have new class files to put in the jar file.
Just to remember :
The file name is MANIFEST.MF
Hi!
I've got java games which runs fine on Xperia X1 (in portrait mode, with touch screen controls, res.: 480*800). But when i try to run them on HD2 the controls are offscreen, so i can't play the games... Is there a solution for this
thx!

APK Batch Rename Tool (for Windows and Linux)

Hi guys!
This is a quick tool I jotted together for myself in the past couple days and found it very useful. So I decided to clean it up and share it. Hope you will like it! Do comment and ask!
APK Batch Rename Tool
* for Windows and Linux for now.
APK Batch Rename Tool recursively crawls input folder and all of its subfolders looking for Android Package files (.apk's). It reads Label and Version info from apk's found and creates a copy for each apk under the output folder but using the Label and Version info acquired.
For example a com.example.hw.apk will make Hello World! 1.21.apk provided that the label inside the package was set to Hello World! and version is 1.21.
The old and the new apk files are 100% the same in terms of content and are unchanged. Only the new copies are given new filenames. Input files are left completely intact.
Why?
Have you ever wondered what are your 1500+ apk files with wierd names nested to different wierd folders on your harddrive? Have you ever wanted to find an app but you were unable to because it had some undescriptive javaish name that made no sense reflected no version and your apps were swept across a hundred junk folders anyway? Then APK Batch Rename is the tool for you! And me!
APK Batch Rename will set a human readable name for all your Android apps, and drop such a copy into a folder. You will finally be able to browse them, sort them alphabetically and be able to pick from versions available.
How?
1. Copy all your apk files (or folders with apk files in them) into the input folder. You may copy folders of any depth. APK Batch Rename Tool will recurse all subfolders of the input folder anyway.
2. Hit or click ApkBatchRename.bat . (For Linux users it's: apkbatchrename, or on a terminal enter: ./apkbatchrename ) Wait until it finishes the job.
3. Find your freshly named files in the output folder.
Simple as that!
Have fun! & Comment!
phsorx
great work, just like reading mp3 tag then rename to "song - artist.mp3"
thanks!
Cool. I use to do it manually. Time saver app.
Thanks.
This is awesome! Thank you very much, situation you described in first post is just like mine, I find your tool very useful!
Folks,
Let me join you crediting phsorx's job, that app is just great!
Thanks and congrats!
Very cool, Works well. Always wanted to do this but was too lazy to try aapt.
I just checked:
aapt said:
badging Print the label and icon for the app declared in APK.
Click to expand...
Click to collapse
Code:
> aapt d badging Talk.apk
[B]package: name='com.google.android.talk' [/B]versionCode='130' [B]versionName[/B]='1.3'
sdkVersion:'8'
targetSdkVersion:'8'
uses-permission: **truncated***
application: [B]label='Talk'[/B] icon='res/drawable-hdpi/ic_launcher_google_talk.png'
uses-feature:'android.hardware.touchscreen'
main
other-activities
search
other-receivers
supports-screens: 'small' 'normal' 'large'
locales: '--_--' 'es' 'es_US'
densities: '160' '240'
I'll definitely use your script but with a small change to show the package name as well as its valuable for when you need to uninstall the package.
i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk
Attached a slightly modified batch file and screenshot
For single file one-off renames (right-click->open with->rename single) you can use the script here.
De jo! Honfitars. Hajra Magyarok!
Customizable naming planned in future version
britoso said:
Very cool, Works well. Always wanted to do this but was too lazy to try appt.
i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk
Click to expand...
Click to collapse
Hi Britoso,
Yeah! That's a neat way to do it too!
Eventually I want to make naming and spacing fully customizable! Including what attributes to pick (name, label, versionName) to constitute the filename, and what separators (_,-,(,),space) should go where.
In the howto.txt I have a little road-map for the project. Will add customizable naming too.
Will keep you guys posted.
EOF
phsorx
Ps: Anyone who has another naming suggestion drop a post! I'd be interested.
great job...bravo..
thanks
Very nice tool, thanks for sharing this .
Using it with britoso's edited script.
Edit: I would appreciate it if a log of the conversion would be saved in a \logs\ subfolder, so I can check which files were not converted properly and see if I have to do those manually.
Handy ! Thanks...
deleted
For one-off renames you can use the below batch file.
1) create the below batch file in the same folder as apkrename.bat (its attached too)
Name: rename-single.bat (change this if you want)
content:
Code:
cd "C:\change_me\ApkRename\"
apkrename.bat %1 %~dp1
Change the path(change_me) as needed.
2)Associate it with apks by right clicking on the apk and choosing "choose default program", browse and select the batch file "rename-single.bat".
Uncheck "make this the default operation"
Screenshot and batch file attached. Enjoy.
update:
-12/8 uploaded a new version that fixed a bug involving long path names with spaces.
Also added a check for success and then delete the original apk. (backup your apks just in case).
Remember to set the path to the ApkRename folder in rename_single.bat once before using it.
Really gd job )
APK Batch Rename Tool for Linux is on the way
luvgirl12345 said:
would like a linux version...
Click to expand...
Click to collapse
Hi luvgirl12345,
The Linux port is on the way & will be posted here soon!
Actually, the Windows release is running on win32 ports of a few common Linux tools. And that's so, because I am lazy. Having Linux's much better support for shell scripting plus the same tool set always at hand, porting is a breeze.
Ciao,
phsorx
Sounds very useful, thank you!
Looks nice for massive apk renaming.
Found a similar tool called APKInfo some month ago which i am using for single apk files for a while now.
But finally something for batch renaming.
Thanks
your the man!, works like a charm. Thanks!
Any plans for making an Android version of this to run on our devices?
Future plans for an on-phone version of the APK Rename Tool
del4 said:
Any plans for making an Android version of this to run on our devices?
Click to expand...
Click to collapse
Yes! Certainly. Its in the plans.
But firstly there are a few things to be fixed on the desktop version first. See road map section of the howto.txt file in the archive. The most burning issue is the so called overwrite issue that I want to be sorted out next. Say you have two copies of the same app (same name, label, versionName) but one of them has a patch against it (because its been modded by a reverser) than one of the copies will overwrite the other (ApkRename 1.10).
Secondly on a mobile device's SD card there is usually less space than on a desktop's hard drive. This implies that APK Renamer will actually have to rename the files in place instead of creating a copy of each in a separate folder. Or at least it will need to figure out the empty space left on the device, and if its not enough to hold the copies, it should offer in-place renaming instead. Not a lot of logic to add but still...
Having all the outstanding questions be figured out on the desktop still, will allow me to implement a more established version for the phone right from start. But hold still its not going to take very long
Bests,
phsorx

[HowTo]Changing dock keys on AOSP

Before reading on please know that:
You need to have root permissions
The methods for stock based kernel vs aosp vary
ALWAYS back up your files
I've only recently been toying with this on AOSP, not everything may be accurate
HOW TO CHANGE THE KEYS:
This link has all you need to know about the .kl and .kcm files, and how to change the layout. Basically the keylayout file gives values to the keys pressed, while the keychars assigns things like what to do when shift/capslock is pressed etc... Unfortunately, while this works fine on stock based roms, it needs some extra steps in order to work with AOSP
NOTE:
The location of the files on the tf300t are slightly different. The keylayout/ and keychars/ folders can be found in /system/usr
This link is the android documentation on input files. The "Key Layout Files" and "Key Character Map" sections for information on the syntax for .kl and .kcm files.
AOSP ROMS
AOSP roms evidently do not have a working asusdec driver, as such only standard Android keys work.
A list of keys can be found in the "Keyboard Devices" section of the Android documentation linked above, or you can just click here
The Asus specific codes the dock uses (and therefore don't work on AOSP) :
KEY_SLEEP
KEY_WLAN
KEY_BLUETOOTH,
ASUSDEC_KEY_TOUCHPAD
KEY_BRIGHTNESSDOWN
KEY_BRIGHTNESSUP
ASUSDEC_KEY_AUTOBRIGHT,
KEY_CAMERA
KEY_WWW
ASUSDEC_KEY_SETTING
KEY_PREVIOUSSONG -MEDIA_PREVIOUS
KEY_PLAYPAUSE -MEDIA_PLAY_PAUSE
KEY_NEXTSONG -MEDIA_NEXT
KEY_MUTE
KEY_VOLUMEDOWN
KEY_VOLUMEUP
Some alternatives I've found:
POWER can be used as an alternative for SLEEP (The lock key)
SYSRQ might work in place of CAMERA, Which is labeled as CAPTURE in the files (neither is a standard android key)
EXPLORER is already in the files in place of WWW
MEDIA_PREVIOUS should work instead of PREVIOUSSONG
MEDIA_PLAY_PAUSE in place of PLAYPAUSE
MEDIA_NEXT in place of NEXTSONG
IMPORTANT NOTES ON AOSP:
For the .kl files to work you must remove the "UNLOCK" at the end of every line.
Because the asusdec driver is either missing or broken, you must create an Input Device Configuration File. There is more about this in the Android documentation, but creating a simple file "asusdec.idc" and saving it in /system/usr/idc works fine.
This file should contain at least 2 lines:
Code:
keyboard.layout = asusdec # The name of the .kl file found in keylayout
keyboard.charactermap = asusdec # name of the .kcm file
The .idc file HAS to be named asusdec.idc or it will not work.
Process:
Code:
# Using Terminal Emulator with the dock disconnected:
logcat |tee -a log.txt
#When I connect the dock I see
D/EventHub(499): No input device configuration file found for device 'asusdec'.
#Disconnecting the dock I would see
D/AsusDockEmbeddedController(4002): ECWakeup is now off
#So I create the asusdec.idc, set it to load the .kl and .kcm, reboot, do it all over, this time
E/KeyLayoutMap(499): /system/usr/keylayout/asusdec.kl:1: Expected key flag label, got 'UNLOCK'.
#Reading the docs noticed there was no 'UNLOCK' flag so I removed them all
#And after removing several incompatible keys it works!

Has anyone decompiiled the Oreo MTCD Radio app ?

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/

Categories

Resources