Modify system app with shared user id 1000 - MTCB Software Development

Not sure if this is the right place to post, but I am trying to extend the functionality of my Joying 2gb head unit (5.1.1).
I have made changes to the apk that accepts the key presses and translates them into commands. For example, start the google voice search activity from the steering wheel buttons. I also modified the applications that are cycled through with the 'Source' key.
I have made all the modifications to the smali code and rebuilt the apk (Sofia-1-C9-Server-V1.0.apk). The problem comes when I try to use it the system will not recgonize it. From the error I get, it needs to be signed with the same signature as the other apps that share this user ID 1000 (android.uid.system). It looks like there are 22 other programs using this ID.
Is there anyway to have the HU accept this modified package? I was thinking about re-signing all 22 of the apk files that use this shared id, but thought I would ask to see if anyone has any experience with this issue. Any suggestions?
Thanks

gustden said:
Not sure if this is the right place to post, but I am trying to extend the functionality of my Joying 2gb head unit (5.1.1).
I have made changes to the apk that accepts the key presses and translates them into commands. For example, start the google voice search activity from the steering wheel buttons. I also modified the applications that are cycled through with the 'Source' key.
I have made all the modifications to the smali code and rebuilt the apk (Sofia-1-C9-Server-V1.0.apk). The problem comes when I try to use it the system will not recgonize it. From the error I get, it needs to be signed with the same signature as the other apps that share this user ID 1000 (android.uid.system). It looks like there are 22 other programs using this ID.
Is there anyway to have the HU accept this modified package? I was thinking about re-signing all 22 of the apk files that use this shared id, but thought I would ask to see if anyone has any experience with this issue. Any suggestions?
Thanks
Click to expand...
Click to collapse
No, its not the right section - you have a Joyous Sofia unit and these are not MTCB, C or D units, there is a thread in the Android Auto General forum, I would post in that.

Thanks for the clarification. I wasn't sure but this is about the closest *development* forum I could find anywhere on xda.
I was hoping that someone who has done development with any MCU related android code running at the system level. had run across this issue, and able to provide advice.

gustden said:
Thanks for the clarification. I wasn't sure but this is about the closest *development* forum I could find anywhere on xda.
I was hoping that someone who has done development with any MCU related android code running at the system level. had run across this issue, and able to provide advice.
Click to expand...
Click to collapse
Someone has indeed written an app for it, its called MTCservice, or MTCKeys or something, using Xposed, but it will only work on MTC MCUs and your unit uses an entirely different MCU to MTC MCUs. MTCB and D units got their own forums due to the sheer number of them sold, other units dont I m afraid so your ll have to trawl the General Forum to find threads relevant to your unit. There are some MTCD units with the Sofia chipset, but Joyous chose to go another MCU route with their Sofia devices.

Related

[Q] is there an app that checks all installed or purchased apps for ICS compatibilty?

