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
d713ad34
Commit
d713ad34
authored
Oct 19, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "advanced" install options for installing magisk
parent
ddf40df6
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
2 deletions
+78
-2
Info.kt
app/src/main/java/com/topjohnwu/magisk/Info.kt
+3
-0
MagiskInstallDialog.kt
...pjohnwu/magisk/model/events/dialog/MagiskInstallDialog.kt
+3
-1
MagiskDialog.kt
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
+1
-1
include_install_options.xml
app/src/main/res/layout/include_install_options.xml
+59
-0
attrs.xml
app/src/main/res/values/attrs.xml
+3
-0
styles_md2.xml
app/src/main/res/values/styles_md2.xml
+2
-0
styles_md2_impl.xml
app/src/main/res/values/styles_md2_impl.xml
+7
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/Info.kt
View file @
d713ad34
...
@@ -14,8 +14,11 @@ object Info {
...
@@ -14,8 +14,11 @@ object Info {
var
remote
=
UpdateInfo
()
var
remote
=
UpdateInfo
()
@JvmStatic
var
keepVerity
=
false
var
keepVerity
=
false
@JvmStatic
var
keepEnc
=
false
var
keepEnc
=
false
@JvmStatic
var
recovery
=
false
var
recovery
=
false
fun
loadMagiskInfo
()
{
fun
loadMagiskInfo
()
{
...
...
app/src/main/java/com/topjohnwu/magisk/model/events/dialog/MagiskInstallDialog.kt
View file @
d713ad34
package
com.topjohnwu.magisk.model.events.dialog
package
com.topjohnwu.magisk.model.events.dialog
import
android.view.LayoutInflater
import
com.topjohnwu.magisk.Info
import
com.topjohnwu.magisk.Info
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.databinding.IncludeInstallOptionsBinding
import
com.topjohnwu.magisk.extensions.res
import
com.topjohnwu.magisk.extensions.res
import
com.topjohnwu.magisk.model.events.OpenInappLinkEvent
import
com.topjohnwu.magisk.model.events.OpenInappLinkEvent
import
com.topjohnwu.magisk.view.MagiskDialog
import
com.topjohnwu.magisk.view.MagiskDialog
...
@@ -13,7 +15,6 @@ class MagiskInstallDialog : DialogEvent() {
...
@@ -13,7 +15,6 @@ class MagiskInstallDialog : DialogEvent() {
override
fun
build
(
dialog
:
MagiskDialog
)
{
override
fun
build
(
dialog
:
MagiskDialog
)
{
with
(
dialog
)
{
with
(
dialog
)
{
val
filename
=
val
filename
=
"Magisk v${Info.remote.magisk.version}(${Info.remote.magisk.versionCode})"
"Magisk v${Info.remote.magisk.version}(${Info.remote.magisk.versionCode})"
applyTitle
(
R
.
string
.
repo_install_title
.
res
(
R
.
string
.
magisk
.
res
()))
applyTitle
(
R
.
string
.
repo_install_title
.
res
(
R
.
string
.
magisk
.
res
()))
...
@@ -44,6 +45,7 @@ class MagiskInstallDialog : DialogEvent() {
...
@@ -44,6 +45,7 @@ class MagiskInstallDialog : DialogEvent() {
with
(
dialog
)
{
with
(
dialog
)
{
applyTitle
(
R
.
string
.
select_method
)
applyTitle
(
R
.
string
.
select_method
)
applyMessage
(
""
)
applyMessage
(
""
)
applyView
(
IncludeInstallOptionsBinding
.
inflate
(
LayoutInflater
.
from
(
dialog
.
context
)))
applyButton
(
MagiskDialog
.
ButtonType
.
POSITIVE
)
{
applyButton
(
MagiskDialog
.
ButtonType
.
POSITIVE
)
{
titleRes
=
R
.
string
.
download_zip_only
titleRes
=
R
.
string
.
download_zip_only
onClick
{
onClick
{
...
...
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
View file @
d713ad34
...
@@ -129,7 +129,7 @@ class MagiskDialog @JvmOverloads constructor(
...
@@ -129,7 +129,7 @@ class MagiskDialog @JvmOverloads constructor(
setCancelable
(
isCancellable
)
setCancelable
(
isCancellable
)
}
}
fun
<
Binding
:
ViewDataBinding
>
applyView
(
binding
:
Binding
,
body
:
Binding
.()
->
Unit
)
=
fun
<
Binding
:
ViewDataBinding
>
applyView
(
binding
:
Binding
,
body
:
Binding
.()
->
Unit
=
{}
)
=
apply
{
apply
{
this
.
binding
.
dialogBaseContainer
.
removeAllViews
()
this
.
binding
.
dialogBaseContainer
.
removeAllViews
()
this
.
binding
.
dialogBaseContainer
.
addView
(
binding
.
root
)
this
.
binding
.
dialogBaseContainer
.
addView
(
binding
.
root
)
...
...
app/src/main/res/layout/include_install_options.xml
0 → 100644
View file @
d713ad34
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
>
<data>
<import
type=
"com.topjohnwu.magisk.Info"
/>
</data>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:clipToPadding=
"false"
android:paddingTop=
"@dimen/l1"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
tools:layout_gravity=
"center"
>
<com.google.android.material.checkbox.MaterialCheckBox
style=
"?styleCheckboxNormal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:checked=
"@={Info.keepVerity}"
android:gravity=
"center"
android:text=
"@string/keep_dm_verity"
tools:checked=
"true"
/>
<com.google.android.material.checkbox.MaterialCheckBox
style=
"?styleCheckboxNormal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:checked=
"@={Info.keepEnc}"
android:gravity=
"center"
android:text=
"@string/keep_force_encryption"
app:tint=
"?colorPrimary"
/>
<com.google.android.material.checkbox.MaterialCheckBox
style=
"?styleCheckboxNormal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:checked=
"@={Info.recovery}"
android:gravity=
"center"
android:text=
"@string/recovery_mode"
app:tint=
"?colorPrimary"
/>
</LinearLayout>
</ScrollView>
</layout>
\ No newline at end of file
app/src/main/res/values/attrs.xml
View file @
d713ad34
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
<attr
name=
"styleImageNormal"
format=
"reference"
/>
<attr
name=
"styleImageNormal"
format=
"reference"
/>
<attr
name=
"styleImageSmall"
format=
"reference"
/>
<attr
name=
"styleImageSmall"
format=
"reference"
/>
<!--Checkbox-->
<attr
name=
"styleCheckboxNormal"
format=
"reference"
/>
<!--endregion-->
<!--endregion-->
<!--region Texts-->
<!--region Texts-->
...
...
app/src/main/res/values/styles_md2.xml
View file @
d713ad34
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
<item
name=
"styleImageNormal"
>
@style/WidgetFoundation.Image
</item>
<item
name=
"styleImageNormal"
>
@style/WidgetFoundation.Image
</item>
<item
name=
"styleImageSmall"
>
@style/WidgetFoundation.Image.Small
</item>
<item
name=
"styleImageSmall"
>
@style/WidgetFoundation.Image.Small
</item>
<item
name=
"styleCheckboxNormal"
>
@style/WidgetFoundation.Checkbox
</item>
<!--///-->
<!--///-->
<item
name=
"appearanceTextDisplayNormal"
>
@style/AppearanceFoundation.Display
</item>
<item
name=
"appearanceTextDisplayNormal"
>
@style/AppearanceFoundation.Display
</item>
...
...
app/src/main/res/values/styles_md2_impl.xml
View file @
d713ad34
...
@@ -124,4 +124,11 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
...
@@ -124,4 +124,11 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<item
name=
"tint"
>
?colorErrorTransient
</item>
<item
name=
"tint"
>
?colorErrorTransient
</item>
</style>
</style>
<style
name=
"WidgetFoundation.Checkbox"
parent=
"Widget.AppCompat.CompoundButton.CheckBox"
>
<item
name=
"android:textAppearance"
>
?appearanceTextBodyNormal
</item>
<item
name=
"android:paddingStart"
>
@dimen/l1
</item>
<item
name=
"android:paddingEnd"
>
@dimen/l1
</item>
<item
name=
"tint"
>
?colorPrimary
</item>
</style>
</resources>
</resources>
\ No newline at end of file
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