Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
014105f0
Commit
014105f0
authored
Feb 14, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring back log dumping
parent
b106d1c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
bootstages.cpp
native/jni/core/bootstages.cpp
+20
-0
No files found.
native/jni/core/bootstages.cpp
View file @
014105f0
...
...
@@ -636,6 +636,22 @@ void unlock_blocks() {
close
(
dev
);
}
static
bool
log_dump
=
false
;
static
void
dump_logs
()
{
if
(
log_dump
)
return
;
int
test
=
exec_command_sync
(
"/system/bin/logcat"
,
"-d"
,
"-f"
,
"/dev/null"
);
chmod
(
"/dev/null"
,
0666
);
if
(
test
!=
0
)
return
;
rename
(
LOGFILE
,
LOGFILE
".bak"
);
int
fd
=
xopen
(
LOGFILE
,
O_WRONLY
|
O_APPEND
|
O_CREAT
|
O_CLOEXEC
,
0644
);
exec_t
exec
{
.
fd
=
fd
};
exec_command
(
exec
,
"/system/bin/logcat"
,
"-s"
,
"Magisk"
);
log_dump
=
true
;
close
(
fd
);
}
/****************
* Entry points *
****************/
...
...
@@ -658,6 +674,8 @@ void post_fs_data(int client) {
if
(
!
check_data
())
unblock_boot_process
();
dump_logs
();
LOGI
(
"** post-fs-data mode running
\n
"
);
// Unlock all blocks for rw
...
...
@@ -781,6 +799,8 @@ void late_start(int client) {
write_int
(
client
,
0
);
close
(
client
);
dump_logs
();
if
(
access
(
SECURE_DIR
,
F_OK
)
!=
0
)
{
// It's safe to create the folder at this point if the system didn't create it
xmkdir
(
SECURE_DIR
,
0700
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment