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
46de1ed9
Commit
46de1ed9
authored
Sep 28, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better handling of data encryption
parent
9bebe07d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
Info.kt
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
+4
-2
InstallViewModel.kt
.../java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
+1
-1
fragment_install_md2.xml
app/src/main/res/layout/fragment_install_md2.xml
+1
-1
include_home_magisk.xml
app/src/main/res/layout/include_home_magisk.xml
+1
-1
manager.sh
app/src/main/res/raw/manager.sh
+0
-2
util_functions.sh
scripts/util_functions.sh
+3
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Info.kt
View file @
46de1ed9
...
@@ -11,6 +11,7 @@ import com.topjohnwu.superuser.ShellUtils.fastCmd
...
@@ -11,6 +11,7 @@ import com.topjohnwu.superuser.ShellUtils.fastCmd
import
com.topjohnwu.superuser.internal.UiThreadHandler
import
com.topjohnwu.superuser.internal.UiThreadHandler
import
java.io.FileInputStream
import
java.io.FileInputStream
import
java.io.IOException
import
java.io.IOException
import
java.util.*
val
isRunningAsStub
get
()
=
Info
.
stub
!=
null
val
isRunningAsStub
get
()
=
Info
.
stub
!=
null
...
@@ -27,13 +28,14 @@ object Info {
...
@@ -27,13 +28,14 @@ object Info {
var
remote
=
UpdateInfo
()
var
remote
=
UpdateInfo
()
// Device state
// Device state
var
crypto
=
""
@JvmStatic
var
isSAR
=
false
@JvmStatic
var
isSAR
=
false
@JvmStatic
var
isAB
=
false
@JvmStatic
var
isAB
=
false
@JvmStatic
val
isF
BE
get
()
=
crypto
==
"file
"
@JvmStatic
val
isF
DE
get
()
=
crypto
==
"block
"
@JvmStatic
var
ramdisk
=
false
@JvmStatic
var
ramdisk
=
false
@JvmStatic
var
hasGMS
=
true
@JvmStatic
var
hasGMS
=
true
@JvmStatic
var
crypto
=
""
@JvmStatic
var
isPixel
=
false
@JvmStatic
var
isPixel
=
false
@JvmStatic
val
cryptoText
get
()
=
crypto
.
capitalize
(
Locale
.
US
)
val
isConnected
by
lazy
{
val
isConnected
by
lazy
{
ObservableBoolean
(
false
).
also
{
field
->
ObservableBoolean
(
false
).
also
{
field
->
...
...
app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
View file @
46de1ed9
...
@@ -24,7 +24,7 @@ class InstallViewModel(
...
@@ -24,7 +24,7 @@ class InstallViewModel(
)
:
BaseViewModel
(
State
.
LOADED
)
{
)
:
BaseViewModel
(
State
.
LOADED
)
{
val
isRooted
=
Shell
.
rootAccess
()
val
isRooted
=
Shell
.
rootAccess
()
val
skipOptions
=
Info
.
ramdisk
&&
Info
.
isFB
E
&&
Info
.
isSAR
val
skipOptions
=
Info
.
ramdisk
&&
!
Info
.
isFD
E
&&
Info
.
isSAR
@get
:
Bindable
@get
:
Bindable
var
step
=
if
(
skipOptions
)
1
else
0
var
step
=
if
(
skipOptions
)
1
else
0
...
...
app/src/main/res/layout/fragment_install_md2.xml
View file @
46de1ed9
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
<CheckBox
<CheckBox
style=
"@style/WidgetFoundation.Checkbox"
style=
"@style/WidgetFoundation.Checkbox"
gone
=
"@{Info.isFB
E}"
gone
Unless=
"@{Info.isFD
E}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"@={Config.keepEnc}"
android:checked=
"@={Config.keepEnc}"
...
...
app/src/main/res/layout/include_home_magisk.xml
View file @
46de1ed9
...
@@ -208,7 +208,7 @@
...
@@ -208,7 +208,7 @@
<TextView
<TextView
style=
"@style/W.Home.ItemContent.Right"
style=
"@style/W.Home.ItemContent.Right"
android:text=
"@{Info.crypto}"
android:text=
"@{Info.crypto
Text
}"
tools:text=
"N/A"
/>
tools:text=
"N/A"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/raw/manager.sh
View file @
46de1ed9
...
@@ -123,8 +123,6 @@ check_encryption() {
...
@@ -123,8 +123,6 @@ check_encryption() {
if
$ISENCRYPTED
;
then
if
$ISENCRYPTED
;
then
if
[
$SDK_INT
-lt
24
]
;
then
if
[
$SDK_INT
-lt
24
]
;
then
CRYPTOTYPE
=
"block"
CRYPTOTYPE
=
"block"
elif
[
-d
/data/unencrypted
]
;
then
CRYPTOTYPE
=
"file"
else
else
# First see what the system tells us
# First see what the system tells us
CRYPTOTYPE
=
$(
getprop ro.crypto.type
)
CRYPTOTYPE
=
$(
getprop ro.crypto.type
)
...
...
scripts/util_functions.sh
View file @
46de1ed9
...
@@ -363,10 +363,10 @@ get_flags() {
...
@@ -363,10 +363,10 @@ get_flags() {
KEEPVERITY
=
false
KEEPVERITY
=
false
fi
fi
fi
fi
if
[
-z
$KEEPFORCEENCRYPT
]
;
then
ISENCRYPTED
=
false
ISENCRYPTED
=
false
grep
' /data '
/proc/mounts |
grep
-q
'dm-'
&&
ISENCRYPTED
=
true
grep
' /data '
/proc/mounts |
grep
-q
'dm-'
&&
ISENCRYPTED
=
true
[
-d
/data/unencrypted
]
&&
ISENCRYPTED
=
true
[
"
$(
getprop ro.crypto.state
)
"
=
"encrypted"
]
&&
ISENCRYPTED
=
true
if
[
-z
$KEEPFORCEENCRYPT
]
;
then
# No data access means unable to decrypt in recovery
# No data access means unable to decrypt in recovery
if
$ISENCRYPTED
||
!
$DATA
;
then
if
$ISENCRYPTED
||
!
$DATA
;
then
KEEPFORCEENCRYPT
=
true
KEEPFORCEENCRYPT
=
true
...
...
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