I flashed my phone firmware LineageOS 13 Android 6.0.1 (Marshmallow). I hava also access root.
I created app for updater other an apps. This app put into /system/app. This app trying create file into /system, but it get error (Read-only file system).
here code
try {
Runtime.getRuntime().exec("su && su mount -o rw,remount /system");
try(PrintWriter out = new PrintWriter(PATH + "/hash")) {
out.println(body);
}
Log.i(TAG, "create hash");
}
catch(Exception e1) {
e1.printStackTrace();
Log.e(TAG, e1.getMessage());
}
here stack trace
W/System.err: java.io.FileNotFoundException: /system/hash: open failed: EROFS (Read-only file system)
W/System.err: at libcore.io.IoBridge.open(IoBridge.java:452)
W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
W/System.err: at java.io.PrintWriter.<init>(PrintWriter.java:168)
W/System.err: at net.lockoil.updaterutmhelper.UpdaterService$Task$1.onResponse(UpdaterService.java:99)
W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
W/System.err: at android.os.Handler.handleCallback(Handler.java:739)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err: at android.os.Looper.loop(Looper.java:148)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5461)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
W/System.err: Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
W/System.err: at libcore.io.Posix.open(Native Method)
W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
W/System.err: at libcore.io.IoBridge.open(IoBridge.java:438)
How I can write something into /system programmatically?