/cache/recovery/command: open failed: EACCESS (permission denied) - after update

KraZbi

New Member
Joined
Apr 25, 2014
Messages
1
Reaction score
0
Hi everyone,

I already searched in the Internet an answer to my problem, but unfortunately I have not found a solution for my issue. 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 knows the solution.

I made an application that works fine on Android 4.1, which is why I reject the problems associated with the lack of "something".
For now, it seems that in newer versions of android is a bug, because after updating to Android 4.3+ (API 18+) my app shows the message:
/cache/recovery/command: open failed: EACCESS (permission denied)

My application is an system application, so the file '*.apk' was put in directory '/system/app/'
together with a suitable file access permissions (chmod), so that the 'context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM' is equal 1.

Because the application uses the method 'RecoverySystem.installPackage(...)' I added permissions:
Code:
<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 others my application uses the method 'RecoverySystem.verifyPackage(...)'
Also, this method had problems after updating to Android 4.3+, but these problems have been solved after adding one of (or all) permissions:
Code:
<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 manifest file also all the possible permissions that are available, but this does not solve the problem.


Once again, I would like to emphasize that the application works correctly until an update to android 4.3+.
After the update there is an error with the message:
/cache/recovery/command: open failed: EACCESS (permission denied)

This error occurs when call the method 'RecoverySystem.installPackage(...)'.
('FileWriter command = new FileWriter(COMMAND_FILE);' where 'COMMAND_FILE' == '/cache/recovery/command')

I'm not sure, but I think that one of the possible reasons may be bug in the 'bootable/recovery/recovery.c', but I can not find any confirmation.


If anyone can help, I'd be grateful.


P.S. To avoid mess in the Internet, do not post with texts like "use Google", "already it was - I've seen it somewhere - but can not remember where", "I have the same problem / also not working for me", and other posts which do not help solve the problem.
 
Top