[Q] android:persistent not working on Lollipop? - Android Q&A, Help & Troubleshooting

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

Related

[Q] Removing Write Secure Permission from NFC Settings

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?

[Q] Modifying (android ROM || AOSP source code) to run a tablet with only one app

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.

[Q] Issue with installing an app

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 !

Rooted phone crashes when altering system files

Hello, I've searched up and down and can't find anyone else with this issue. I'm pretty new to rooting/flashing roms/etc but I'm trying to learn as fast as possible.
My current device: Blu Life One x2 Mini
My problem: I've tried a variety of roms, both custom and stock, as well as several different rooting techniques and across all setups I'm seeing the same issue. Any application I check with says that the phone is rooted and my system folder is set to read/write. If I attempt to uninstall a system application, change a file in the system folder, or even change the permissions of /system/ the device will freeze and then after a few seconds reboot. It seems that applications that alter /system/ also generate this crash, for example installing busybox from the application causes a crash.
Setups I've tried:
-Stock rom with Magisk
-Lineage OS 13 with Magisk
-Lineage OS 13 with SuperSU and Magisk (why not?)
-Lineage OS 13 with Lienage root add on (what I'm currently using)
The device operates fine outside of this. Any help is appreciated!

Game Match Master bypass android version control is possible?

hello, this is my first time posting in the forum and I apologize if by any chance I have wrong section of the forum to present my problem.
Basically my problem is this:
Until yesterday with my android device "Samsung Galaxy TAB A" android 7.1.1 version I could play the game "Match Masters" which you can download the apk directly from here "https://play.google.com/store/apps/details?id=com.funtomic.matchmasters&hl=it&gl=IT".
As of today opening the game I get a screen where it tells me that in order to play the game you must have "Android 8 or higher" on your device. I will preface this by saying that I have not updated the app which was working perfectly until yesterday, so I assume the android version check is done server side. I ask if there is a way to circumvent the device version check by going to modify the apk? If yes, what is the procedure?
I thank you for your help.
I also attach the screen with the message
Modifying an app's version would require to rewrite its APK.
xXx yYy said:
Modifying an app's version would require to rewrite its APK.
Click to expand...
Click to collapse
I have downloaded the application "APK editor Studio" which allows you to edit the APK game file in all its parts and then automatically recompiles the new file already signed with the signature in order to install it. The problem is that I don't know what is the string in the APK file that sends the device version check. If I could block or modify this string so that I could make the game think I was using an Android 8 phone, I would be able to play again. Is there any gurus in the field of APK editing who can direct me on how I can edit the file? Thank you, I look forward to hearing from you.
So you want to fool the app about tablet's Android version? If so then that's a complete other thing: this can be done by modifying Android's system file named build.prop what is located in partition /system
Note: Editing build.prop requires Android is got rooted and re-booted after changes made.
xXx yYy said:
So you want to fool the app about tablet's Android version? If so then that's a complete other thing: this can be done by modifying Android's system file named build.prop what is located in partition /system
Note: Editing build.prop requires Android is got rooted and re-booted after changes made.
Click to expand...
Click to collapse
I modified the file you told me by writing the Android 8.0 version but unfortunately opening the game always shows the same screen. I also tried using the emulator application "Bluestacks" on the computer but my computer does not have the requirements to virtualize the game. Is there any emulator that can be installed directly on the tablet that goes to emulate another device?

Categories

Resources