[Q] Shared User android.uid.system - Android Q&A, Help & Troubleshooting

Hello,
I build a couple ROMs and make my own mods/apps. However, when re-adding them back to the system directory, i get this in the logcat, and then the apk/jar is not loaded and doesn't let the ROM boot.
Error:
Code:
01-01 00:07:19.157: E/PackageManager(9928): Package com.sec.android.app.nfctest has no signatures that match those in shared user android.uid.system; ignoring!
I know exactly what the issue is, the signatures of the new modded file do not match what is found in android.uid.system.
What I am asking, is, how can I change what is found in the android.uid.system UID?
I tried re-signing all the jar and apk files of the ROM to see if that changes it but it still shows that same error in the log.
I have no idea where this is stored the UIDs of the system.
THanks all for looking!

UIDs are not stored anywhere on the system lol. That's like asking where your IP addresses are stored!
You really should do some googling - this is pretty basic level stuff that can be understood easily once read.
I know you haven't tried googling UIDs because you wouldn't have asked this question if you had.
I know you don't develop apps either or you would understand this already too.

CtrlAltDelIrl said:
UIDs are not stored anywhere on the system lol. That's like asking where your IP addresses are stored!
You really should do some googling - this is pretty basic level stuff that can be understood easily once read.
I know you haven't tried googling UIDs because you wouldn't have asked this question if you had.
I know you don't develop apps either or you would understand this already too.
Click to expand...
Click to collapse
Thanks for the laugh I appreciate it! Youre a joke dude, i have created a bunch of apps and created ROMs which people love. I don't know who you think you are but you're obviously an idiot. If you have nothing to contribute, but smart ass remarks, mind your own business.
The packagemanager is obviously doing a signatures check with something else, that something else is stored somewhere, so yes, the system UID is stored somewhere.

Ok then smartypants
What I am asking, is, how can I change what is found in the android.uid.system UID?
Click to expand...
Click to collapse
This doesn't even make sense. The UIDs are dynamically served (like IP addresses) by Android.
There is nothing "in" the system UID. It is just a UID lol.
You need to look at your manifest.xml or makefile for your app, not recompiling Android to suit your app.
Now who's the idiot?

CtrlAltDelIrl said:
Ok then smartypants
This doesn't even make sense. The UIDs are dynamically served (like IP addresses) by Android.
There is nothing "in" the system UID. It is just a UID lol.
You need to look at your manifest.xml or makefile for your app, not recompiling Android to suit your app.
Now who's the idiot?
Click to expand...
Click to collapse
You are. Because its a system app that i am modifing i cannot "change the manifest" you need to resign the manifest when you change it or else the apk does not get loaded.
And there is a thing in the manifest called sharedUserId="android.uid.system" the PackageManager is checking if this apks signature matches the UID of "android.uid.system". When they don't match, the error posted in the OP is thrown by the package manager and the package is no longer loaded. If i sign the apk with my own keystore, then it won't grant the apk the signature level permissions it needs to properly run.
You obviously have no idea what i am talking about or trying to do..

Modders lol.
You shouldn't play with things you are incapable of understanding!
Good luck!

CtrlAltDelIrl said:
Modders lol.
You shouldn't play with things you are incapable of understanding!
Good luck!
Click to expand...
Click to collapse
I understand exactly what the problem is dude.. I understand exactly what i am doing, just don't know how to fix it. Thanks for contributing nothing

Hey @elesbb
Did u find out the solution for this issue? I'm tryin to do some ports from miui to AOSP and I'm having this error while tryin to install.
Hope u answer. Have a nice day.

LOswaldoRO said:
Hey @elesbb
Did u find out the solution for this issue? I'm tryin to do some ports from miui to AOSP and I'm having this error while tryin to install.
Hope u answer. Have a nice day.
Click to expand...
Click to collapse
Yes but you HAVE to use xposed

elesbb said:
Yes but you HAVE to use xposed
Click to expand...
Click to collapse
Please, could you tell me how to do it? Files that I need and all that stuff?
Thanks in advance man.

