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
ba6e6cc1
Commit
ba6e6cc1
authored
Jan 11, 2022
by
topjohnwu
Committed by
John Wu
Jan 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update vbmeta option hiding criteria
Hide when Samsung, A/B, or vbmeta partition exists
parent
fd7bf2bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+6
-4
InstallViewModel.kt
.../java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
+3
-3
fragment_install_md2.xml
app/src/main/res/layout/fragment_install_md2.xml
+2
-4
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
ba6e6cc1
...
...
@@ -28,20 +28,22 @@ object Info {
// Device state
@JvmStatic
val
env
by
lazy
{
loadState
()
}
@Jvm
Static
var
isSAR
=
false
@Jvm
Field
var
isSAR
=
false
var
isAB
=
false
val
isVirtualAB
=
getProperty
(
"ro.virtual_ab.enabled"
,
"false"
)
==
"true"
@JvmField
val
isZygiskEnabled
=
System
.
getenv
(
"ZYGISK_ENABLED"
)
==
"1"
@JvmStatic
val
isFDE
get
()
=
crypto
==
"block"
@JvmField
var
ramdisk
=
false
@JvmField
var
vbmeta
=
false
var
crypto
=
""
var
noDataExec
=
false
@JvmField
var
hasGMS
=
true
@JvmField
val
isPixel
=
Build
.
BRAND
==
"google"
val
isSamsung
=
Build
.
MANUFACTURER
.
equals
(
"samsung"
,
ignoreCase
=
true
)
@JvmField
val
isEmulator
=
getProperty
(
"ro.kernel.qemu"
,
"0"
)
==
"1"
||
getProperty
(
"ro.boot.qemu"
,
"0"
)
==
"1"
var
crypto
=
""
var
noDataExec
=
false
getProperty
(
"ro.boot.qemu"
,
"0"
)
==
"1"
val
isConnected
by
lazy
{
ObservableBoolean
(
false
).
also
{
field
->
...
...
app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
View file @
ba6e6cc1
package
com.topjohnwu.magisk.ui.install
import
android.net.Uri
import
android.os.Build
import
androidx.databinding.Bindable
import
androidx.lifecycle.viewModelScope
import
com.topjohnwu.magisk.BR
...
...
@@ -27,11 +26,12 @@ class InstallViewModel(
)
:
BaseViewModel
()
{
val
isRooted
=
Shell
.
rootAccess
()
val
skipOptions
=
Info
.
ramdisk
&&
!
Info
.
isFDE
&&
Info
.
isSAR
&&
!(!
Info
.
vbmeta
&&
Build
.
VERSION
.
SDK_INT
>=
30
)
val
hideVbmeta
=
Info
.
vbmeta
||
Info
.
isSamsung
||
Info
.
isAB
val
skipOptions
=
Info
.
isEmulator
||
(
Info
.
isSAR
&&
!
Info
.
isFDE
&&
hideVbmeta
&&
Info
.
ramdisk
)
val
noSecondSlot
=
!
isRooted
||
Info
.
isPixel
||
Info
.
isVirtualAB
||
!
Info
.
isAB
||
Info
.
isEmulator
@get
:
Bindable
var
step
=
if
(
Info
.
isEmulator
||
skipOptions
)
1
else
0
var
step
=
if
(
skipOptions
)
1
else
0
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
step
)
var
_method
=
-
1
...
...
app/src/main/res/layout/fragment_install_md2.xml
View file @
ba6e6cc1
...
...
@@ -9,8 +9,6 @@
<import
type=
"com.topjohnwu.magisk.core.Config"
/>
<import
type=
"android.os.Build"
/>
<variable
name=
"viewModel"
type=
"com.topjohnwu.magisk.ui.install.InstallViewModel"
/>
...
...
@@ -36,7 +34,7 @@
<com.google.android.material.card.MaterialCardView
style=
"@style/WidgetFoundation.Card"
gone=
"@{viewModel.skipOptions
|| Info.isEmulator
}"
gone=
"@{viewModel.skipOptions}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
...
...
@@ -112,7 +110,7 @@
<CheckBox
style=
"@style/WidgetFoundation.Checkbox"
gone
Unless=
"@{!Info.vbmeta && Build.VERSION.SDK_INT >= 30
}"
gone
=
"@{viewModel.hideVbmeta
}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:checked=
"@={Config.patchVbmeta}"
...
...
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