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
77a275cb
Commit
77a275cb
authored
Feb 14, 2022
by
vvb2060
Committed by
John Wu
Feb 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show notification when stub is updated to full
parent
3956cbe2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
12 deletions
+6
-12
Config.kt
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
+0
-2
Receiver.kt
app/src/main/java/com/topjohnwu/magisk/core/Receiver.kt
+3
-2
DownloadService.kt
...ava/com/topjohnwu/magisk/core/download/DownloadService.kt
+2
-7
MainActivity.kt
app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt
+0
-1
Notifications.kt
app/src/main/java/com/topjohnwu/magisk/view/Notifications.kt
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
View file @
77a275cb
...
...
@@ -61,7 +61,6 @@ object Config : PreferenceModel, DBConfig {
const
val
BOOT_ID
=
"boot_id"
const
val
ASKED_HOME
=
"asked_home"
const
val
DOH
=
"doh"
const
val
SHOW_UPDATE_DONE
=
"update_done"
}
object
Value
{
...
...
@@ -134,7 +133,6 @@ object Config : PreferenceModel, DBConfig {
var
suTapjack
by
preference
(
Key
.
SU_TAPJACK
,
true
)
var
checkUpdate
by
preference
(
Key
.
CHECK_UPDATES
,
true
)
var
doh
by
preference
(
Key
.
DOH
,
false
)
var
showUpdateDone
by
preference
(
Key
.
SHOW_UPDATE_DONE
,
false
)
var
showSystemApp
by
preference
(
Key
.
SHOW_SYSTEM_APP
,
false
)
var
customChannelUrl
by
preference
(
Key
.
CUSTOM_CHANNEL
,
""
)
...
...
app/src/main/java/com/topjohnwu/magisk/core/Receiver.kt
View file @
77a275cb
...
...
@@ -47,9 +47,10 @@ open class Receiver : BaseReceiver() {
}
Intent
.
ACTION_LOCALE_CHANGED
->
Shortcuts
.
setupDynamic
(
context
)
Intent
.
ACTION_MY_PACKAGE_REPLACED
->
{
if
(
Config
.
showUpdateDone
)
{
@Suppress
(
"DEPRECATION"
)
val
installer
=
context
.
packageManager
.
getInstallerPackageName
(
context
.
packageName
)
if
(
installer
==
context
.
packageName
)
{
Notifications
.
updateDone
(
context
)
Config
.
showUpdateDone
=
false
}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/core/download/DownloadService.kt
View file @
77a275cb
...
...
@@ -75,11 +75,6 @@ class DownloadService : NotificationService() {
}
}
private
fun
APKInstall
.
Session
.
open
():
OutputStream
{
Config
.
showUpdateDone
=
true
return
openStream
(
this
@DownloadService
)
}
private
suspend
fun
handleApp
(
stream
:
InputStream
,
subject
:
Subject
.
App
)
{
fun
writeTee
(
output
:
OutputStream
)
{
val
uri
=
MediaStoreUtils
.
getFile
(
"${subject.title}.apk"
).
uri
...
...
@@ -115,7 +110,7 @@ class DownloadService : NotificationService() {
// Install
val
session
=
APKInstall
.
startSession
(
this
)
patched
.
inputStream
().
copyAndClose
(
session
.
open
(
))
patched
.
inputStream
().
copyAndClose
(
session
.
open
Stream
(
this
))
subject
.
intent
=
session
.
waitIntent
()
patched
.
delete
()
...
...
@@ -137,7 +132,7 @@ class DownloadService : NotificationService() {
}
}
else
{
val
session
=
APKInstall
.
startSession
(
this
)
writeTee
(
session
.
open
(
))
writeTee
(
session
.
open
Stream
(
this
))
subject
.
intent
=
session
.
waitIntent
()
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt
View file @
77a275cb
...
...
@@ -51,7 +51,6 @@ class MainActivity : BaseMainActivity<ActivityMainMd2Binding>() {
setContentView
()
showUnsupportedMessage
()
askForHomeShortcut
()
Config
.
showUpdateDone
=
false
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_RESIZE
)
...
...
app/src/main/java/com/topjohnwu/magisk/view/Notifications.kt
View file @
77a275cb
...
...
@@ -52,6 +52,7 @@ object Notifications {
@SuppressLint
(
"InlinedApi"
)
fun
updateDone
(
context
:
Context
)
{
setup
(
context
)
val
flag
=
PendingIntent
.
FLAG_IMMUTABLE
or
PendingIntent
.
FLAG_UPDATE_CURRENT
val
pending
=
PendingIntent
.
getActivity
(
context
,
0
,
selfLaunchIntent
(
context
),
flag
)
val
builder
=
if
(
SDK_INT
>=
26
)
{
...
...
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