the solution found here worked for me: Signing my android application as system app - Stack Overflow

Related

Need help with basic java!

Hi Everyone,
I am trying to code my first android app, which is an app that will copy some files from the app's asset folder to /system/app, adjust permissions and let the user know the process has been finished. I am a systems person, not a programmer, so know all of the details as to what has to get done. I create some scripts in /assets, and have the files I want to copy in /assets as well.
How do I go about programming this? Is this the right method I'm looking at doing?
danifunker said:
Hi Everyone,
I am trying to code my first android app, which is an app that will copy some files from the app's asset folder to /system/app, adjust permissions and let the user know the process has been finished. I am a systems person, not a programmer, so know all of the details as to what has to get done. I create some scripts in /assets, and have the files I want to copy in /assets as well.
How do I go about programming this? Is this the right method I'm looking at doing?
Click to expand...
Click to collapse
Can I have the files? I'll try to do this for you
Sent from my Galaxy Nexus using Tapatalk
Better to help him instead of doing it for him, that way he learns more and gets his hands dirty. =p
Hehe, thanks for the response guys!
Anyways, tycoon177, thanks for signing up to help me!
I have zipped up everything I have related to the project, it is pretty simple, I just want to copy some files from the progrsm into /system/app, I have created an install and an uninstall script (although I haven't tested them just yet, not sure how I would do that right now) and have placed those scripts in the /assets/scripts folder. The goal is to copy the files into the proper locations, in order for the Kobo Vox to get access to the Android market. I have devised some instructions and posted them in the following forum page ( http://www.mobileread.com/forums/showthread.php?t=160948&page=1 ), but a lot of users seem to be messing up their system (they aren't a technical bunch) so I figured I should try and learn java and build an app for all of this...
Unfortunately this is a little beyond my abilities, but my intro to Java course starts tonight hehe.
Anyways, the project name is called OogleVox, it won't need to be going onto the Android Market, and will probabably just be an apk download from one site or another.
The link to the source code is here:
http://www.multiupload.com/ASI47S2BM4
Thanks again for your help!
danifunker said:
Hehe, thanks for the response guys!
Anyways, tycoon177, thanks for signing up to help me!
I have zipped up everything I have related to the project, it is pretty simple, I just want to copy some files from the progrsm into /system/app, I have created an install and an uninstall script (although I haven't tested them just yet, not sure how I would do that right now) and have placed those scripts in the /assets/scripts folder. The goal is to copy the files into the proper locations, in order for the Kobo Vox to get access to the Android market. I have devised some instructions and posted them in the following forum page ( http://www.mobileread.com/forums/showthread.php?t=160948&page=1 ), but a lot of users seem to be messing up their system (they aren't a technical bunch) so I figured I should try and learn java and build an app for all of this...
Unfortunately this is a little beyond my abilities, but my intro to Java course starts tonight hehe.
Anyways, the project name is called OogleVox, it won't need to be going onto the Android Market, and will probabably just be an apk download from one site or another.
The link to the source code is here:
http://www.multiupload.com/ASI47S2BM4
Thanks again for your help!
Click to expand...
Click to collapse
I don't know what Kobo Vox is, but for android, in general, the /system partition is read only, and on most devices the MMC or eMMC is locked so that it can't even be remounted read/write. Also, any user app won't be able to gain the required permissions to write to /system/app even if the partition was unlocked and mounted read/write. If you are rooted and security allows you write access to the MMC/eMMC, then you'd need su to gain the required permissions from the OS.
Gene Poole said:
I don't know what Kobo Vox is, but for android, in general, the /system partition is read only, and on most devices the MMC or eMMC is locked so that it can't even be remounted read/write. Also, any user app won't be able to gain the required permissions to write to /system/app even if the partition was unlocked and mounted read/write. If you are rooted and security allows you write access to the MMC/eMMC, then you'd need su to gain the required permissions from the OS.
Click to expand...
Click to collapse
Thanks Gene Poole, I know this app will require root permissions, which will require a run as su. That's going to be a requirement for the app
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
Sorry, I did not figure this out..
Sent from my Galaxy Nexus using Tapatalk
tycoon177 said:
Sorry, I did not figure this out..
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
Thanks for trying! I'm taking a Java course at school now, maybe I'll be able to figure this one out in due time.
If you want to write app before learning java you could use basic4android. You could use its phone library to execute the commands direct and as you can also issue adb commands etc with it you could also have your app more interactive whereby it could check for things you know cause problems and react accordingly.
The site is basic4ppc.com I think, it would allow you to quickly and easily code an app and as with eclipse and other ide's it produces native standalone apk files signed and ready for use.
Dave
Sent from my LG P920 using Tapatalk

