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
42ce6fd3
Commit
42ce6fd3
authored
Aug 08, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround stupid Moshi proguard rules
parent
f5c3ee3a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
RemoteFileService.kt
.../com/topjohnwu/magisk/model/download/RemoteFileService.kt
+2
-2
UpdateInfo.kt
...main/java/com/topjohnwu/magisk/model/entity/UpdateInfo.kt
+1
-2
RepoUpdater.kt
app/src/main/java/com/topjohnwu/magisk/tasks/RepoUpdater.kt
+3
-2
EnvFixDialog.kt
...in/java/com/topjohnwu/magisk/view/dialogs/EnvFixDialog.kt
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt
View file @
42ce6fd3
...
@@ -69,8 +69,8 @@ abstract class RemoteFileService : NotificationService() {
...
@@ -69,8 +69,8 @@ abstract class RemoteFileService : NotificationService() {
supportedFolders
.
firstMap
{
it
.
find
(
subject
.
file
.
name
)
}.
also
{
supportedFolders
.
firstMap
{
it
.
find
(
subject
.
file
.
name
)
}.
also
{
if
(
subject
is
Magisk
)
{
if
(
subject
is
Magisk
)
{
if
(!
ShellUtils
.
checkSum
(
"MD5"
,
it
,
subject
.
magisk
.
hash
))
{
if
(!
ShellUtils
.
checkSum
(
"MD5"
,
it
,
subject
.
magisk
.
md5
))
{
throw
IllegalStateException
(
"The given file doesn't match the
hash
"
)
throw
IllegalStateException
(
"The given file doesn't match the
md5
"
)
}
}
}
}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/model/entity/UpdateInfo.kt
View file @
42ce6fd3
package
com.topjohnwu.magisk.model.entity
package
com.topjohnwu.magisk.model.entity
import
android.os.Parcelable
import
android.os.Parcelable
import
com.squareup.moshi.Json
import
kotlinx.android.parcel.Parcelize
import
kotlinx.android.parcel.Parcelize
import
se.ansman.kotshi.JsonSerializable
import
se.ansman.kotshi.JsonSerializable
...
@@ -23,7 +22,7 @@ data class MagiskJson(
...
@@ -23,7 +22,7 @@ data class MagiskJson(
val
versionCode
:
Int
=
-
1
,
val
versionCode
:
Int
=
-
1
,
val
link
:
String
=
""
,
val
link
:
String
=
""
,
val
note
:
String
=
""
,
val
note
:
String
=
""
,
@Json
(
name
=
"md5"
)
val
hash
:
String
=
""
val
md5
:
String
=
""
)
)
@Parcelize
@Parcelize
...
...
app/src/main/java/com/topjohnwu/magisk/tasks/RepoUpdater.kt
View file @
42ce6fd3
package
com.topjohnwu.magisk.tasks
package
com.topjohnwu.magisk.tasks
import
com.squareup.moshi.Json
import
com.topjohnwu.magisk.Const
import
com.topjohnwu.magisk.Const
import
com.topjohnwu.magisk.data.database.RepoDao
import
com.topjohnwu.magisk.data.database.RepoDao
import
com.topjohnwu.magisk.data.network.GithubApiServices
import
com.topjohnwu.magisk.data.network.GithubApiServices
...
@@ -89,9 +88,11 @@ private val dateFormat: SimpleDateFormat =
...
@@ -89,9 +88,11 @@ private val dateFormat: SimpleDateFormat =
@JsonSerializable
@JsonSerializable
data class
GithubRepoInfo
(
data class
GithubRepoInfo
(
@Json
(
name
=
"name"
)
val
id
:
String
,
val
name
:
String
,
val
pushed_at
:
String
val
pushed_at
:
String
)
{
)
{
val
id
get
()
=
name
@Transient
@Transient
val
pushDate
=
dateFormat
.
parse
(
pushed_at
)
!!
val
pushDate
=
dateFormat
.
parse
(
pushed_at
)
!!
}
}
app/src/main/java/com/topjohnwu/magisk/view/dialogs/EnvFixDialog.kt
View file @
42ce6fd3
...
@@ -32,7 +32,7 @@ class EnvFixDialog(activity: Activity) : CustomAlertDialog(activity) {
...
@@ -32,7 +32,7 @@ class EnvFixDialog(activity: Activity) : CustomAlertDialog(activity) {
installDir
=
SuFile
(
"/data/adb/magisk"
)
installDir
=
SuFile
(
"/data/adb/magisk"
)
Shell
.
su
(
"rm -rf /data/adb/magisk/*"
).
exec
()
Shell
.
su
(
"rm -rf /data/adb/magisk/*"
).
exec
()
val
zip
:
File
=
activity
.
cachedFile
(
"magisk.zip"
)
val
zip
:
File
=
activity
.
cachedFile
(
"magisk.zip"
)
if
(!
ShellUtils
.
checkSum
(
"MD5"
,
zip
,
Info
.
remote
.
magisk
.
hash
))
if
(!
ShellUtils
.
checkSum
(
"MD5"
,
zip
,
Info
.
remote
.
magisk
.
md5
))
Networking
.
get
(
Info
.
remote
.
magisk
.
link
).
execForFile
(
zip
)
Networking
.
get
(
Info
.
remote
.
magisk
.
link
).
execForFile
(
zip
)
zipUri
=
zip
.
toUri
()
zipUri
=
zip
.
toUri
()
return
extractZip
()
&&
Shell
.
su
(
"fix_env"
).
exec
().
isSuccess
return
extractZip
()
&&
Shell
.
su
(
"fix_env"
).
exec
().
isSuccess
...
...
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