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
a8932706
Commit
a8932706
authored
Jul 23, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate Magisk download subject
parent
a97972aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
DownloadService.kt
...va/com/topjohnwu/magisk/model/download/DownloadService.kt
+0
-1
DownloadSubject.kt
...topjohnwu/magisk/model/entity/internal/DownloadSubject.kt
+24
-12
No files found.
app/src/main/java/com/topjohnwu/magisk/model/download/DownloadService.kt
View file @
a8932706
...
@@ -50,7 +50,6 @@ open class DownloadService : RemoteFileService() {
...
@@ -50,7 +50,6 @@ open class DownloadService : RemoteFileService() {
Uninstall
->
FlashActivity
.
uninstall
(
this
,
file
)
Uninstall
->
FlashActivity
.
uninstall
(
this
,
file
)
is
Patch
->
FlashActivity
.
patch
(
this
,
file
,
conf
.
fileUri
)
is
Patch
->
FlashActivity
.
patch
(
this
,
file
,
conf
.
fileUri
)
is
Flash
->
FlashActivity
.
flash
(
this
,
file
,
conf
is
Secondary
)
is
Flash
->
FlashActivity
.
flash
(
this
,
file
,
conf
is
Secondary
)
else
->
Unit
}
}
private
fun
onFinishedInternal
(
private
fun
onFinishedInternal
(
...
...
app/src/main/java/com/topjohnwu/magisk/model/entity/internal/DownloadSubject.kt
View file @
a8932706
...
@@ -16,24 +16,36 @@ sealed class DownloadSubject : Parcelable {
...
@@ -16,24 +16,36 @@ sealed class DownloadSubject : Parcelable {
val
module
:
Repo
,
val
module
:
Repo
,
val
configuration
:
Configuration
val
configuration
:
Configuration
)
:
DownloadSubject
()
{
)
:
DownloadSubject
()
{
override
val
url
:
String
get
()
=
module
.
zipUrl
override
val
url
:
String
get
()
=
module
.
zipUrl
override
val
fileName
:
String
get
()
=
"${module.name}-v${module.version}(${module.versionCode}).zip"
override
val
fileName
:
String
get
()
=
"${module.name}-v${module.version}(${module.versionCode}).zip"
}
}
@Parcelize
sealed
class
Magisk
:
DownloadSubject
()
{
data class
Magisk
(
val
configuration
:
Configuration
,
abstract
val
configuration
:
Configuration
val
magisk
:
MagiskJson
=
Info
.
remote
.
magisk
val
magisk
:
MagiskJson
=
Info
.
remote
.
magisk
)
:
DownloadSubject
()
{
@Parcelize
protected
data class
Flash
(
override
val
configuration
:
Configuration
)
:
Magisk
()
{
override
val
url
:
String
get
()
=
magisk
.
link
override
val
fileName
get
()
=
"magisk.zip"
}
@Parcelize
protected
object
Download
:
Magisk
()
{
override
val
configuration
:
Configuration
get
()
=
Configuration
.
Download
override
val
url
:
String
get
()
=
magisk
.
link
override
val
url
:
String
get
()
=
magisk
.
link
override
val
fileName
get
()
=
override
val
fileName
get
()
=
"Magisk-v${magisk.version}(${magisk.versionCode}).zip"
if
(
configuration
is
Configuration
.
Flash
)
}
"magisk.zip"
else
companion
object
{
"Magisk-v${magisk.version}(${magisk.versionCode}).zip"
operator
fun
invoke
(
configuration
:
Configuration
)
=
when
(
configuration
)
{
Configuration
.
Download
->
Download
else
->
Flash
(
configuration
)
}
}
}
}
...
...
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