[Q] Building Torch

Ok I am trying to build a Torch APK from git sources from Wayland_Ace. I went to repository and downloaded them as a zip. I've set up ADT and have Eclipse running. I chose to create a project with existing sources and chose the folder I extracted from the zip.
Now, I want to make some edits to this and I already know how and what I am going to, but I figured I would make sure the app would build before I made any changes and it won't. I get four "TORCH_STATE cannot be resolved or is not a field" errors and few warnings about some imports never being used.
I have a feeling this is because it's importing the settings from stock Android and not CM10.1. Can anyone help me fix this so I can build a Torch APK. I've Googled and fooled around with this for hours and have not had any success and am getting a bit frustrated.
admiralspeedy said:
Ok I am trying to build a Torch APK from git sources from Wayland_Ace. I went to repository and downloaded them as a zip. I've set up ADT and have Eclipse running. I chose to create a project with existing sources and chose the folder I extracted from the zip.
Now, I want to make some edits to this and I already know how and what I am going to, but I figured I would make sure the app would build before I made any changes and it won't. I get four "TORCH_STATE cannot be resolved or is not a field" errors and few warnings about some imports never being used.
I have a feeling this is because it's importing the settings from stock Android and not CM10.1. Can anyone help me fix this so I can build a Torch APK. I've Googled and fooled around with this for hours and have not had any success and am getting a bit frustrated.
Click to expand...
Click to collapse
How are you trying to build the apk? Through eclipse or through the android sdk?
fairct said:
How are you trying to build the apk? Through eclipse or through the android sdk?
Click to expand...
Click to collapse
Eclipse.
admiralspeedy said:
Eclipse.
Click to expand...
Click to collapse
I took a look at the source (CMs, not the one you pulled), and it is indeed because you don't have the CM SettingsProvider. It may sound foolish, and I'm not sure what will happen, but you could try commenting it out. I think that's just updating a system var so that things like the power widget can update appropriately. Worst case scenario you get a force-quit, or your LED won't turn off, forcing a battery pull
fairct said:
I took a look at the source (CMs, not the one you pulled), and it is indeed because you don't have the CM SettingsProvider. It may sound foolish, and I'm not sure what will happen, but you could try commenting it out. I think that's just updating a system var so that things like the power widget can update appropriately. Worst case scenario you get a force-quit, or your LED won't turn off, forcing a battery pull
Click to expand...
Click to collapse
I'm not going to do that, however your answer is extremely helpful now that I know it's caused by settings provider. Do you know how I could use a different settings provider in Eclipse? I could take the CM10.1 from the git of the ROM I'm using and somehow use it in Eclipse.
I really find it strange that I can only find a couple other people asking the same question as I. Do people not edit a single app from Cyanogenmod or some other ROM like AOKP without rebuilding the entire source? Upon doing some more Googling, it seems I need an Android.jar from Cyanogenmod.
Hoew I get this, I'm not sure.
admiralspeedy said:
I really find it strange that I can only find a couple other people asking the same question as I. Do people not edit a single app from Cyanogenmod or some other ROM like AOKP without rebuilding the entire source? Upon doing some more Googling, it seems I need an Android.jar from Cyanogenmod.
Hoew I get this, I'm not sure.
Click to expand...
Click to collapse
Well, I think they generally pull whatever APK they want, and then modify it to make it work. In some instances, that means changing other apks due to interdependency. Maybe someone who's familiar with building in eclipse could point you in a better direction...
I did it. I followed a guide to build a custom Android.jar from my phones framework.jar and Eclipse wouldn't build after because of it, so instead I only replaced the class files for settingprovider and my app had no errors after. I then saved the class files I edited, decompiled the classes.dex from the existing Torch APK and replaced the classes in it with my edited ones, recompiled that into a new classes.dex and put that in the Torch APK and it worked!