maybe either through API level, or by querying market info
Reason: i want to check on GB before I upgrade to ICS, which apps will not work.
don't know if relevant but it is for SGS II
Thx in advance
repost from here as nobody could really answer my question
can't believe I'm the only one with that issue
maybe an idea for a dev? would be willing to pay for that ;-)
I don't see why this can't be done:
-http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run
-http://developer.android.com/reference/android/content/pm/PackageManager.html
-http://developer.android.com/reference/android/content/Context.html#getApplicationInfo()
I haven't thought through the problem just yet, but its seems to be doable. If you don't find an app soon, I will start working on a script that does it and, if successful, a proper, free software app. I am hoping the available methods won't require something as stupid as launching each app fully. But again, I haven't thought it through. Thanks for the idea btw.
EDIT:
Made a little more effort
https://groups.google.com/forum/?hl=en&fromgroups#!topic/android-developers/dXLACRIizKc
I will work on something this weekend and get back with y'all.
EDIT 2:
So it looks like I would need maxSdkVersion which I don't find in the API. Furthermore, it is strongly suggested that one not use maxSdkVersion when building an app so that doesn't sound all that useful. I have received another, much more complicated suggestion that may do what I want, but I will have to look hard at it. Looks like I'm going nowhere in my effort. Always open to suggestions. More to come later this weekend.
I'm not the sharpest tool in the shed, but I thought this was mostly a straightforward task using the API's exposure to AndroidManifest.xml. As per my previously posted link to an Android Developers discussion on the topic, my approach is dead in the water as far as I can see. I did try to find an answer though to the best of my limited ability. If anyone has or ever solves this problem (I consider it a problem) I would hope they find the this thread.
Thanks for the learning experience. I give up.
Most older apps will work fine on ICS, its pretty backwards compatible. If the app uses legacy menus the button will appear in the old lower left hand corner location instead of the upper right hand corner like apps written for ICS.
i'm no dev so bear with me if i write stupid stuff
one likely but not very promising sounding way might be to use android:targetSdkVersion as "As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens)."
question though is how many apps actually use this?
However after having read this re android:maxSdkVersion "Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute." (taking from here) i now don't know how important my op is, but then why do all app devs release new versions "fixing things" for ICS?
One pretty significant example which actually currently will prevent my phone from getting ICS for now is that the subsonic app in the current version produces stuttering when playing audio while downloading (problem description here).
Isn't there any way to instead of searching the phone searching google play/android market instead?
Randi said:
maybe either through API level, or by querying market info
Reason: i want to check on GB before I upgrade to ICS, which apps will not work.
don't know if relevant but it is for SGS II
Thx in advance
repost from here as nobody could really answer my question
Click to expand...
Click to collapse
Here's a list of some working games/apps for ICS
Theoretically an Android app (or a combo of say App Engine and Android) could find your installed apps, seacrh Play for said apps and then scrape the page for relevant information. Doesn't sound to hard, but I didn't think about too hard either. Perhaps I will check out what useful info is on Play and how feasible scraping its markup will be. I will get back at y'all if I do.

App not allowing me to sign in due to custom rom

Hi everyone,
So the company that provides the TV channels in my country (like the cable companies in the US) has a streaming service that streams most of these channels online to phones, tablets, computers.
The problem is that their app is, according to them "not supported on hacked devices". Just so we're clear, we're talking about Android here, and hacked = root/custom rom, which this stupid company considers illegal. In some devices, they check both root and custom rom, in some only one of them, and in some the app will work even if you have both. For example, on my Nexus 4 the app worked with stock rom that was rooted. Now that I am running a custom rom, trying to hide root using various apps does not work. So obviously the problem, with my device at least, is running the custom rom.
I'm currently learning Java & Android development and have decided to use the little knowledge that I have to try to find the lines of code responsible for this idiotic check.
I looked up many tools for decompiling apps and have finally found a good one, called JadX.
http://androidcracking.blogspot.co.il/2014/03/jadx-dex-to-java-decompiler.html#links
This decompiler is excellent, but gives me a scary amount of code files to look. Even so, trying to search all of them (JadX has that functionality) for the code that checks for root/custom rom has turned up nothing. I have also tried to search for the message they give me when I open the app (about hacked devices not working) but I found nothing, again.
One more thing - a developer that also tried to solve this problem said he traced the problem back to DxDrmDlcCore. I searched it, found it a some class, but not sure what to do now (delete the entire class and recompile?)
Can someone here direct me towards what I need to be looking for?
OR
Is the solution really simple, such as editing my build.prop? Someone suggested it once, but did not know what lines to edit.
If someone is ready to step up to the challenge, I can upload the apk.
Thank you!

MCU drivers

