Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8304c54b8c | ||
|
|
8ddca5f310 | ||
|
|
d4d42cae0d |
@@ -17,6 +17,7 @@ fun getBugreportFile(context: Context): File {
|
|||||||
val bugreportDir = File(context.cacheDir, "bugreport")
|
val bugreportDir = File(context.cacheDir, "bugreport")
|
||||||
bugreportDir.mkdirs()
|
bugreportDir.mkdirs()
|
||||||
|
|
||||||
|
val processFile = File(bugreportDir, "process.txt")
|
||||||
val dmesgFile = File(bugreportDir, "dmesg.txt")
|
val dmesgFile = File(bugreportDir, "dmesg.txt")
|
||||||
val logcatFile = File(bugreportDir, "logcat.txt")
|
val logcatFile = File(bugreportDir, "logcat.txt")
|
||||||
val tombstonesFile = File(bugreportDir, "tombstones.tar.gz")
|
val tombstonesFile = File(bugreportDir, "tombstones.tar.gz")
|
||||||
@@ -40,8 +41,10 @@ fun getBugreportFile(context: Context): File {
|
|||||||
|
|
||||||
val shell = getRootShell(true)
|
val shell = getRootShell(true)
|
||||||
|
|
||||||
shell.newJob().add("dmesg > ${dmesgFile.absolutePath}").exec()
|
// busybox ps has very few features for embed devices
|
||||||
shell.newJob().add("logcat -d > ${logcatFile.absolutePath}").exec()
|
shell.newJob().add("toybox ps -T -A -w -o PID,TID,UID,COMM,CMDLINE,CMD,LABEL,STAT,WCHAN > ${processFile.absolutePath}").exec()
|
||||||
|
shell.newJob().add("dmesg -r > ${dmesgFile.absolutePath}").exec()
|
||||||
|
shell.newJob().add("logcat -b all -v uid -d > ${logcatFile.absolutePath}").exec()
|
||||||
shell.newJob().add("tar -czf ${tombstonesFile.absolutePath} -C /data/tombstones .").exec()
|
shell.newJob().add("tar -czf ${tombstonesFile.absolutePath} -C /data/tombstones .").exec()
|
||||||
shell.newJob().add("tar -czf ${dropboxFile.absolutePath} -C /data/system/dropbox .").exec()
|
shell.newJob().add("tar -czf ${dropboxFile.absolutePath} -C /data/system/dropbox .").exec()
|
||||||
shell.newJob().add("tar -czf ${pstoreFile.absolutePath} -C /sys/fs/pstore .").exec()
|
shell.newJob().add("tar -czf ${pstoreFile.absolutePath} -C /sys/fs/pstore .").exec()
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ pub fn on_post_data_fs() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let _ = catch_bootlog("logcat", &["logcat"]);
|
let _ = catch_bootlog("logcat", &["logcat", "-b", "all"]);
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let _ = catch_bootlog("dmesg", &["dmesg", "-w"]);
|
let _ = catch_bootlog("dmesg", &["dmesg", "-w", "-r"]);
|
||||||
|
|
||||||
if utils::has_magisk() {
|
if utils::has_magisk() {
|
||||||
warn!("Magisk detected, skip post-fs-data!");
|
warn!("Magisk detected, skip post-fs-data!");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use crate::{
|
|||||||
use anyhow::{Context, Ok, Result, bail};
|
use anyhow::{Context, Ok, Result, bail};
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use libc::c_int;
|
use libc::c_int;
|
||||||
use log::{error, warn};
|
use log::error;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::process::CommandExt;
|
use std::os::unix::process::CommandExt;
|
||||||
use std::{
|
use std::{
|
||||||
@@ -75,7 +75,6 @@ fn set_identity(uid: u32, gid: u32, groups: &[u32]) {
|
|||||||
fn wrap_tty(fd: c_int) {
|
fn wrap_tty(fd: c_int) {
|
||||||
let inner_fn = move || -> Result<()> {
|
let inner_fn = move || -> Result<()> {
|
||||||
if unsafe { libc::isatty(fd) != 1 } {
|
if unsafe { libc::isatty(fd) != 1 } {
|
||||||
warn!("not a tty: {fd}");
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let new_fd = get_wrapped_fd(fd).context("get_wrapped_fd")?;
|
let new_fd = get_wrapped_fd(fd).context("get_wrapped_fd")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user