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
5fb96cdc
Commit
5fb96cdc
authored
Nov 27, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto launch new app after repackaging/restoring Manager
parent
e8cba352
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
+13
-2
PatchAPK.java
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
+1
-1
SettingsFragment.java
...java/com/topjohnwu/magisk/fragments/SettingsFragment.java
+1
-1
RootUtils.java
app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java
+4
-0
utils.sh
app/src/full/res/raw/utils.sh
+7
-0
No files found.
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
View file @
5fb96cdc
...
@@ -101,7 +101,7 @@ public class PatchAPK {
...
@@ -101,7 +101,7 @@ public class PatchAPK {
mm
.
mDB
.
setStrings
(
Const
.
Key
.
SU_MANAGER
,
pkg
);
mm
.
mDB
.
setStrings
(
Const
.
Key
.
SU_MANAGER
,
pkg
);
Data
.
exportPrefs
();
Data
.
exportPrefs
();
RootUtils
.
uninstallPkg
(
Const
.
ORIG_PKG_NAME
);
RootUtils
.
rmAndLaunch
(
Const
.
ORIG_PKG_NAME
,
pkg
);
return
true
;
return
true
;
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/fragments/SettingsFragment.java
View file @
5fb96cdc
...
@@ -93,7 +93,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
...
@@ -93,7 +93,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
Shell
.
su
(
"cp "
+
uri
.
getPath
()
+
" /data/local/tmp/manager.apk"
).
exec
();
Shell
.
su
(
"cp "
+
uri
.
getPath
()
+
" /data/local/tmp/manager.apk"
).
exec
();
if
(
ShellUtils
.
fastCmdResult
(
"pm install /data/local/tmp/manager.apk"
))
{
if
(
ShellUtils
.
fastCmdResult
(
"pm install /data/local/tmp/manager.apk"
))
{
Shell
.
su
(
"rm -f /data/local/tmp/manager.apk"
).
exec
();
Shell
.
su
(
"rm -f /data/local/tmp/manager.apk"
).
exec
();
RootUtils
.
uninstallPkg
(
context
.
getPackageName
()
);
RootUtils
.
rmAndLaunch
(
context
.
getPackageName
(),
Const
.
ORIG_PKG_NAME
);
return
;
return
;
}
}
Shell
.
su
(
"rm -f /data/local/tmp/manager.apk"
).
exec
();
Shell
.
su
(
"rm -f /data/local/tmp/manager.apk"
).
exec
();
...
...
app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java
View file @
5fb96cdc
...
@@ -25,6 +25,10 @@ public class RootUtils extends Shell.Initializer {
...
@@ -25,6 +25,10 @@ public class RootUtils extends Shell.Initializer {
Shell
.
su
(
"db_clean "
+
Const
.
USER_ID
,
"pm uninstall "
+
pkg
).
exec
();
Shell
.
su
(
"db_clean "
+
Const
.
USER_ID
,
"pm uninstall "
+
pkg
).
exec
();
}
}
public
static
void
rmAndLaunch
(
String
rm
,
String
launch
)
{
Shell
.
su
(
Utils
.
fmt
(
"(rm_launch %d %s %s)&"
,
Const
.
USER_ID
,
rm
,
launch
)).
exec
();
}
@Override
@Override
public
boolean
onInit
(
Context
context
,
@NonNull
Shell
shell
)
{
public
boolean
onInit
(
Context
context
,
@NonNull
Shell
shell
)
{
Shell
.
Job
job
=
shell
.
newJob
();
Shell
.
Job
job
=
shell
.
newJob
();
...
...
app/src/full/res/raw/utils.sh
View file @
5fb96cdc
...
@@ -135,3 +135,10 @@ EOF
...
@@ -135,3 +135,10 @@ EOF
touch
hosts/auto_mount
touch
hosts/auto_mount
cd
/
cd
/
}
}
rm_launch
()
{
db_clean
$1
pm uninstall
$2
monkey
-p
$3
1
exit
}
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