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
21466426
Commit
21466426
authored
Jan 25, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some code cleanup
parent
3f013636
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
Hacks.kt
app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt
+1
-1
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+9
-15
ManagerHandler.kt
...java/com/topjohnwu/magisk/core/download/ManagerHandler.kt
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt
View file @
21466426
...
...
@@ -117,7 +117,7 @@ private class JobSchedulerWrapper(private val base: JobScheduler) : JobScheduler
val
name
=
service
.
className
val
component
=
ComponentName
(
service
.
packageName
,
Info
.
stub
Chk
.
classToComponent
[
name
]
?:
name
Info
.
stub
!!
.
classToComponent
[
name
]
?:
name
)
javaClass
.
getDeclaredField
(
"service"
).
apply
{
isAccessible
=
true
...
...
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
21466426
...
...
@@ -9,17 +9,14 @@ import com.topjohnwu.magisk.ktx.getProperty
import
com.topjohnwu.superuser.Shell
import
com.topjohnwu.superuser.ShellUtils.fastCmd
import
com.topjohnwu.superuser.internal.UiThreadHandler
import
java.io.File
InputStream
import
java.io.File
import
java.io.IOException
import
java.util.*
val
isRunningAsStub
get
()
=
Info
.
stub
!=
null
object
Info
{
var
stub
:
DynAPK
.
Data
?
=
null
val
stubChk
:
DynAPK
.
Data
get
()
=
stub
as
DynAPK
.
Data
var
remote
=
UpdateInfo
()
...
...
@@ -31,7 +28,6 @@ object Info {
@JvmField
var
ramdisk
=
false
@JvmField
var
hasGMS
=
true
@JvmField
var
isPixel
=
false
@JvmStatic
val
cryptoText
get
()
=
crypto
.
capitalize
(
Locale
.
US
)
@JvmField
val
isEmulator
=
getProperty
(
"ro.kernel.qemu"
,
"0"
)
==
"1"
var
crypto
=
""
...
...
@@ -45,14 +41,12 @@ object Info {
val
isNewReboot
by
lazy
{
try
{
FileInputStream
(
"/proc/sys/kernel/random/boot_id"
).
bufferedReader
().
use
{
val
id
=
it
.
readLine
()
if
(
id
!=
Config
.
bootId
)
{
Config
.
bootId
=
id
true
}
else
{
false
}
val
id
=
File
(
"/proc/sys/kernel/random/boot_id"
).
readText
()
if
(
id
!=
Config
.
bootId
)
{
Config
.
bootId
=
id
true
}
else
{
false
}
}
catch
(
e
:
IOException
)
{
false
...
...
@@ -71,8 +65,8 @@ object Info {
hide
:
Boolean
=
false
)
{
val
magiskHide
get
()
=
Config
.
magiskHide
val
magiskVersionCode
=
when
(
code
)
{
in
Int
.
MIN_VALUE
..
Const
.
Version
.
MIN_VERCODE
->
-
1
val
magiskVersionCode
=
when
{
code
<
Const
.
Version
.
MIN_VERCODE
->
-
1
else
->
if
(
Shell
.
rootAccess
())
code
else
-
1
}
val
isUnsupported
=
code
>
0
&&
code
<
Const
.
Version
.
MIN_VERCODE
...
...
app/src/main/java/com/topjohnwu/magisk/core/download/ManagerHandler.kt
View file @
21466426
...
...
@@ -34,7 +34,7 @@ suspend fun BaseDownloader.handleAPK(subject: Subject.Manager) {
// Move to upgrade location
apk
.
copyTo
(
DynAPK
.
update
(
this
),
overwrite
=
true
)
apk
.
delete
()
if
(
Info
.
stub
Chk
.
version
<
subject
.
stub
.
versionCode
)
{
if
(
Info
.
stub
!!
.
version
<
subject
.
stub
.
versionCode
)
{
notifyHide
(
id
)
// Also upgrade stub
service
.
fetchFile
(
subject
.
stub
.
link
).
byteStream
().
writeTo
(
apk
)
...
...
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