Originally posted on 4pda
rk3188 MTCB drivers source code could be fond here
https://github.com/amper128/mtc_drivers
Someone skilfull may modify them or extract knowledge of how MCU integration is done. Russians suggest it is possible to build completely new kernel.... But it is still to be seen if anyone steps forward and do anything with it.
pa.ko said:
Originally posted on 4pda
rk3188 MTCB drivers source code could be fond here
https://github.com/amper128/mtc_drivers
Someone skilfull may modify them or extract knowledge of how MCU integration is done. Russians suggest it is possible to build completely new kernel.... But it is still to be seen if anyone steps forward and do anything with it.
Click to expand...
Click to collapse
Many source files on github appear to be empty. Still this looks very promising - thanks!
The missing pieces of the Kernel...Great!
Would you please link to the original thread on 4PDA?
DaAntipop said:
The missing pieces of the Kernel...Great!
Would you please link to the original thread on 4PDA?
Click to expand...
Click to collapse
XDA is not allowing like links to 4pda but here is the thread name and post number so search on Google for direct link
Модификация софта и украшательства для ГУ MTCB/MTCC CPU RK3066/3188
Post #6049
There is just a post, to inform and announce to interested Devs. No full thread dedicated to that project.
If anyone is interested to step in and do something, I would recommend contacting directly the developer (on github). He may be interested in cooperation and help.
Thank you
Unfortunately it hasn't gained much attention in this monster-thread...let's see how far we can get with it
pa.ko said:
XDA is not allowing like links to 4pda but here is the thread name and post number so search on Google for direct link
Модификация софта и украшательства для ГУ MTCB/MTCC CPU RK3066/3188
Post #6049
There is just a post, to inform and announce to interested Devs. No full thread dedicated to that project.
If anyone is interested to step in and do something, I would recommend contacting directly the developer (on github). He may be interested in cooperation and help.
Click to expand...
Click to collapse
This looks great!
The file mtc_car.c contains the ARM side of the MCU comm routines. I have studied the MCU side of this comm protocol by decompiling MCU (mostly) KLD2 v2.77. Later MCU versions that I have looked at are very similar.
It is a 3 wire bidirectional point-to-point protocol where either side can initiate a data transfer. In other words, either side can be the "master" and send to the "slave. "
Each transfer starts with the master requesting control of the bus, receiving an acknowledgment from the slave, then sending a 16 bit command word which specifies the rest of the transfer. Some commands have no additional data transfer. Others are either a request by the master to send a block of data to the slave, or a request to receive a block of data from the slave.
After the transfer is complete the master releases control of the bus so that either side can start another transfer. If the transfer ever times out then both sides give up and return the 3 wire bus to the idle state so that they can try the transfer again.
I've attached a PDF of a list of command words and what they do, based on what I've seen in the MCU code. Of course code addresses listed there only apply to the KLD2 v2.77 version of the MCU. In my comments I call the 3 wire bus "SPI" but it is not technically the SPI protocol.
dhmsjs said:
This looks great!
The file mtc_car.c contains the ARM side of the MCU comm routines. I have studied the MCU side of this comm protocol by decompiling MCU (mostly) KLD2 v2.77. Later MCU versions that I have looked at are very similar.
It is a 3 wire bidirectional point-to-point protocol where either side can initiate a data transfer. In other words, either side can be the "master" and send to the "slave. "
Each transfer starts with the master requesting control of the bus, receiving an acknowledgment from the slave, then sending a 16 bit command word which specifies the rest of the transfer. Some commands have no additional data transfer. Others are either a request by the master to send a block of data to the slave, or a request to receive a block of data from the slave.
After the transfer is complete the master releases control of the bus so that either side can start another transfer. If the transfer ever times out then both sides give up and return the 3 wire bus to the idle state so that they can try the transfer again.
I've attached a PDF of a list of command words and what they do, based on what I've seen in the MCU code. Of course code addresses listed there only apply to the KLD2 v2.77 version of the MCU. In my comments I call the 3 wire bus "SPI" but it is not technically the SPI protocol.
Click to expand...
Click to collapse
Very big thanks!
dhmsjs said:
This looks great!.
Click to expand...
Click to collapse
Thank you for sharing your knowledge. You should also contact Dev on github and send this info to him. I'm not dev myself but trying to share and connect people who are doing and/or able to do something truly useful for our units. I believe that mastering MCU integration, drivers, and even fixing them in parts or providing new functions (like getting RDS data from radio, saving stations without xposed etc.) may open a way for building new kernel even building new ROM on M, N or O platform (which provide much better support for resource management, offering even much better performance on older hw like our outdated rk units than LP which is proven sluggish).
pa.ko said:
...You should also contact Dev on github and send this info to him...
Click to expand...
Click to collapse
Dev now has it on Github.
pa.ko said:
...or providing new functions (like getting RDS data from radio, saving stations without xposed etc.)...
Click to expand...
Click to collapse
The RDS and AF functions will depend on the specific device. To understand these I need the programmer's data sheets for the devices.
I have this for the TDA6624 device, but not TEF66xx devices -- which seem to be much more common in these head units.
The data sheet must have detailed information on the device registers and how to use them. I have the TEF66xx Short Data Sheet ("SDS") but that does not have the details I need to understand the RDS and AF functions in those devices.
Perhaps you can ask on 4pda if anyone there might have a copy of the TEF66xx programmer's data sheet that they could share?
dhmsjs said:
Dev now has it on Github.
The RDS and AF functions will depend on the specific device. To understand these I need the programmer's data sheets for the devices.
I have this for the TDA6624 device, but not TEF66xx devices -- which seem to be much more common in these head units.
The data sheet must have detailed information on the device registers and how to use them. I have the TEF66xx Short Data Sheet ("SDS") but that does not have the details I need to understand the RDS and AF functions in those devices.
Perhaps you can ask on 4pda if anyone there might have a copy of the TEF66xx programmer's data sheet that they could share?
Click to expand...
Click to collapse
Asked... Lets hope they will pay attention. (I asked them to post here so we get notified)
dhmsjs said:
Dev now has it on Github.
The RDS and AF functions will depend on the specific device. To understand these I need the programmer's data sheets for the devices.
I have this for the TDA6624 device, but not TEF66xx devices -- which seem to be much more common in these head units.
The data sheet must have detailed information on the device registers and how to use them. I have the TEF66xx Short Data Sheet ("SDS") but that does not have the details I need to understand the RDS and AF functions in those devices.
Perhaps you can ask on 4pda if anyone there might have a copy of the TEF66xx programmer's data sheet that they could share?
Click to expand...
Click to collapse
On 4pda is thread dedicated to our clients nits and in there is a section with lot of documents.
XDA policy permit posting 4pda links but you may find it using name "Аппаратное обеспечение ГУ CPU RK3066/3188. MCU - IAP15L2K61S2 - Обсуждение | Автомагнитола и устройство на Android". In thread header look for subsection "Документация".
I saw datasheets for FM tuners TDA7706, TDA7786 and TEF6624. There also many other DSs for other components.
To download you need to register on 4pda, which is bit hard for non-Russian speakers...
Anyhow I am attaching DSs for radios.
pa.ko said:
...XDA policy permit posting 4pda links but you may find it using name "Аппаратное обеспечение ГУ CPU RK3066/3188. MCU - IAP15L2K61S2 - Обсуждение | Автомагнитола и устройство на Android". In thread header look for subsection "Документация".
I saw datasheets for FM tuners TDA7706, TDA7786 and TEF6624. There also many other DSs for other components.
To download you need to register on 4pda, which is bit hard for non-Russian speakers...
Anyhow I am attaching DSs for radios.
Click to expand...
Click to collapse
Thanks for the reference & the zip file! I do appreciate the help.
Yes I have looked around on 4pda and yes it is a bit hard for non-Russian speakers (like me). I have not tried to register there for that reason.
I need to correct my device references above: the best data I have is for the TEF6624 (that pdf is also in your zip file) not "TDA6624." I believe the more recent and more popular device is the TEF6686. This is the one that I am missing programming data on. Since the MCU code does not implement the AF function I cannot look there to see how it is programmed (at least not on KLD2 v2.77).

