I am trying to edit the handheld_core_hardware.xml in `system/etc/permissions
when i push the file after editing it gives that error
adb: error: failed to copy 'handheld_core_hardware.xml' to '/system/etc/permissions/handheld_core_hardware.xml': remote Permission denied
handheld_core_hardware.xml: 0 files pushed. 0.8 MB/s (4027 bytes in 0.005s)
even that i have changed the file to read-write not read-only
Is your device rooted ? I think in order to manipulate those files you have root permissions.
Related
I want to write test file to SDCard with Android 11, I close selinux with "adb shell setenforce 0", but fopen() will give errno 13 error,how to fix it? Thanks.
With selinux as permissive, you also need to check if the HAL executable has appropriate permissions to be able to create a file in the destination path. Check username and group name for HAL executable and the destination path.
For example: if HAL executable has 'system' user, /data/<file-name.extn> can be used as destination which has both user and group as 'system'.
I need to execute an sh file using commandline option from the android program. I tried using Runtime.getRuntime().exec. I tried to pass the command as string as well as string[]. But still the issue exists. I have already given permission for read and write in external storage in manifest file.
I tried by using the paths such as
getContext().getFilesDir() +
"/data/user/0//files/..."
Environment.getExternalStorageDirectory() +
path in our system such as C:\Users\...
I tried using cp, rm, ls....and the commands that I needed actually..
For all the above trials, IO Exception occurred. (Either Permission denied or No such file or directory)
Could you know a possible solution to get out of this error and execute the sh file using command line in android program.
Thank you in advance
I am trying to implement OTA functionality for a msm8998 board running Android 8.1.
I've generated the OTA file and followed the standard way of doing it,
I've run into two problems, solving either one would solve the issue:
OTA size is bigger than /cache, therefore even though recovery can mount /cache, the image cannot fit there. How would I increase the /cache size, and is it a good idea to do so?
If I put the OTA zip in /data/ or /sdcard/, I have an error during recovery, seemingly it can't mount it. How would I make /data/ mountable?
...
Finding update package...
I:Update location: /data/update.zip
Opening update package...
E:Failed to mount /data: Invalid argument
E:Unable to open '/data/update.zip': No such file or directory
E:failed to map file
W:failed to read uncrypt status: No such file or directory
W:Failed to read /sys/class/thermal/thermal_zone28/temp: Invalid argument
W:Failed to read /sys/class/thermal/thermal_zone27/temp: Invalid argument
I:current maximum temperature: 44756
I:/data/update.zip
I:0
I:time_total: 0
I:retry: 0
I:temperature_start: 44814
I:temperature_end: 44756
I:temperature_max: 44814
I:
Installation aborted.
Turns out you have to use RecoverySystem.installPackage(...) method AND have the OTA file be in /data/.
Previously I had tried RecoverySystem.installPackage(...) method but with file in /sdcard/, and separately by setting /cache/recovery/command myself and using /data/
When using RecoverySystem.installPackage(...) and the file in /data/, seems uncrypt is run on it before reboot, and that makes the update accessible to the recovery.
I am trying to do method profiling for my application on Android 2.1 htc eris. It complains:
06-15 15:48:04.602: E/dalvikvm(826): Unable to open trace file '/sdcard/com.mayapp.trace': Permission denied
I have the following entry for user permission on my AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
When I do adb push, I get the following error:
adb push AndroidManifest.xml a.txt
failed to copy 'AndroidManifest.xml' to 'a.txt': Read-only file system
Am I missing something here?
This may not be the answer but you could use
File dir = Environment.getExternalStorageDirectory();
to access external sd card. My assumption is you wrote the directory yourself.
It was a combination of badly placed sd card and read/write access to the sdcard. Used adb push/pull to verify the sd card and also used adb remount to change the access. that solved the issue.
I want to create a file in the /system directory. I think that directory is "protected" and the phone must be rooted to access and create to it.
I used this simple code to create a file in /system but nothing is created:
File file = new File("/system", "test.prop");
How can i solve that problem?
Thank you for your help.
I can't tell how to implement the following steps but I think it's not too hard to find a solution on the net:
acquire root-access for your application
check if /system is mounted with option rw, if not, remount it so
hint: use the "adb shell" and check if the upper steps can lead to success
(su && remount -o remount,rw /system && touch /system/test)
On some devices there's the unlucky chance that the internal memory is in protected mode (google S-ON / S-OFF). If this is the case for you it will not be that easy like I imagined.
But even than it must be possible, since the market is installing files there. This would be the last hint, to look at the market source-code ;/
You need to call following method on file object
file.createNewFile();
On executing this following error comes because of read-only directory
11-09 19:45:15.136: E/VideoSample(4245): java.io.IOException: open failed: EROFS
(Read-only file system)
11-09 19:45:15.136: E/VideoSample(4245): at
java.io.File.createNewFile(File.java:940)