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
5fb071d8
Commit
5fb071d8
authored
Feb 10, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge app scripts
parent
022151fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
RootInit.kt
...src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt
+2
-3
manager.sh
app/src/main/res/raw/manager.sh
+21
-1
nonroot_utils.sh
app/src/main/res/raw/nonroot_utils.sh
+0
-13
No files found.
app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt
View file @
5fb071d8
...
@@ -16,12 +16,11 @@ class RootInit : Shell.Initializer() {
...
@@ -16,12 +16,11 @@ class RootInit : Shell.Initializer() {
fun
init
(
context
:
Context
,
shell
:
Shell
):
Boolean
{
fun
init
(
context
:
Context
,
shell
:
Shell
):
Boolean
{
val
job
=
shell
.
newJob
()
val
job
=
shell
.
newJob
()
job
.
add
(
context
.
rawResource
(
R
.
raw
.
manager
))
if
(
shell
.
isRoot
)
{
if
(
shell
.
isRoot
)
{
job
.
add
(
context
.
rawResource
(
R
.
raw
.
util_functions
))
job
.
add
(
context
.
rawResource
(
R
.
raw
.
util_functions
))
.
add
(
context
.
rawResource
(
R
.
raw
.
utils
)
)
.
add
(
"SHA1=`grep_prop SHA1 /sbin/.magisk/config`"
)
Const
.
MAGISK_DISABLE_FILE
=
SuFile
(
"/cache/.disable_magisk"
)
Const
.
MAGISK_DISABLE_FILE
=
SuFile
(
"/cache/.disable_magisk"
)
}
else
{
job
.
add
(
context
.
rawResource
(
R
.
raw
.
nonroot_utils
))
}
}
job
.
add
(
job
.
add
(
...
...
app/src/main/res/raw/
utils
.sh
→
app/src/main/res/raw/
manager
.sh
View file @
5fb071d8
##################################
# Magisk Manager internal scripts
##################################
env_check
()
{
env_check
()
{
for
file
in
busybox magisk magiskboot magiskinit util_functions.sh boot_patch.sh
;
do
for
file
in
busybox magisk magiskboot magiskinit util_functions.sh boot_patch.sh
;
do
[
-f
$MAGISKBIN
/
$file
]
||
return
1
[
-f
$MAGISKBIN
/
$file
]
||
return
1
...
@@ -116,4 +120,20 @@ force_pm_install() {
...
@@ -116,4 +120,20 @@ force_pm_install() {
return
$res
return
$res
}
}
SHA1
=
`
grep_prop SHA1 /sbin/.magisk/config
`
##########################
# Non-root util_functions
##########################
mount_partitions
()
{
[
"
`
getprop ro.build.ab_update
`
"
=
"true"
]
&&
SLOT
=
`
getprop ro.boot.slot_suffix
`
# Check whether non rootfs root dir exists
grep
' / '
/proc/mounts |
grep
-qv
'rootfs'
&&
SYSTEM_ROOT
=
true
||
SYSTEM_ROOT
=
false
}
get_flags
()
{
$SYSTEM_ROOT
&&
KEEPVERITY
=
true
||
KEEPVERITY
=
false
[
"
`
getprop ro.crypto.state
`
"
=
"encrypted"
]
&&
KEEPFORCEENCRYPT
=
true
||
KEEPFORCEENCRYPT
=
false
RECOVERYMODE
=
false
}
run_migrations
()
{
return
;
}
app/src/main/res/raw/nonroot_utils.sh
deleted
100644 → 0
View file @
022151fe
mount_partitions
()
{
[
"
`
getprop ro.build.ab_update
`
"
=
"true"
]
&&
SLOT
=
`
getprop ro.boot.slot_suffix
`
# Check whether non rootfs root dir exists
grep
' / '
/proc/mounts |
grep
-qv
'rootfs'
&&
SYSTEM_ROOT
=
true
||
SYSTEM_ROOT
=
false
}
get_flags
()
{
$SYSTEM_ROOT
&&
KEEPVERITY
=
true
||
KEEPVERITY
=
false
[
"
`
getprop ro.crypto.state
`
"
=
"encrypted"
]
&&
KEEPFORCEENCRYPT
=
true
||
KEEPFORCEENCRYPT
=
false
RECOVERYMODE
=
false
}
run_migrations
()
{
return
;
}
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