How can I learn how Android works?

I'm not a developer but I have knowledge about Linux and how PCs in general work. Is there any book/course that explains how android works on a deeper level? I'm not interested in apps or user UIs, I want to know the deeper levels like how partitioning works, how the OS is loaded, why some bootloaders are locked by default, what a custom recovery is or what is the first thing to load when you power on your phone/tablet (do phones have a BIOS like PCs or anything equivalent?). Thanks in advance.
I'm also interested in this, but I think the answer is it's a bunch of undocumented proprietary baseband processor junk nobody will share for the boot, then the rest is basically a Linux distro made by 1000 monkeys on 1000 typewriters copy/pasting stuff provided by their hardware vendors together, and the components of that also probably have no documentation or incorrect documentation.
Just browsing through directory structures on a rooted phone there's so much unused and inaccessible junk like config files for really old versions of android, random vendor apks that aren't configured, and firmware for other processors strewn all over, sometimes multiple copies of the same structure, that it makes no sense. It looks like a bunch of vendors gave their support libraries to manufacturers with the intent they'd delete the unused parts and copy the used parts in, but the manufacturers don't understand how to do that so they just paste the same full directory structure several different places until it starts working.
If it made any sense, some people would just learn it and rooting new phones wouldn't be hard.
dan2525 said:
I'm not a developer but I have knowledge about Linux and how PCs in general work. Is there any book/course that explains how android works on a deeper level? I'm not interested in apps or user UIs, I want to know the deeper levels like how partitioning works, how the OS is loaded, why some bootloaders are locked by default, what a custom recovery is or what is the first thing to load when you power on your phone/tablet (do phones have a BIOS like PCs or anything equivalent?). Thanks in advance.
Click to expand...
Click to collapse
The rabbit hole goes as deep as you want it to. I have plenty of information to get you started. Happy digging!
*A general overview of the android boot process, thanks to the Lineage OS developers.
*An old, but good read on reverse engineering aboot.
*And a much more recent article on reverse engineering android. It gets very detailed in this one. It also goes into the low level processes of android. Like; What loads the bootloader? That kind of stuff. I think this is what you're after. Hope it helps.
About the bios question. The short answer is, "kind of". They have a very simple and proprietary one that's not easy to access. It also does not function in the same ways that a PC bios does. It's more like a motherboard programmer. It's hard to explain. The last article goes into some of that.
Spaceminer said:
The rabbit hole goes as deep as you want it to. I have plenty of information to get you started. Happy digging!
*A general overview of the android boot process, thanks to the Lineage OS developers.
*An old, but good read on reverse engineering aboot.
*And a much more recent article on reverse engineering android. It gets very detailed in this one. It also goes into the low level processes of android. Like; What loads the bootloader? That kind of stuff. I think this is what you're after. Hope it helps.
About the bios question. The short answer is, "kind of". They have a very simple and proprietary one that's not easy to access. It also does not function in the same ways that a PC bios does. It's more like a motherboard programmer. It's hard to explain. The last article goes into some of that.
Click to expand...
Click to collapse
Do you know if there is any tool that lists all the various initscripts and settings in use on a running system? I'd like to remove Google entirely from my phone, but there are so many firmwares and initscripts all over the place that I can't even figure out which ones are actually used to run the system. Half of the settings files, properties, and commands return 0 results or 3-4 useless results when searching for them on the internet.
ZHNN said:
Do you know if there is any tool that lists all the various initscripts and settings in use on a running system? I'd like to remove Google entirely from my phone, but there are so many firmwares and initscripts all over the place that I can't even figure out which ones are actually used to run the system. Half of the settings files, properties, and commands return 0 results or 3-4 useless results when searching for them on the internet.
Click to expand...
Click to collapse
The best way to remove google entirely is to flash a custom ROM or GSI if your device supports it. You really only need to look in system/app and system/priv-app for google stuff. Some phones use stock Google apps for things like the Calendar or MMS. So, to run google-less you may need to replace some system apps as well. Just a warning, even if you already know this. Removing certain apps, even google apps, may cause problems for normal operation. Definitely make a backup before deleting anything in the system.
ZHNN said:
Do you know if there is any tool that lists all the various initscripts and settings in use on a running system? I'd like to remove Google entirely from my phone, but there are so many firmwares and initscripts all over the place that I can't even figure out which ones are actually used to run the system. Half of the settings files, properties, and commands return 0 results or 3-4 useless results when searching for them on the internet.
Click to expand...
Click to collapse
I'm no expert but have been running lineageos 14.1 for some time now. It is a version of android 7.1 in which everything google has been removed. I use it with microG which replaces google play services.
You may wish to look into it instead of re-inventing the wheel.
I use it with a firewall (AFWall +), and Xprivacylua for additional privacy.

