private static synchronized String readSystemFileContent(final String path) { final String tmpPath = getUniqueTmpFileName(); final List<String> results = Root.exec( String.format("cp '%s' '%s'", path, tmpPath), String.format("chmod 777 '%s'", tmpPath)); if (results == null) return null; final String result = readFileContent(tmpPath); Root.exec(String.format("rm -f '%s'", tmpPath)); return result; }
private static synchronized String readSystemFileContent(final String path) { final String tmpPath = getUniqueTmpFileName(); final List<String> results = Root.exec( String.format("cp '%s' '%s'", path, tmpPath), String.format("chmod 777 '%s'", tmpPath)); if (results == null) return null; final String result = readFileContent(tmpPath); Root.exec(String.format("rm -f '%s'", tmpPath)); return result; }
private static synchronized String readSystemFileContent(final String path) { final String tmpPath = getUniqueTmpFileName(); final List<String> results = Root.exec( String.format("cp '%s' '%s'", path, tmpPath), String.format("chmod 777 '%s'", tmpPath)); if (results == null) return null; final String result = readFileContent(tmpPath); Root.exec(String.format("rm -f '%s'", tmpPath)); return result; }
private static synchronized boolean writeSystemFileContent(final String path, final String content) { final String tmpPath = getUniqueTmpFileName(); if (!writeFileContent(tmpPath, content)) { UserError.Log.e(TAG, "Failed to write to: " + path); return false; } // TODO detect failure?? Root.exec( String.format("cat '%s' > '%s'", tmpPath, path), String.format("rm -f '%s'", tmpPath)); return true; }
private static synchronized boolean writeSystemFileContent(final String path, final String content) { final String tmpPath = getUniqueTmpFileName(); if (!writeFileContent(tmpPath, content)) { UserError.Log.e(TAG, "Failed to write to: " + path); return false; } // TODO detect failure?? Root.exec( String.format("cat '%s' > '%s'", tmpPath, path), String.format("rm -f '%s'", tmpPath)); return true; }
private static synchronized boolean writeSystemFileContent(final String path, final String content) { final String tmpPath = getUniqueTmpFileName(); if (!writeFileContent(tmpPath, content)) { UserError.Log.e(TAG, "Failed to write to: " + path); return false; } // TODO detect failure?? Root.exec( String.format("cat '%s' > '%s'", tmpPath, path), String.format("rm -f '%s'", tmpPath)); return true; }