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
10b17827
Commit
10b17827
authored
Jun 01, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update version gating
parent
e029994e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
Const.kt
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
+1
-0
PolicyDao.kt
...java/com/topjohnwu/magisk/core/data/magiskdb/PolicyDao.kt
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Const.kt
View file @
10b17827
...
@@ -30,6 +30,7 @@ object Const {
...
@@ -30,6 +30,7 @@ object Const {
fun
atLeast_21_2
()
=
Info
.
env
.
versionCode
>=
21200
||
isCanary
()
fun
atLeast_21_2
()
=
Info
.
env
.
versionCode
>=
21200
||
isCanary
()
fun
atLeast_24_0
()
=
Info
.
env
.
versionCode
>=
24000
||
isCanary
()
fun
atLeast_24_0
()
=
Info
.
env
.
versionCode
>=
24000
||
isCanary
()
fun
atLeast_25_0
()
=
Info
.
env
.
versionCode
>=
25000
||
isCanary
()
fun
isCanary
()
=
isCanary
(
Info
.
env
.
versionCode
)
fun
isCanary
()
=
isCanary
(
Info
.
env
.
versionCode
)
fun
isCanary
(
ver
:
Int
)
=
ver
>
0
&&
ver
%
100
!=
0
fun
isCanary
(
ver
:
Int
)
=
ver
>
0
&&
ver
%
100
!=
0
...
...
app/src/main/java/com/topjohnwu/magisk/core/data/magiskdb/PolicyDao.kt
View file @
10b17827
...
@@ -26,7 +26,7 @@ class PolicyDao : MagiskDB() {
...
@@ -26,7 +26,7 @@ class PolicyDao : MagiskDB() {
suspend
fun
update
(
policy
:
SuPolicy
)
{
suspend
fun
update
(
policy
:
SuPolicy
)
{
val
map
=
policy
.
toMap
()
val
map
=
policy
.
toMap
()
if
(!
Const
.
Version
.
isCanary
())
{
if
(!
Const
.
Version
.
atLeast_25_0
())
{
// Put in package_name for old database
// Put in package_name for old database
map
[
"package_name"
]
=
AppContext
.
packageManager
.
getNameForUid
(
policy
.
uid
)
!!
map
[
"package_name"
]
=
AppContext
.
packageManager
.
getNameForUid
(
policy
.
uid
)
!!
}
}
...
...
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