Save boot kmsg (#1688)
This commit is contained in:
parent
a72f59d07a
commit
a32d4fc0ab
|
|
@ -226,11 +226,16 @@ public class ConfigFileManager {
|
||||||
return logDirPath.resolve(getNewLogFileName("modules")).toFile();
|
return logDirPath.resolve(getNewLogFileName("modules")).toFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
static File getpropsLogPath() throws IOException {
|
static File getPropsPath() throws IOException {
|
||||||
createLogDirPath();
|
createLogDirPath();
|
||||||
return logDirPath.resolve("props.txt").toFile();
|
return logDirPath.resolve("props.txt").toFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static File getKmsgPath() throws IOException {
|
||||||
|
createLogDirPath();
|
||||||
|
return logDirPath.resolve("kmsg.log").toFile();
|
||||||
|
}
|
||||||
|
|
||||||
static void getLogs(ParcelFileDescriptor zipFd) throws RemoteException {
|
static void getLogs(ParcelFileDescriptor zipFd) throws RemoteException {
|
||||||
try (var os = new ZipOutputStream(new FileOutputStream(zipFd.getFileDescriptor()))) {
|
try (var os = new ZipOutputStream(new FileOutputStream(zipFd.getFileDescriptor()))) {
|
||||||
var comment = String.format(Locale.ROOT, "LSPosed %s %s (%d)",
|
var comment = String.format(Locale.ROOT, "LSPosed %s %s (%d)",
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public class LogcatService implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
getprop();
|
getprop();
|
||||||
|
dmesg();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void getprop() {
|
private static void getprop() {
|
||||||
|
|
@ -46,7 +47,7 @@ public class LogcatService implements Runnable {
|
||||||
try {
|
try {
|
||||||
SELinux.setFSCreateContext("u:object_r:app_data_file:s0");
|
SELinux.setFSCreateContext("u:object_r:app_data_file:s0");
|
||||||
new ProcessBuilder("sh", "-c", cmd)
|
new ProcessBuilder("sh", "-c", cmd)
|
||||||
.redirectOutput(ConfigFileManager.getpropsLogPath())
|
.redirectOutput(ConfigFileManager.getPropsPath())
|
||||||
.start();
|
.start();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "getprop: ", e);
|
Log.e(TAG, "getprop: ", e);
|
||||||
|
|
@ -55,6 +56,16 @@ public class LogcatService implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void dmesg() {
|
||||||
|
try {
|
||||||
|
new ProcessBuilder("dmesg")
|
||||||
|
.redirectOutput(ConfigFileManager.getKmsgPath())
|
||||||
|
.start();
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(TAG, "dmesg: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private native void runLogcat();
|
private native void runLogcat();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue