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
0784448c
Commit
0784448c
authored
Nov 20, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove /.backup folder on start
parent
de0064af
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
utils.sh
app/src/full/res/raw/utils.sh
+1
-2
bootstages.cpp
native/jni/daemon/bootstages.cpp
+6
-3
util_functions.sh
scripts/util_functions.sh
+1
-1
No files found.
app/src/full/res/raw/utils.sh
View file @
0784448c
...
@@ -79,9 +79,8 @@ mm_patch_dtbo() {
...
@@ -79,9 +79,8 @@ mm_patch_dtbo() {
}
}
restore_imgs
()
{
restore_imgs
()
{
local
SHA1
=
`
grep_prop SHA1 /
.backup/.magisk
`
local
SHA1
=
`
grep_prop SHA1 /
sbin/.magisk/config
`
[
-z
$SHA1
]
&&
local
SHA1
=
`
cat
/.backup/.sha1
`
[
-z
$SHA1
]
&&
local
SHA1
=
`
cat
/.backup/.sha1
`
[
-z
$SHA1
]
&&
local
SHA1
=
`
grep_prop
#STOCKSHA1 /.backup/.magisk`
[
-z
$SHA1
]
&&
return
1
[
-z
$SHA1
]
&&
return
1
local
STOCKBOOT
=
/data/stock_boot_
${
SHA1
}
.img.gz
local
STOCKBOOT
=
/data/stock_boot_
${
SHA1
}
.img.gz
local
STOCKDTBO
=
/data/stock_dtbo.img.gz
local
STOCKDTBO
=
/data/stock_dtbo.img.gz
...
...
native/jni/daemon/bootstages.cpp
View file @
0784448c
...
@@ -683,9 +683,6 @@ void startup() {
...
@@ -683,9 +683,6 @@ void startup() {
xmount
(
nullptr
,
"/"
,
nullptr
,
MS_REMOUNT
,
nullptr
);
xmount
(
nullptr
,
"/"
,
nullptr
,
MS_REMOUNT
,
nullptr
);
// Remove some traits of Magisk
unlink
(
MAGISKRC
);
// GSIs will have to override /sbin/adbd with /system/bin/adbd
// GSIs will have to override /sbin/adbd with /system/bin/adbd
if
(
access
(
"/sbin/adbd"
,
F_OK
)
==
0
&&
access
(
"/system/bin/adbd"
,
F_OK
)
==
0
)
{
if
(
access
(
"/sbin/adbd"
,
F_OK
)
==
0
&&
access
(
"/system/bin/adbd"
,
F_OK
)
==
0
)
{
umount2
(
"/sbin/adbd"
,
MNT_DETACH
);
umount2
(
"/sbin/adbd"
,
MNT_DETACH
);
...
@@ -710,6 +707,12 @@ void startup() {
...
@@ -710,6 +707,12 @@ void startup() {
setfilecon
(
"/sbin"
,
"u:object_r:rootfs:s0"
);
setfilecon
(
"/sbin"
,
"u:object_r:rootfs:s0"
);
sbin
=
xopen
(
"/sbin"
,
O_RDONLY
|
O_CLOEXEC
);
sbin
=
xopen
(
"/sbin"
,
O_RDONLY
|
O_CLOEXEC
);
// Remove some traces of Magisk
unlink
(
MAGISKRC
);
mkdir
(
MAGISKTMP
,
0755
);
cp_afc
(
"/.backup/.magisk"
,
MAGISKTMP
"/config"
);
rm_rf
(
"/.backup"
);
// Create applet symlinks
// Create applet symlinks
for
(
int
i
=
0
;
applet_names
[
i
];
++
i
)
{
for
(
int
i
=
0
;
applet_names
[
i
];
++
i
)
{
snprintf
(
buf
,
PATH_MAX
,
"/sbin/%s"
,
applet_names
[
i
]);
snprintf
(
buf
,
PATH_MAX
,
"/sbin/%s"
,
applet_names
[
i
]);
...
...
scripts/util_functions.sh
View file @
0784448c
...
@@ -153,7 +153,7 @@ grep_prop() {
...
@@ -153,7 +153,7 @@ grep_prop() {
getvar
()
{
getvar
()
{
local
VARNAME
=
$1
local
VARNAME
=
$1
local
VALUE
=
local
VALUE
=
VALUE
=
`
grep_prop
$VARNAME
/
.backup/.magisk
/data/.magisk /cache/.magisk /system/.magisk
`
VALUE
=
`
grep_prop
$VARNAME
/
sbin/.magisk/config
/data/.magisk /cache/.magisk /system/.magisk
`
[
!
-z
$VALUE
]
&&
eval
$VARNAME
=
\$
VALUE
[
!
-z
$VALUE
]
&&
eval
$VARNAME
=
\$
VALUE
}
}
...
...
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