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
2b502e9a
Commit
2b502e9a
authored
Dec 03, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small reorganization
parent
59141f9b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
SplashActivity.java
app/src/full/java/com/topjohnwu/magisk/SplashActivity.java
+1
-1
CheckUpdates.java
...c/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
+1
-1
DownloadModule.java
...full/java/com/topjohnwu/magisk/asyncs/DownloadModule.java
+4
-4
InstallMethodDialog.java
.../com/topjohnwu/magisk/components/InstallMethodDialog.java
+1
-1
Notifications.java
...l/java/com/topjohnwu/magisk/components/Notifications.java
+2
-1
ProgressNotification.java
...com/topjohnwu/magisk/components/ProgressNotification.java
+2
-3
UninstallDialog.java
...java/com/topjohnwu/magisk/components/UninstallDialog.java
+1
-1
OnBootService.java
...ull/java/com/topjohnwu/magisk/services/OnBootService.java
+1
-1
DlInstallManager.java
...ull/java/com/topjohnwu/magisk/utils/DlInstallManager.java
+7
-7
No files found.
app/src/full/java/com/topjohnwu/magisk/SplashActivity.java
View file @
2b502e9a
...
@@ -8,10 +8,10 @@ import android.text.TextUtils;
...
@@ -8,10 +8,10 @@ import android.text.TextUtils;
import
com.topjohnwu.magisk.asyncs.CheckUpdates
;
import
com.topjohnwu.magisk.asyncs.CheckUpdates
;
import
com.topjohnwu.magisk.asyncs.UpdateRepos
;
import
com.topjohnwu.magisk.asyncs.UpdateRepos
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.Notifications
;
import
com.topjohnwu.magisk.receivers.ShortcutReceiver
;
import
com.topjohnwu.magisk.receivers.ShortcutReceiver
;
import
com.topjohnwu.magisk.utils.Download
;
import
com.topjohnwu.magisk.utils.Download
;
import
com.topjohnwu.magisk.utils.LocaleManager
;
import
com.topjohnwu.magisk.utils.LocaleManager
;
import
com.topjohnwu.magisk.utils.Notifications
;
import
com.topjohnwu.magisk.utils.RootUtils
;
import
com.topjohnwu.magisk.utils.RootUtils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
View file @
2b502e9a
...
@@ -5,7 +5,7 @@ import android.os.AsyncTask;
...
@@ -5,7 +5,7 @@ import android.os.AsyncTask;
import
com.topjohnwu.magisk.BuildConfig
;
import
com.topjohnwu.magisk.BuildConfig
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.
util
s.Notifications
;
import
com.topjohnwu.magisk.
component
s.Notifications
;
import
com.topjohnwu.magisk.utils.Topic
;
import
com.topjohnwu.magisk.utils.Topic
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/DownloadModule.java
View file @
2b502e9a
...
@@ -11,7 +11,7 @@ import com.topjohnwu.magisk.FlashActivity;
...
@@ -11,7 +11,7 @@ import com.topjohnwu.magisk.FlashActivity;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.BaseActivity
;
import
com.topjohnwu.magisk.components.
NotificationProgress
;
import
com.topjohnwu.magisk.components.
ProgressNotification
;
import
com.topjohnwu.magisk.container.Repo
;
import
com.topjohnwu.magisk.container.Repo
;
import
com.topjohnwu.magisk.utils.WebService
;
import
com.topjohnwu.magisk.utils.WebService
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
...
@@ -39,7 +39,7 @@ public class DownloadModule {
...
@@ -39,7 +39,7 @@ public class DownloadModule {
private
static
void
dlProcessInstall
(
Repo
repo
,
boolean
install
)
{
private
static
void
dlProcessInstall
(
Repo
repo
,
boolean
install
)
{
File
output
=
new
File
(
Const
.
EXTERNAL_PATH
,
repo
.
getDownloadFilename
());
File
output
=
new
File
(
Const
.
EXTERNAL_PATH
,
repo
.
getDownloadFilename
());
NotificationProgress
progress
=
new
NotificationProgress
(
output
.
getName
());
ProgressNotification
progress
=
new
ProgressNotification
(
output
.
getName
());
try
{
try
{
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
File
temp1
=
new
File
(
mm
.
getCacheDir
(),
"temp.zip"
);
File
temp1
=
new
File
(
mm
.
getCacheDir
(),
"temp.zip"
);
...
@@ -96,9 +96,9 @@ public class DownloadModule {
...
@@ -96,9 +96,9 @@ public class DownloadModule {
private
long
totalBytes
;
private
long
totalBytes
;
private
long
bytesDownloaded
;
private
long
bytesDownloaded
;
private
NotificationProgress
progress
;
private
ProgressNotification
progress
;
protected
ProgressInputStream
(
InputStream
in
,
long
size
,
NotificationProgress
p
)
{
protected
ProgressInputStream
(
InputStream
in
,
long
size
,
ProgressNotification
p
)
{
super
(
in
);
super
(
in
);
totalBytes
=
size
;
totalBytes
=
size
;
progress
=
p
;
progress
=
p
;
...
...
app/src/full/java/com/topjohnwu/magisk/components/InstallMethodDialog.java
View file @
2b502e9a
...
@@ -67,7 +67,7 @@ class InstallMethodDialog extends AlertDialog.Builder {
...
@@ -67,7 +67,7 @@ class InstallMethodDialog extends AlertDialog.Builder {
a
.
runWithPermission
(
new
String
[]
{
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
()
->
{
a
.
runWithPermission
(
new
String
[]
{
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
()
->
{
String
filename
=
Utils
.
fmt
(
"Magisk-v%s(%d).zip"
,
String
filename
=
Utils
.
fmt
(
"Magisk-v%s(%d).zip"
,
Data
.
remoteMagiskVersionString
,
Data
.
remoteMagiskVersionCode
);
Data
.
remoteMagiskVersionString
,
Data
.
remoteMagiskVersionCode
);
NotificationProgress
progress
=
new
NotificationProgress
(
filename
);
ProgressNotification
progress
=
new
ProgressNotification
(
filename
);
AndroidNetworking
AndroidNetworking
.
download
(
Data
.
magiskLink
,
Const
.
EXTERNAL_PATH
.
getPath
(),
filename
)
.
download
(
Data
.
magiskLink
,
Const
.
EXTERNAL_PATH
.
getPath
(),
filename
)
.
build
()
.
build
()
...
...
app/src/full/java/com/topjohnwu/magisk/
util
s/Notifications.java
→
app/src/full/java/com/topjohnwu/magisk/
component
s/Notifications.java
View file @
2b502e9a
package
com
.
topjohnwu
.
magisk
.
util
s
;
package
com
.
topjohnwu
.
magisk
.
component
s
;
import
android.app.NotificationChannel
;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
import
android.app.NotificationManager
;
...
@@ -13,6 +13,7 @@ import com.topjohnwu.magisk.MagiskManager;
...
@@ -13,6 +13,7 @@ import com.topjohnwu.magisk.MagiskManager;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.SplashActivity
;
import
com.topjohnwu.magisk.SplashActivity
;
import
com.topjohnwu.magisk.receivers.GeneralReceiver
;
import
com.topjohnwu.magisk.receivers.GeneralReceiver
;
import
com.topjohnwu.magisk.utils.Utils
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationManagerCompat
;
import
androidx.core.app.NotificationManagerCompat
;
...
...
app/src/full/java/com/topjohnwu/magisk/components/
NotificationProgress
.java
→
app/src/full/java/com/topjohnwu/magisk/components/
ProgressNotification
.java
View file @
2b502e9a
...
@@ -7,19 +7,18 @@ import com.topjohnwu.magisk.Const;
...
@@ -7,19 +7,18 @@ import com.topjohnwu.magisk.Const;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.utils.Notifications
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationManagerCompat
;
import
androidx.core.app.NotificationManagerCompat
;
public
class
NotificationProgress
implements
DownloadProgressListener
{
public
class
ProgressNotification
implements
DownloadProgressListener
{
private
NotificationManagerCompat
mgr
;
private
NotificationManagerCompat
mgr
;
private
NotificationCompat
.
Builder
builder
;
private
NotificationCompat
.
Builder
builder
;
private
long
prevTime
;
private
long
prevTime
;
public
NotificationProgress
(
String
title
)
{
public
ProgressNotification
(
String
title
)
{
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
mgr
=
NotificationManagerCompat
.
from
(
mm
);
mgr
=
NotificationManagerCompat
.
from
(
mm
);
builder
=
Notifications
.
progress
(
title
);
builder
=
Notifications
.
progress
(
title
);
...
...
app/src/full/java/com/topjohnwu/magisk/components/UninstallDialog.java
View file @
2b502e9a
...
@@ -43,7 +43,7 @@ public class UninstallDialog extends CustomAlertDialog {
...
@@ -43,7 +43,7 @@ public class UninstallDialog extends CustomAlertDialog {
if
(!
TextUtils
.
isEmpty
(
Data
.
uninstallerLink
))
{
if
(!
TextUtils
.
isEmpty
(
Data
.
uninstallerLink
))
{
setPositiveButton
(
R
.
string
.
complete_uninstall
,
(
d
,
i
)
->
{
setPositiveButton
(
R
.
string
.
complete_uninstall
,
(
d
,
i
)
->
{
File
zip
=
new
File
(
activity
.
getFilesDir
(),
"uninstaller.zip"
);
File
zip
=
new
File
(
activity
.
getFilesDir
(),
"uninstaller.zip"
);
NotificationProgress
progress
=
new
NotificationProgress
(
zip
.
getName
());
ProgressNotification
progress
=
new
ProgressNotification
(
zip
.
getName
());
AndroidNetworking
.
download
(
Data
.
uninstallerLink
,
zip
.
getParent
(),
zip
.
getName
())
AndroidNetworking
.
download
(
Data
.
uninstallerLink
,
zip
.
getParent
(),
zip
.
getName
())
.
build
()
.
build
()
.
setDownloadProgressListener
(
progress
)
.
setDownloadProgressListener
(
progress
)
...
...
app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java
View file @
2b502e9a
...
@@ -5,7 +5,7 @@ import android.content.Intent;
...
@@ -5,7 +5,7 @@ import android.content.Intent;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.Data
;
import
com.topjohnwu.magisk.
util
s.Notifications
;
import
com.topjohnwu.magisk.
component
s.Notifications
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.ShellUtils
;
import
com.topjohnwu.superuser.ShellUtils
;
...
...
app/src/full/java/com/topjohnwu/magisk/utils/DlInstallManager.java
View file @
2b502e9a
...
@@ -10,7 +10,7 @@ import com.topjohnwu.magisk.Data;
...
@@ -10,7 +10,7 @@ import com.topjohnwu.magisk.Data;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.asyncs.PatchAPK
;
import
com.topjohnwu.magisk.asyncs.PatchAPK
;
import
com.topjohnwu.magisk.components.
NotificationProgress
;
import
com.topjohnwu.magisk.components.
ProgressNotification
;
import
com.topjohnwu.superuser.ShellUtils
;
import
com.topjohnwu.superuser.ShellUtils
;
import
com.topjohnwu.utils.JarMap
;
import
com.topjohnwu.utils.JarMap
;
import
com.topjohnwu.utils.SignAPK
;
import
com.topjohnwu.utils.SignAPK
;
...
@@ -34,7 +34,7 @@ public class DlInstallManager {
...
@@ -34,7 +34,7 @@ public class DlInstallManager {
public
static
void
dlInstall
(
String
name
,
ManagerDownloadListener
listener
)
{
public
static
void
dlInstall
(
String
name
,
ManagerDownloadListener
listener
)
{
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
File
apk
=
new
File
(
mm
.
getFilesDir
(),
"manager.apk"
);
File
apk
=
new
File
(
mm
.
getFilesDir
(),
"manager.apk"
);
NotificationProgress
progress
=
new
NotificationProgress
(
name
);
ProgressNotification
progress
=
new
ProgressNotification
(
name
);
listener
.
setInstances
(
apk
,
progress
);
listener
.
setInstances
(
apk
,
progress
);
AndroidNetworking
AndroidNetworking
.
download
(
Data
.
managerLink
,
apk
.
getParent
(),
apk
.
getName
())
.
download
(
Data
.
managerLink
,
apk
.
getParent
(),
apk
.
getName
())
...
@@ -46,14 +46,14 @@ public class DlInstallManager {
...
@@ -46,14 +46,14 @@ public class DlInstallManager {
public
abstract
static
class
ManagerDownloadListener
implements
DownloadListener
{
public
abstract
static
class
ManagerDownloadListener
implements
DownloadListener
{
private
File
apk
;
private
File
apk
;
private
NotificationProgress
progress
;
private
ProgressNotification
progress
;
private
void
setInstances
(
File
apk
,
NotificationProgress
progress
)
{
private
void
setInstances
(
File
apk
,
ProgressNotification
progress
)
{
this
.
apk
=
apk
;
this
.
apk
=
apk
;
this
.
progress
=
progress
;
this
.
progress
=
progress
;
}
}
public
abstract
void
onDownloadComplete
(
File
apk
,
NotificationProgress
progress
);
public
abstract
void
onDownloadComplete
(
File
apk
,
ProgressNotification
progress
);
@Override
@Override
public
final
void
onDownloadComplete
()
{
public
final
void
onDownloadComplete
()
{
...
@@ -69,7 +69,7 @@ public class DlInstallManager {
...
@@ -69,7 +69,7 @@ public class DlInstallManager {
private
static
class
PatchPackageName
extends
ManagerDownloadListener
{
private
static
class
PatchPackageName
extends
ManagerDownloadListener
{
@Override
@Override
public
void
onDownloadComplete
(
File
apk
,
NotificationProgress
progress
)
{
public
void
onDownloadComplete
(
File
apk
,
ProgressNotification
progress
)
{
File
patched
=
apk
;
File
patched
=
apk
;
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
if
(!
mm
.
getPackageName
().
equals
(
BuildConfig
.
APPLICATION_ID
))
{
if
(!
mm
.
getPackageName
().
equals
(
BuildConfig
.
APPLICATION_ID
))
{
...
@@ -95,7 +95,7 @@ public class DlInstallManager {
...
@@ -95,7 +95,7 @@ public class DlInstallManager {
private
static
class
RestoreManager
extends
ManagerDownloadListener
{
private
static
class
RestoreManager
extends
ManagerDownloadListener
{
@Override
@Override
public
void
onDownloadComplete
(
File
apk
,
NotificationProgress
progress
)
{
public
void
onDownloadComplete
(
File
apk
,
ProgressNotification
progress
)
{
progress
.
dismiss
();
progress
.
dismiss
();
Data
.
exportPrefs
();
Data
.
exportPrefs
();
if
(
ShellUtils
.
fastCmdResult
(
"pm install "
+
apk
))
if
(
ShellUtils
.
fastCmdResult
(
"pm install "
+
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