I'm creating a custom Android build (based on AOSP 4.0.1) and I need to be able to programatically enable and disable NFC from an app. After a little trial and error, I realized that the app would require the WRITE_SECURE_SETTINGS permissions, which is never given by Android to any non-system app. Installing the app as a system-app is not an option, since the android rom and the app will have to be distributed separately.
So my idea is (and considering that I'm creating a custom build) to find the file in the android source where it says that the NFC enable/disable setting requires the WRITE_SECURE_SETTINGS permission and then disable that. Can anyone point me to where this file would be located in the android source?
Related
Hi all,
I'm interested in developing a custom Android ROM that includes custom permissions which grant read/write access over certain character devices to third-party apps; is there a way to bind custom permissions to a specific a set of apps (defined by expected package signature, for instance, since they would not be built in to the ROM) which can take advantage of these custom permissions and would be the only apps allowed to do so?
thanks,
CCJ
I'm using Lenovo Ideatab A3000-h,
I want to make it to be set to run only one app after booting, not even the home page could run then, it will open at the app and still at it forever, I know it's a common need and this has been asked a lot of times before, So, after searching I discovered that there is three options :
1- Creating my own Custom ROM.
2- Making my application a launcher application using android manifest.
3- run a kiosk mode like surlock.
4- Modifying AOSP source code.
So, after a lot of search, I found that the third option can be easily broken be entering the tablet in safe mode and try to remove app then, or by removing it from accessing the tab by PC, and the second option can be broken by the same way.
So, all I got now is to use either the first option or the forth option, and when taking about the first option, thanks to NeroYoung I already know how to:
setting up android kitchen.
modifying ROM img files and jar files.
modifying build.prop.
generating the resulted Custom ROM.
but I don't know the way to reach my needs by customizing a ROM, so, all I want to know is how to modify the custom/stock ROM to achieve my requirement of booting to only a specific app. also if there is another way by making (System Backup ----> Modify ----> Restore Modified System) it will be great.
and when taking about the forth option, I already downloaded the source code and did know how to access it's resources, but don't know where is the source code that controls the start-up process and how to modify it. thanks in advance for all future contributors.
One question about AppOps and superuser permissions.
I have browsed the CyanogenMode Lollipop code and seen that the superuser permission is enforced through the AppOpsManager. (see system/extras/su/... )
This is very nice and integrates well with the other permissions management.
IMO, one thing is missing, i.e. the proper hiding the superuser executable from inspection from apps.
I noticed in the code that the permission to handle some special files is also handled through AppOpsManager.
It would be very useful if all requests to see if the superuser executable (/system/xbin/su or /system/bin/su) is present were filtered in the same way by asking the AppOpsManager if the SUPERUSER permission is allowed for the requesting app.
This (I think) would completely hide from non-allowed apps the presence of rooting.
Unfortunately I am not (yet) good enough with the system code to change it, thus it would be nice if some better developer could help doing this change.
Or perhaps this change is already available as a gerrit cherry-pick? Then it would be very nice if you could point it to me.
Hi everyone,
I'm new on xda and I come here because I struggle to install this app on my rooted Galaxy S4 with CyanogenMod 11: "Paiement mobile (pour Orange)" (sorry, I'm new, so I cannot post urls).
In fact, this app has not been declared by the devs (on the Google Play) to be compatible with my phone, despite the fact that I have the specs to run it (NFC payment).
I asked a friend who was able to download the app to upload it on Aptoide, giving me the opportunity to download the apk on my phone (this apk is available in this thread). I tried to install it, but I get the following the error: "app not installed".
I would like to force the installation of the app. I tried many ways, like using apps that use root access on the phone, without success (for example, I tried with "System Apps Installer" on the Google Play, but I get a problem with mounting /system). I also tried to install it with the command line tool, but I get the error "[install_failed_invalid_uri]". I tried to change the permission of the /data/local directory and /data/local/tmp with ES file explorer, but it did not change anything.
In addition to this, I'm not able to enable usb debugging in the developper options (to install the apk with adb), because every time I activate the option, it becomes disabled in the following seconds.
It seems to be a little bit complicated, because I seem to have different problems, but I hope that someone here will be able to help me !
Thanks for your help,
Aquignis.
The issue is most likely Cm. They alter things so some that normally work no longer work
I suceeded to solve the "[install_failed_invalid_uri]" error in the command line tool by also changing the permissions of /data.
After that, I got another error (yes, one more, but the last) that made me discovering what's the real problem in this situation: "install_failed_missing_shared_library". By doing some researches on the web and exploring the apk, I understood that the app use a library called "org.simalliance.openmobileapi" that corresponds to the work of SIMalliance, who developped an API called "Open Mobile API", which notably enables communication with NFC sim cards and must be integrated to the build of the ROM. This system is used by many banks in Europe and has been integrated in the stock ROM of many NFC devices by the important manufacturers, but not by Cyanogenmod devs in the last stable release of CM 11 for the Galaxy S4.
Like you said it, the problem was CM
I asked them if it has been integrated in CM 12, because that is why the app is said to be incompatible with my device by Google Play which automatically checks which libraries are installed on your device (I'm waiting for their answer). The other solution would be to add the library to the CM build by myself, because it seems not to be very complicated, but I'm not qualified enough to do this !
If it is not part of aosp I wouldn't count on it being added to be honest. Not to mention most banking apps refuse to work if the Rom has root as it can cause security issues.
Yes, the root seems to be a problem with some apps according to the work of this man.
On the other hand, I think that this API is important enough to make CM devs pay attention to it, because it is used in many countries (except the USA which use only HCE, I believe). If only I was able to build it myself !
Hello -
I hope someone can help with making my app persistent in my custom ROM.
In the Android manifest, I have flagged my application as "persistent", so that it automatically restarts if it crashes, is less likely to be killed by the system, etc. I know that normal applications cannot use this setting, but I am working on a custom ROM, and I load my application into the priv-app folder, and so I am able to use it.
This works perfectly well on pre-Lollipop phones. However, when I build my APK into an Android 5 ROM, the "persistent" setting is no longer honoured. I can use 'dumpsys activity' to verify that my app is persistent on Android 4.4.4, but not on Android 5.0.
Is there some additional requirement for persistence in Android 5? I see that some system-supplied apps are still persistent, so it's not as if it's completely impossible. Thanks.
Figured it out myself eventually - turns out it was to do with selinux file permissions. I had to use chcon to copy the selinux file context from another file in the priv-app folder to sort it out.
You should put [SOLVED] in your thread title