Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP KraZbi

25th April 2014, 11:15 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Apr 2014
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:
Quote:

/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:
Quote:

/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 by KraZbi; 25th April 2014 at 11:26 AM. Reason: change notification type
25th April 2014, 12:26 PM   |  #2  
Masrepus's Avatar
Senior Member
Thanks Meter: 79
 
705 posts
Join Date:Joined: Feb 2013
More
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 by Masrepus; 25th April 2014 at 12:31 PM.
25th April 2014, 03:44 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Apr 2014
Quote:
Originally Posted by Masrepus

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
25th April 2014, 05:47 PM   |  #4  
Masrepus's Avatar
Senior Member
Thanks Meter: 79
 
705 posts
Join Date:Joined: Feb 2013
More
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
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes