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
a54114f1
Commit
a54114f1
authored
Aug 23, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pre-grant permissions if possible
parent
7a4a5c89
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
HideAPK.kt
app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt
+2
-2
manager.sh
app/src/main/res/raw/manager.sh
+4
-3
scripting.cpp
native/src/core/scripting.cpp
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt
View file @
a54114f1
...
...
@@ -129,7 +129,7 @@ object HideAPK {
launchApp
(
activity
,
pkg
)
}
val
cmd
=
"adb_pm_install $repack $
{activity.applicationInfo.uid}
"
val
cmd
=
"adb_pm_install $repack $
pkg
"
if
(
Shell
.
cmd
(
cmd
).
exec
().
isSuccess
)
return
true
try
{
...
...
@@ -177,7 +177,7 @@ object HideAPK {
launchApp
(
activity
,
APPLICATION_ID
)
dialog
.
dismiss
()
}
val
cmd
=
"adb_pm_install $apk $
{activity.applicationInfo.uid}
"
val
cmd
=
"adb_pm_install $apk $
APPLICATION_ID
"
if
(
Shell
.
cmd
(
cmd
).
await
().
isSuccess
)
return
val
success
=
withContext
(
Dispatchers
.
IO
)
{
try
{
...
...
app/src/main/res/raw/manager.sh
View file @
a54114f1
...
...
@@ -133,11 +133,12 @@ adb_pm_install() {
local
tmp
=
/data/local/tmp/temp.apk
cp
-f
"
$1
"
$tmp
chmod
644
$tmp
su 2000
-c
pm
install
$tmp
||
pm
install
$tmp
||
su 1000
-c
pm
install
$tmp
su 2000
-c
pm
install
-g
$tmp
||
pm
install
-g
$tmp
||
su 1000
-c
pm
install
-g
$tmp
local
res
=
$?
rm
-f
$tmp
# Note: change this will kill self
[
$res
!=
0
]
&&
appops
set
"
$2
"
REQUEST_INSTALL_PACKAGES allow
if
[
$res
=
0
]
;
then
appops
set
"
$2
"
REQUEST_INSTALL_PACKAGES allow
fi
return
$res
}
...
...
native/src/core/scripting.cpp
View file @
a54114f1
...
...
@@ -154,6 +154,7 @@ constexpr char install_script[] = R"EOF(
APK=%s
log -t Magisk "pm_install: $APK"
log -t Magisk "pm_install: $(pm install -g -r $APK 2>&1)"
appops set com.topjohnwu.magisk REQUEST_INSTALL_PACKAGES allow
rm -f $APK
)EOF"
;
...
...
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