Modding dialer to being black

Hello,
I was wondering if there is anyone that might be able to give me a little advice.
I am decompiling the dialer app and trying to convert it to being a black dialer like the international version.
I am running into a problem after I recompile it to test it causes it not to work at all.
I am not sure if it needs to be signed or maybe there is a problem with the way the compile is working even though I am not getting any errors.
I have recompiled framework a few times and that has worked okay.
I am just trying to change the colors xml and have not changed any of the images, I am not sure if that might be an issue or not.
Or if I might even need to switch out the image files as well.
Any help on this would be greatly appreciated.
TheArtiszan said:
I am not sure if it needs to be signed or maybe there is a problem with the way the compile is working even though I am not getting any errors.
Click to expand...
Click to collapse
It's great that you want to learn how to invert or theme apps. But without meaning to discourage you, you need to do some reading. Quite a bit of reading by the sounds of it. There are a lot of threads on this subject, complete with tips, examples and introductory guides.
I can't shake the impression that you haven't read many threads about theming. And you seem to want the answer handed to you, rather than put a little work into learning this. You aren't asking a simple, straight forward question. You are asking for someone to teach you all of the ins and outs when you could easily find a tutorial yourself. Put a little initiative and work into this and then you will have something to be legitimately proud of when you finish inverting an app.
Unless you have an unusually easy app, you are probably missing multiple steps. You normally need multiple frameworks, emsure that your decompiler is up to date and yes there will be signing too. .9 pngs need special tools, you may need to edit dozens of image files and xml code too.
I'd encourage you to stick with it. But don't expect to succeed before you make an effort to read at least a handful of threads and guides and figure some of it out yourself.
.
Maybe start here:
http://forum.xda-developers.com/showthread.php?t=2524248
http://forum.xda-developers.com/showthread.php?t=2203166
http://forum.xda-developers.com/showthread.php?t=916814
http://forum.xda-developers.com/showpost.php?p=46723334&postcount=27
http://www.elementalxdesigns.com/ec...OOL-APK-Multi-Tool-Decompile-and-Compile-apks
.
You are having a signature missmatch error. You can try the xposed module to force matching of signatures. If that works, then i'll tell you what to do next.
fffft said:
Maybe start here:
http://forum.xda-developers.com/showthread.php?t=2524248
http://forum.xda-developers.com/showthread.php?t=2203166
http://forum.xda-developers.com/showthread.php?t=916814
http://forum.xda-developers.com/showpost.php?p=46723334&postcount=27
http://www.elementalxdesigns.com/ec...OOL-APK-Multi-Tool-Decompile-and-Compile-apks
.
Click to expand...
Click to collapse
Oh I totally understand what you are saying.
Sorry, I wrote that on very little sleep and rereading it, it is not very clear.
I have moded things like the play store and dialer and other things before.
I have used the apktool.jar that is up to date, installed the framework-res twframework and systemui apks as dependencies like what are needed.
It is just that if all I do is decompile it and recompile it with no changes it does not work.
This has always at least worked in the past if I have not made any changes before recompiling to insure that the process is working okay.
And it seems not to in this case.
I get no errors from the recompile or any warnings even.
This was not covered in any of the tutorials I had read before or found on a google search.
You didn't get a popup message with an explicit error message. But the information about the errors is still there in the system logs, event viewer, logcat, etc. Without those key details we can't really troubleshoot in a methodical fashion, but it is still possible to guess at the cause.
And a bad signature is a plausible guess. So start by checking that. A good way to approach it next time would be to try decompiling and putting a package back together again (before trying any serious edits) to see if your configuration is working or not.
.
.
TheArtiszan said:
Oh I totally understand what you are saying.
Sorry, I wrote that on very little sleep and rereading it, it is not very clear.
I have moded things like the play store and dialer and other things before.
I have used the apktool.jar that is up to date, installed the framework-res twframework and systemui apks as dependencies like what are needed.
It is just that if all I do is decompile it and recompile it with no changes it does not work.
This has always at least worked in the past if I have not made any changes before recompiling to insure that the process is working okay.
And it seems not to in this case.
I get no errors from the recompile or any warnings even.
This was not covered in any of the tutorials I had read before or found on a google search.
Click to expand...
Click to collapse
fffft said:
Clear like mud. I understand that you didn't get a popup message with an explicit error message. But that information would still be in your system logs, event viewer, logcat, etc. And we could have looked at the signatures if you had linked the files too. Since we don't have any of that though, we can't really troubleshoot in a methodical fashion - we have nothing to go on. It would have helped if you posted your system error logs, event log, logcat, the app signatures, etc.
Without any details, the guess above is as good as any for a place to start. A bad signature is a plausible cause to your problems. The very first thing you should have done is decompile and recompile without any changes. Then the same with a single, simple edit to confirm that your configuration is valid.
So to start.. confirm that your signature is valid.
.
Click to expand...
Click to collapse
It is a signature mismatch. The dialer has a shared user ID with the system. If the signature that the system uses does not match to that of the dialer, then it denies all permissions and denies installation of the package. Trying the xposed module first will be the easiest option (plus i wanna see if it works ) then i'll help you figure out how to get it working without the xposed module.
elesbb said:
It is a signature mismatch. The dialer has a shared user ID with the system. If the signature that the system uses does not match to that of the dialer, then it denies all permissions and denies installation of the package. Trying the xposed module first will be the easiest option (plus i wanna see if it works ) then i'll help you figure out how to get it working without the xposed module.
Click to expand...
Click to collapse
Ahh Okay thank you.
That was what I was thinking the problem was but wasn't sure.
Especially more so that I am on a all stock odexed rom.
I will give that a try later when I have a little time and let you know what happens.