How does the app „Jodel" identify my device?

i recently bought a used device and when i tried to create a new jodel account, the app said i was perm banned. How come? Since i have root acces, i tried to change my device id / spoof my mc adress. But im still banned. So, how does jodel identify my device?
jodel: https://play.google.com/store/apps/details?id=com.tellm.android.app&hl=de&gl=US
thanks in advance
IMO you have to investigate app's source code to find it out.
dont know how. pls help
You use an APK de-compiler. Some online de-compilers exist but do only handle APKs < 50 MB hence not useable in your case.
More info here:
48 Best APK Decompilers 2023 (Ranked and Reviewed) - Edopedia
As a programmer, we frequently come across interesting apps and games on the Play Store. And we wish that there would be some magical software that can
www.edopedia.com
i dont know how to use that. i just need to know, how jodel identifiys my device.
whre does it say what data they use to identify my device
@anonuser14 Here you find a review of Jodel written in German. As you're obviously using Jodel, I assume you speak German otherwise please use a machine translator. I'm convinced you'll find the answers to your questions about the absolutely privacy related desaster application.
yes, im german. first thing i did was reading the privacy note from jodel and i even asked the support. all they said was, they use my devide id, which is obvisly not the whole truth. im not a developer or something, all i know is how to flash a rom & root a device. so, all i need is an expert looking into this case and helping me. ( I attached the anwers from jodel)
If you're rooted and using Xposed (in whatever version) I suggest to spoof your device ID with XPrivacy Lua by @M66B like I do.
[CLOSED][APP][XPOSED][6.0+] XPrivacyLua - Android privacy manager [UNSUPPORTED]
XPrivacyLua Really simple to use privacy manager for Android 6.0 Marshmallow and later (successor of XPrivacy). Revoking Android permissions from apps often let apps crash or malfunction. XPrivacyLua solves this by feeding apps fake data...
forum.xda-developers.com
so what now?
A Jodel account is tied to Device ID of phone it 1st time was installed on. Hence you can't use Jodel on another phone.
Also Jodel doesn't allow you to create multiple accounts, as you tried to do.
like i said, i bought a used phone, i did not try to create multiple accounts, and most important, its not tied to the device id, at least not tied to just the device id. i tried reinstalling the app, used privicy lua, changed the phone id, but jodel still can identify my device.
how?
what if i pay 10$ for giving me a solution?
pls help
anonuser14 said:
what if i pay 10$ for giving me a solution?
Click to expand...
Click to collapse
In Germany, the legal minimum wage per hour is currently 9.60€ ( 11.35$ ).
jwoegerbauer said:
In Germany, the legal minimum wage per hour is currently 9.60€ ( 11.35$ ).
Click to expand...
Click to collapse
so, can u help me?
Could but don't want to because it requires to install some GBs of apps on PC what are only needed once.
just tell me how, and ill try.
until now, nobody seems to know, how jodel identifies a device
@anonuser14 As far as I remember, Mike Kuketz has briefly reviewed that app about two years ago. Here's a shortened quotation of his conclusion (German-English translation by https://www.deepl.com:
Yodel is a good example of how just starting an app is enough to get an impression of how privacy-friendly it is. My impression: miserable.
At least the information in the privacy policy is relatively transparent - privacy-sensitive users will therefore probably not use Yodel.
Click to expand...
Click to collapse
If interested consider to search the web for that post.
Oswald Boelcke said:
@anonuser14 As far as I remember, Mike Kuketz has briefly reviewed that app about two years ago. Here's a shortened quotation of his conclusion (German-English translation by https://www.deepl.com:
If interested consider to search the web for that post.
Click to expand...
Click to collapse
jodel had severel updates. 2yo article are not valide anymore.
how does jodel identify a device?

Categories

Resources