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
f5e5ab24
Commit
f5e5ab24
authored
Jan 27, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Android Studio
parent
ff5ea1a7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
17 deletions
+27
-17
build.gradle.kts
app/build.gradle.kts
+6
-5
ServiceLocator.kt
app/src/main/java/com/topjohnwu/magisk/di/ServiceLocator.kt
+4
-4
MagiskDialog.kt
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
+3
-3
ConcealableBottomNavigationView.java
...johnwu/magisk/widget/ConcealableBottomNavigationView.java
+2
-2
build.gradle.kts
buildSrc/build.gradle.kts
+10
-2
Setup.kt
buildSrc/src/main/java/Setup.kt
+1
-1
gradle.properties
gradle.properties
+1
-0
No files found.
app/build.gradle.kts
View file @
f5e5ab24
...
@@ -57,6 +57,7 @@ android {
...
@@ -57,6 +57,7 @@ android {
kotlinOptions
{
kotlinOptions
{
jvmTarget
=
"11"
jvmTarget
=
"11"
freeCompilerArgs
=
listOf
(
"-Xjvm-default=enable"
)
}
}
}
}
...
@@ -109,19 +110,19 @@ dependencies {
...
@@ -109,19 +110,19 @@ dependencies {
implementation
(
"androidx.room:room-ktx:${vRoom}"
)
implementation
(
"androidx.room:room-ktx:${vRoom}"
)
kapt
(
"androidx.room:room-compiler:${vRoom}"
)
kapt
(
"androidx.room:room-compiler:${vRoom}"
)
val
vNav
=
"2.
4.0-rc
01"
val
vNav
=
"2.
5.0-alpha
01"
implementation
(
"androidx.navigation:navigation-fragment-ktx:${vNav}"
)
implementation
(
"androidx.navigation:navigation-fragment-ktx:${vNav}"
)
implementation
(
"androidx.navigation:navigation-ui-ktx:${vNav}"
)
implementation
(
"androidx.navigation:navigation-ui-ktx:${vNav}"
)
implementation
(
"androidx.biometric:biometric:1.1.0"
)
implementation
(
"androidx.biometric:biometric:1.1.0"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.1.
2
"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.1.
3
"
)
implementation
(
"androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
)
implementation
(
"androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
)
implementation
(
"androidx.appcompat:appcompat:1.4.1"
)
implementation
(
"androidx.appcompat:appcompat:1.4.1"
)
implementation
(
"androidx.preference:preference:1.
1.1
"
)
implementation
(
"androidx.preference:preference:1.
2.0
"
)
implementation
(
"androidx.recyclerview:recyclerview:1.2.1"
)
implementation
(
"androidx.recyclerview:recyclerview:1.2.1"
)
implementation
(
"androidx.fragment:fragment-ktx:1.4.
0
"
)
implementation
(
"androidx.fragment:fragment-ktx:1.4.
1
"
)
implementation
(
"androidx.transition:transition:1.4.1"
)
implementation
(
"androidx.transition:transition:1.4.1"
)
implementation
(
"androidx.core:core-ktx:1.7.0"
)
implementation
(
"androidx.core:core-ktx:1.7.0"
)
implementation
(
"androidx.core:core-splashscreen:1.0.0-beta01"
)
implementation
(
"androidx.core:core-splashscreen:1.0.0-beta01"
)
implementation
(
"com.google.android.material:material:1.
4
.0"
)
implementation
(
"com.google.android.material:material:1.
5
.0"
)
}
}
app/src/main/java/com/topjohnwu/magisk/di/ServiceLocator.kt
View file @
f5e5ab24
...
@@ -54,14 +54,14 @@ object ServiceLocator {
...
@@ -54,14 +54,14 @@ object ServiceLocator {
object
VMFactory
:
ViewModelProvider
.
Factory
{
object
VMFactory
:
ViewModelProvider
.
Factory
{
@Suppress
(
"UNCHECKED_CAST"
)
@Suppress
(
"UNCHECKED_CAST"
)
override
fun
<
T
:
ViewModel
?
>
create
(
clz
:
Class
<
T
>):
T
{
override
fun
<
T
:
ViewModel
>
create
(
modelClass
:
Class
<
T
>):
T
{
return
when
(
clz
)
{
return
when
(
modelClass
)
{
HomeViewModel
::
class
.
java
->
HomeViewModel
(
networkService
)
HomeViewModel
::
class
.
java
->
HomeViewModel
(
networkService
)
LogViewModel
::
class
.
java
->
LogViewModel
(
logRepo
)
LogViewModel
::
class
.
java
->
LogViewModel
(
logRepo
)
SuperuserViewModel
::
class
.
java
->
SuperuserViewModel
(
policyDB
)
SuperuserViewModel
::
class
.
java
->
SuperuserViewModel
(
policyDB
)
InstallViewModel
::
class
.
java
->
InstallViewModel
(
networkService
)
InstallViewModel
::
class
.
java
->
InstallViewModel
(
networkService
)
SuRequestViewModel
::
class
.
java
->
SuRequestViewModel
(
policyDB
,
timeoutPrefs
)
SuRequestViewModel
::
class
.
java
->
SuRequestViewModel
(
policyDB
,
timeoutPrefs
)
else
->
clz
.
newInstance
()
else
->
modelClass
.
newInstance
()
}
as
T
}
as
T
}
}
}
}
...
@@ -69,7 +69,7 @@ object ServiceLocator {
...
@@ -69,7 +69,7 @@ object ServiceLocator {
inline
fun
<
reified
VM
:
ViewModel
>
ViewModelStoreOwner
.
viewModel
()
=
inline
fun
<
reified
VM
:
ViewModel
>
ViewModelStoreOwner
.
viewModel
()
=
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
ViewModelProvider
(
this
,
ServiceLocator
.
VMFactory
)
.
get
(
VM
::
class
.
java
)
ViewModelProvider
(
this
,
ServiceLocator
.
VMFactory
)
[
VM
::
class
.
java
]
}
}
private
fun
createSuLogDatabase
(
context
:
Context
)
=
private
fun
createSuLogDatabase
(
context
:
Context
)
=
...
...
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
View file @
f5e5ab24
...
@@ -121,15 +121,15 @@ class MagiskDialog(
...
@@ -121,15 +121,15 @@ class MagiskDialog(
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
super
.
setContentView
(
binding
.
root
)
super
.
setContentView
(
binding
.
root
)
val
default
=
MaterialColors
.
getColor
(
context
,
R
.
attr
.
colorSurface
,
javaClass
.
canonicalName
)
val
default
=
MaterialColors
.
getColor
(
context
,
com
.
google
.
android
.
material
.
R
.
attr
.
colorSurface
,
javaClass
.
canonicalName
)
val
surfaceColor
=
MaterialColors
.
getColor
(
context
,
R
.
attr
.
colorSurfaceSurfaceVariant
,
default
)
val
surfaceColor
=
MaterialColors
.
getColor
(
context
,
R
.
attr
.
colorSurfaceSurfaceVariant
,
default
)
val
materialShapeDrawable
=
MaterialShapeDrawable
(
context
,
null
,
R
.
attr
.
alertDialogStyle
,
R
.
style
.
MaterialAlertDialog_MaterialComponents
)
val
materialShapeDrawable
=
MaterialShapeDrawable
(
context
,
null
,
androidx
.
appcompat
.
R
.
attr
.
alertDialogStyle
,
com
.
google
.
android
.
material
.
R
.
style
.
MaterialAlertDialog_MaterialComponents
)
materialShapeDrawable
.
initializeElevationOverlay
(
context
)
materialShapeDrawable
.
initializeElevationOverlay
(
context
)
materialShapeDrawable
.
fillColor
=
ColorStateList
.
valueOf
(
surfaceColor
)
materialShapeDrawable
.
fillColor
=
ColorStateList
.
valueOf
(
surfaceColor
)
materialShapeDrawable
.
elevation
=
context
.
resources
.
getDimension
(
R
.
dimen
.
margin_generic
)
materialShapeDrawable
.
elevation
=
context
.
resources
.
getDimension
(
R
.
dimen
.
margin_generic
)
materialShapeDrawable
.
setCornerSize
(
context
.
resources
.
getDimension
(
R
.
dimen
.
l_50
))
materialShapeDrawable
.
setCornerSize
(
context
.
resources
.
getDimension
(
R
.
dimen
.
l_50
))
val
inset
=
context
.
resources
.
getDimensionPixelSize
(
R
.
dimen
.
appcompat_dialog_background_inset
)
val
inset
=
context
.
resources
.
getDimensionPixelSize
(
com
.
google
.
android
.
material
.
R
.
dimen
.
appcompat_dialog_background_inset
)
window
?.
apply
{
window
?.
apply
{
setBackgroundDrawable
(
InsetDrawable
(
materialShapeDrawable
,
inset
,
inset
,
inset
,
inset
))
setBackgroundDrawable
(
InsetDrawable
(
materialShapeDrawable
,
inset
,
inset
,
inset
,
inset
))
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
...
...
app/src/main/java/com/topjohnwu/magisk/widget/ConcealableBottomNavigationView.java
View file @
f5e5ab24
...
@@ -29,11 +29,11 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
...
@@ -29,11 +29,11 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
}
}
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
R
.
attr
.
bottomNavigationStyle
);
this
(
context
,
attrs
,
com
.
google
.
android
.
material
.
R
.
attr
.
bottomNavigationStyle
);
}
}
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
this
(
context
,
attrs
,
defStyleAttr
,
R
.
style
.
Widget_Design_BottomNavigationView
);
this
(
context
,
attrs
,
defStyleAttr
,
com
.
google
.
android
.
material
.
R
.
style
.
Widget_Design_BottomNavigationView
);
}
}
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
public
ConcealableBottomNavigationView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
...
...
buildSrc/build.gradle.kts
View file @
f5e5ab24
import
org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins
{
plugins
{
`
kotlin
-
dsl
`
`
kotlin
-
dsl
`
}
}
...
@@ -15,10 +17,16 @@ gradlePlugin {
...
@@ -15,10 +17,16 @@ gradlePlugin {
}
}
}
}
tasks
.
withType
<
KotlinCompile
>
{
kotlinOptions
{
jvmTarget
=
"11"
}
}
dependencies
{
dependencies
{
implementation
(
kotlin
(
"gradle-plugin"
,
"1.6.10"
))
implementation
(
kotlin
(
"gradle-plugin"
,
"1.6.10"
))
implementation
(
"com.android.tools.build:gradle:7.
0.4
"
)
implementation
(
"com.android.tools.build:gradle:7.
1.0
"
)
implementation
(
"androidx.navigation:navigation-safe-args-gradle-plugin:2.
4.0-rc
01"
)
implementation
(
"androidx.navigation:navigation-safe-args-gradle-plugin:2.
5.0-alpha
01"
)
implementation
(
"io.michaelrocks:paranoid-gradle-plugin:0.3.7"
)
implementation
(
"io.michaelrocks:paranoid-gradle-plugin:0.3.7"
)
implementation
(
"org.eclipse.jgit:org.eclipse.jgit:5.12.0.202106070339-r"
)
implementation
(
"org.eclipse.jgit:org.eclipse.jgit:5.12.0.202106070339-r"
)
}
}
buildSrc/src/main/java/Setup.kt
View file @
f5e5ab24
...
@@ -29,7 +29,7 @@ fun Project.setupCommon() {
...
@@ -29,7 +29,7 @@ fun Project.setupCommon() {
androidBase
{
androidBase
{
compileSdkVersion
(
31
)
compileSdkVersion
(
31
)
buildToolsVersion
=
"31.0.0"
buildToolsVersion
=
"31.0.0"
ndkPath
=
"$
{System.getenv("
ANDROID_SDK_ROOT
")}
/ndk/magisk"
ndkPath
=
"$
sdkDirectory
/ndk/magisk"
defaultConfig
{
defaultConfig
{
minSdk
=
21
minSdk
=
21
...
...
gradle.properties
View file @
f5e5ab24
...
@@ -24,6 +24,7 @@ org.gradle.caching=true
...
@@ -24,6 +24,7 @@ org.gradle.caching=true
android.useAndroidX
=
true
android.useAndroidX
=
true
android.databinding.incremental
=
true
android.databinding.incremental
=
true
android.injected.testOnly
=
false
android.injected.testOnly
=
false
android.nonTransitiveRClass
=
true
# Magisk
# Magisk
magisk.stubVersion
=
23
magisk.stubVersion
=
23
...
...
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