Possible root direction.

First off, before I get into it; nay sayers and trolls please keep the thread clear. Hopefully we can figure something and more minds together normally equal victory.
Last night an idea hit me, I use a hack with Windows that allows admin permissions and I don't have enough info about android apks to say that it wont work.
In Windows (yes I know they are way different) if you can figure a way to temp change one sys program to be command prompt, you can add users, change admin passwords, delete logs and the such. Basically you own the box at that point. Im not going to go into the details cause as far as I know M $ hasnt fixed it and I dont want them to.
So if we can find an apk with root writing permissions and can change it to be a term emulator we should be able to chmod root.
I have made some attempts, using the hidden menu apk. I figure it can change the prop file it should have root privileges; with no luck. Maybe I am not repackaging the apk correctly or something?
If someone that knows more about apks thinks it may be a possibility lets get to cooking!
The Command Prompt trick you're talking about is very well known. It's been around since Vista and has yet to be patched and unlikely to be due to the nature of how it works.
Thanks Pirate, I know what versions it works with. But I guess no one knows how we can possibly accomplish the same in android.
Zer0C0oL said:
Thanks Pirate, I know what versions it works with. But I guess no one knows how we can possibly accomplish the same in android.
Click to expand...
Click to collapse
If you did, wouldn't you end up in a bootloop due to dm-verity, or is this not modifying /system?
Lifehags said:
If you did, wouldn't you end up in a bootloop due to dm-verity, or is this not modifying /system?
Click to expand...
Click to collapse
The way I understand the DMVerity mechanism is it rebuilds its trust chain every time a legitimate system change is made. When you perform a PRL update, the app makes a change to the system. This does not equal bootloops and I believe we can accomplish the same via this hack, if apk permissions can be loaned.
In the M$ hack you can't leave the change in place as it messes up other processes. Basically you use it to add a user with admin permissions/ open a backdoor and then cover your tracks: which one step is reverting the swap so there are no system issues for the users to find.
Alas, I fear the people this post should be reaching are the ones working towards claiming the bounty and for that reason collaboration will be non-existent.
@Zer0C0oL, please note that unless you are a developer working on a recovery, ROM or a Kernel, you should not be posting the development section. Please refer to this announcement if you have any questions.
I've moved this thread to the How-To section where it belongs.
Cheers :good:
Zer0C0oL said:
First off, before I get into it; nay sayers and trolls please keep the thread clear. Hopefully we can figure something and more minds together normally equal victory.
Last night an idea hit me, I use a hack with Windows that allows admin permissions and I don't have enough info about android apks to say that it wont work.
In Windows (yes I know they are way different) if you can figure a way to temp change one sys program to be command prompt, you can add users, change admin passwords, delete logs and the such. Basically you own the box at that point. Im not going to go into the details cause as far as I know M $ hasnt fixed it and I dont want them to.
So if we can find an apk with root writing permissions and can change it to be a term emulator we should be able to chmod root.
I have made some attempts, using the hidden menu apk. I figure it can change the prop file it should have root privileges; with no luck. Maybe I am not repackaging the apk correctly or something?
If someone that knows more about apks thinks it may be a possibility lets get to cooking!
Click to expand...
Click to collapse
I'm pretty sure it may be possible however impossible to avoid tripping knox.

