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
241f2656
Commit
241f2656
authored
Sep 29, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare for public release
parent
e973d495
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Const.kt
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
+4
-4
SuRequestHandler.kt
...ain/java/com/topjohnwu/magisk/core/su/SuRequestHandler.kt
+1
-1
RootInit.kt
...src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
View file @
241f2656
package
com.topjohnwu.magisk.core
package
com.topjohnwu.magisk.core
import
android.os.Process
import
android.os.Process
import
com.topjohnwu.magisk.BuildConfig
object
Const
{
object
Const
{
...
@@ -26,9 +25,10 @@ object Const {
...
@@ -26,9 +25,10 @@ object Const {
const
val
MIN_VERSION
=
"v19.0"
const
val
MIN_VERSION
=
"v19.0"
const
val
MIN_VERCODE
=
19000
const
val
MIN_VERCODE
=
19000
fun
atLeast_20_2
()
=
Info
.
env
.
magiskVersionCode
>=
20200
fun
atLeast_20_2
()
=
Info
.
env
.
magiskVersionCode
>=
20200
||
isCanary
()
fun
atLeast_20_4
()
=
Info
.
env
.
magiskVersionCode
>=
20400
fun
atLeast_20_4
()
=
Info
.
env
.
magiskVersionCode
>=
20400
||
isCanary
()
fun
atLeastCanary
()
=
Info
.
env
.
magiskVersionCode
>
BuildConfig
.
LATEST_MAGISK
/
100
*
100
fun
atLeast_21_0
()
=
Info
.
env
.
magiskVersionCode
>=
21000
||
isCanary
()
fun
isCanary
()
=
Info
.
env
.
magiskVersionCode
%
100
!=
0
}
}
object
ID
{
object
ID
{
...
...
app/src/main/java/com/topjohnwu/magisk/core/su/SuRequestHandler.kt
View file @
241f2656
...
@@ -67,7 +67,7 @@ class SuRequestHandler(
...
@@ -67,7 +67,7 @@ class SuRequestHandler(
private
suspend
fun
init
(
intent
:
Intent
)
=
withContext
(
Dispatchers
.
IO
)
{
private
suspend
fun
init
(
intent
:
Intent
)
=
withContext
(
Dispatchers
.
IO
)
{
try
{
try
{
val
uid
:
Int
val
uid
:
Int
if
(
Const
.
Version
.
atLeast
Canary
())
{
if
(
Const
.
Version
.
atLeast
_21_0
())
{
val
name
=
intent
.
getStringExtra
(
"fifo"
)
?:
throw
SuRequestError
()
val
name
=
intent
.
getStringExtra
(
"fifo"
)
?:
throw
SuRequestError
()
uid
=
intent
.
getIntExtra
(
"uid"
,
-
1
).
also
{
if
(
it
<
0
)
throw
SuRequestError
()
}
uid
=
intent
.
getIntExtra
(
"uid"
,
-
1
).
also
{
if
(
it
<
0
)
throw
SuRequestError
()
}
output
=
DataOutputStream
(
FileOutputStream
(
name
).
buffered
())
output
=
DataOutputStream
(
FileOutputStream
(
name
).
buffered
())
...
...
app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt
View file @
241f2656
...
@@ -25,7 +25,7 @@ class RootInit : Shell.Initializer() {
...
@@ -25,7 +25,7 @@ class RootInit : Shell.Initializer() {
}
else
{
}
else
{
add
(
"export MAGISKTMP=/sbin/.magisk"
)
add
(
"export MAGISKTMP=/sbin/.magisk"
)
}
}
if
(
Const
.
Version
.
atLeast
Canary
())
{
if
(
Const
.
Version
.
atLeast
_21_0
())
{
add
(
"export ASH_STANDALONE=1"
)
add
(
"export ASH_STANDALONE=1"
)
add
(
"[ -x /data/adb/magisk/busybox ] && exec /data/adb/magisk/busybox sh"
)
add
(
"[ -x /data/adb/magisk/busybox ] && exec /data/adb/magisk/busybox sh"
)
}
else
{
}
else
{
...
...
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