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

Search This thread

KraZbi

New member
Apr 25, 2014
2
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 (groups.google.com/forum/#!forum/android-developers), 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.
 
Last edited:

Masrepus

Senior Member
Feb 12, 2013
767
99
Well i think the problem could be the higher se linux mode that denies the access, as this mode was changed from permissive to enforced at 4.2 or 4.3

---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------

4d 61 73 72 65 70 75 73 20 66 74 77

Gesendet von Tapatalk
 
Last edited:

KraZbi

New member
Apr 25, 2014
2
0
Well i think the problem could be the higher se linux mode that denies the access, as this mode was changed from permissive to enforced at 4.2 or 4.3

---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------

4d 61 73 72 65 70 75 73 20 66 74 77

Gesendet von Tapatalk

Thanks for the reply, it was also checked but changing the mode (permissive/enforced) didn't help
 

Masrepus

Senior Member
Feb 12, 2013
767
99
Hm ya that was the thing that immediately popped into my mind.. If i find something
else ill let you know

---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------

4d 61 73 72 65 70 75 73 20 66 74 77

Gesendet von Tapatalk