Exchange platform-signature in custom ROM

Hi there -
short prologue: I am working on my bachelor thesis and must develop a service that keeps a record of how often a user actively uses the application permission settings of Android 6 and above. The main goal is to have a custom ROM which can be deployed on several phones to conduct a survey.
I identified the file where these settings are stored:
Code:
/system/users/0/runtime-permissions.xml
I want to set up a service running a FileObserver to keep track of the changes in this file. The file is not accessible by normal applications (permission -rw-------) but the service has to run without superuser.
So I want to sign my application with the platform key to obtain system permissions. I am totally clear on the purpose of this security concept and I know that I cannot get the original key. The resulting ROM is not going to be public and is used only in a controlled group for research purposes.
My question is how to exchange the signature/key with what the system applications of my actual ROM are signed. So that I sign my own apk with the same key so it has the special permission. I found the answer to this exact question on stackoverflow but it is quite old and I did not succeed with this explanation.
Do you know if there is another, more current approach?
Thanks in advance!
Device is a Xiaomi Redmi 4X running stock MIUI 9 (Android 7.1.2)
Just have the app built as part of the rom. This will make sure they both have the same signature.
zelendel said:
Just have the app built as part of the rom. This will make sure they both have the same signature.
Click to expand...
Click to collapse
What do you mean by "built as part of the rom"? I cannot build the rom from aosp because the device should run the original MIUI firmware. I used SuperR's Kitchen to modify the rom. Is this not suitable?
That will not work no. Maybe you could try using their patch rom setup. As very little is done with miui here, you mugjt be better off asking in n their forums.
zelendel said:
That will not work no. Maybe you could try using their patch rom setup. As very little is done with miui here, you mugjt be better off asking in n their forums.
Click to expand...
Click to collapse
Can you explain, why this wont work? I supposed I just have to exchange all the signed apk files. When I re-sign them with apksigner then they also obtain the self-signed certificate containing the public key. So why is this not enough? Is there another instance in the OS which checks the app signature on boot?
The entire system partition uses the same signature. So I guess you could go through and recompile everything with the new key but I doubt it would work. Many oem system apps won't work without their oem signature.
Like I said. You maybe better off asking over in the miui forums as very little is done here for it.

Categories

Resources