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
389299af
Commit
389299af
authored
Nov 14, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove apps from hidelist if uninstalled
parent
826543a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
PackageReceiver.java
.../java/com/topjohnwu/magisk/receivers/PackageReceiver.java
+6
-14
No files found.
app/src/main/java/com/topjohnwu/magisk/receivers/PackageReceiver.java
View file @
389299af
...
@@ -6,34 +6,26 @@ import android.content.Intent;
...
@@ -6,34 +6,26 @@ import android.content.Intent;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.container.Policy
;
import
com.topjohnwu.magisk.container.Policy
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
public
class
PackageReceiver
extends
BroadcastReceiver
{
public
class
PackageReceiver
extends
BroadcastReceiver
{
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
MagiskManager
m
agiskManager
=
Utils
.
getMagiskManager
(
context
);
MagiskManager
m
m
=
Utils
.
getMagiskManager
(
context
);
String
pkg
=
intent
.
getData
().
getEncodedSchemeSpecificPart
();
String
pkg
=
intent
.
getData
().
getEncodedSchemeSpecificPart
();
Policy
policy
=
magiskManager
.
suDB
.
getPolicy
(
pkg
);
if
(
policy
==
null
)
return
;
switch
(
intent
.
getAction
())
{
switch
(
intent
.
getAction
())
{
case
Intent
.
ACTION_PACKAGE_REPLACED
:
case
Intent
.
ACTION_PACKAGE_REPLACED
:
// This will only work pre-O
// This will only work pre-O
if
(
magiskManager
.
suReauth
)
{
if
(
mm
.
suReauth
)
{
magiskManager
.
suDB
.
deletePolicy
(
policy
);
mm
.
suDB
.
deletePolicy
(
pkg
);
}
else
{
int
uid
=
intent
.
getIntExtra
(
Intent
.
EXTRA_UID
,
-
1
);
// Update the UID if available
if
(
uid
>
0
)
{
policy
.
uid
=
uid
%
100000
;
}
magiskManager
.
suDB
.
updatePolicy
(
policy
);
}
}
break
;
break
;
case
Intent
.
ACTION_PACKAGE_FULLY_REMOVED
:
case
Intent
.
ACTION_PACKAGE_FULLY_REMOVED
:
magiskManager
.
suDB
.
deletePolicy
(
policy
);
mm
.
suDB
.
deletePolicy
(
pkg
);
Shell
.
su_raw
(
"magiskhide --rm "
+
pkg
);
break
;
break
;
}
}
}
}
...
...
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