I have already searched the Internet for an answer to my problem, but, unfortunately, I could not find a solution to my problem. I even wrote in this case on the official forum , unfortunately, the moderators could not cope with this problem. Below I describe the problem, hoping that someone had a similar problem and she knows the solution.
I made an application that works fine on Android 4.1, so I reject the problems associated with the lack of "something." At the moment, it seems that there is an error in new versions of android, because after updating to Android 4.3+ (API 18+) my application shows a message:
/ cache / recovery / command: open failed: EACCESS (permission denied)
My application is a system application, so the *.apk file was placed in the /system/app/ directory with the appropriate file permissions (chmod), so context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM is 1.
Since the application uses the RecoverySystem.installPackage(...) method, I added permissions:
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" /> <uses-permission android:name="android.permission.REBOOT" /> <uses-permission android:name="android.permission.DELETE_CACHE_FILES" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
More than the required minimum, because among other applications my application uses the RecoverySystem.verifyPackage(...) method RecoverySystem.verifyPackage(...) In addition, this method had problems after updating to Android 4.3+, but these problems were solved after adding one of (or all) permissions:
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
Note: For testing, I added to the manifest file also all possible permissions that are available, but this does not solve the problem.
Once again, I want to emphasize that the application works correctly before upgrading to android 4.3+. After the update, an error message appears:
/ cache / recovery / command: open failed: EACCESS (permission denied)
This error occurs when the RecoverySystem.installPackage(...) method is called. ( FileWriter command = new FileWriter(COMMAND_FILE); where COMMAND_FILE == /cache/recovery/command )
I am not sure, but I think that one of the possible reasons may be an error in "bootable / recovery / recovery.c", but I can not find confirmation.
If anyone can help, I would be grateful.
PS To avoid unrest on the Internet, do not publish texts such as "use Google", "it was already - I saw it somewhere - but I canβt remember where," "I have the same problem / also does not work for me" , and other messages that do not help solve the problem.
@ shiri-hrw Thanks for the answer.
after adding android: sharedUserId = "com.google.uid.shared" to the application manifest (AndroidManifest.xml), an error occurred:
Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE Please check the logcat output for more details. Launch canceled!
Logcat
The package com.example.test does not have signatures that correspond to those found in the common user com.google.uid.shared ; not paying attention!
and / or
The com.example.test package does not have signatures that match those found in the public file android.uid.system ; not paying attention!
You wrote:
... since your application is not signed with google signatures ...
but after applying the sign, using the * .pk8 and * .x509.pem files, which can be found in the build / target / product / security file in pulbic sdk.
java -jar SignApk.jar platform.x509.pem platform.pk8 Application.apk Application_signed.apk
and / or
java -jar SignApk.jar shared.x509.pem shared.pk8 Application.apk Application_signed.apk
the error is still happening.
When I click my application on the system / application (and reboots), the application does not appear in the applications.