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
93c422dc
Commit
93c422dc
authored
Oct 29, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added post-merge fixes
parent
7d6eebda
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
102 additions
and
50 deletions
+102
-50
build.gradle
app/build.gradle
+1
-1
Hacks.kt
app/src/main/java/com/topjohnwu/magisk/Hacks.kt
+8
-5
XView.kt
app/src/main/java/com/topjohnwu/magisk/extensions/XView.kt
+1
-1
ViewEvents.kt
...main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt
+1
-1
EnvFixDialog.kt
.../com/topjohnwu/magisk/model/events/dialog/EnvFixDialog.kt
+1
-1
MagiskInstallDialog.kt
...pjohnwu/magisk/model/events/dialog/MagiskInstallDialog.kt
+1
-1
SuperuserRevokeDialog.kt
...ohnwu/magisk/model/events/dialog/SuperuserRevokeDialog.kt
+1
-1
Navigation.kt
.../java/com/topjohnwu/magisk/model/navigation/Navigation.kt
+2
-2
CompatActivity.kt
...va/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt
+2
-2
CompatFragment.kt
...va/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt
+2
-2
CompatNavigationDelegate.kt
...johnwu/magisk/redesign/compat/CompatNavigationDelegate.kt
+13
-5
HomeViewModel.kt
.../java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt
+3
-3
fragment_enter.xml
app/src/main/res/anim/fragment_enter.xml
+15
-0
fragment_enter_pop.xml
app/src/main/res/anim/fragment_enter_pop.xml
+15
-0
fragment_exit.xml
app/src/main/res/anim/fragment_exit.xml
+15
-0
fragment_exit_pop.xml
app/src/main/res/anim/fragment_exit_pop.xml
+15
-0
activity_main_md2.xml
app/src/main/res/layout/activity_main_md2.xml
+0
-18
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+5
-5
fragment_safetynet_md2.xml
app/src/main/res/layout/fragment_safetynet_md2.xml
+1
-1
strings_md2.xml
app/src/main/res/values/strings_md2.xml
+0
-1
No files found.
app/build.gradle
View file @
93c422dc
...
...
@@ -127,7 +127,7 @@ dependencies {
implementation
'androidx.recyclerview:recyclerview:1.1.0-rc01'
implementation
'androidx.fragment:fragment-ktx:1.2.0-rc01'
implementation
'androidx.work:work-runtime:2.2.0'
implementation
'androidx.transition:transition:1.
3.0-rc01
'
implementation
'androidx.transition:transition:1.
2.0
'
implementation
'androidx.multidex:multidex:2.0.1'
implementation
'androidx.core:core-ktx:1.1.0'
implementation
'com.google.android.material:material:1.1.0-beta01'
...
...
app/src/main/java/com/topjohnwu/magisk/Hacks.kt
View file @
93c422dc
...
...
@@ -26,13 +26,14 @@ import com.topjohnwu.magisk.ui.surequest.SuRequestActivity
import
com.topjohnwu.magisk.utils.currentLocale
import
com.topjohnwu.magisk.utils.defaultLocale
import
java.util.*
import
com.topjohnwu.magisk.redesign.MainActivity
as
RedesignActivity
fun
AssetManager
.
addAssetPath
(
path
:
String
)
{
DynAPK
.
addAssetPath
(
this
,
path
)
}
fun
Context
.
wrap
(
global
:
Boolean
=
true
):
Context
=
if
(
global
)
GlobalResContext
(
this
)
else
ResContext
(
this
)
fun
Context
.
wrap
(
global
:
Boolean
=
true
):
Context
=
if
(
global
)
GlobalResContext
(
this
)
else
ResContext
(
this
)
fun
Context
.
wrapJob
():
Context
=
object
:
GlobalResContext
(
this
)
{
...
...
@@ -74,7 +75,7 @@ fun Context.intent(c: Class<*>): Intent {
}
fun
resolveRes
(
idx
:
Int
):
Int
{
return
Info
.
stub
?.
resourceMap
?.
get
(
idx
)
?:
when
(
idx
)
{
return
Info
.
stub
?.
resourceMap
?.
get
(
idx
)
?:
when
(
idx
)
{
DynAPK
.
NOTIFICATION
->
R
.
drawable
.
ic_magisk_outline
DynAPK
.
DOWNLOAD
->
R
.
drawable
.
sc_cloud_download
DynAPK
.
SUPERUSER
->
R
.
drawable
.
sc_superuser
...
...
@@ -167,7 +168,8 @@ private class JobSchedulerWrapper(private val base: JobScheduler) : JobScheduler
val
name
=
service
.
className
val
component
=
ComponentName
(
service
.
packageName
,
Info
.
stub
!!
.
componentMap
[
name
]
?:
name
)
Info
.
stub
!!
.
componentMap
[
name
]
?:
name
)
// Clone the JobInfo except component
val
builder
=
JobInfo
.
Builder
(
id
,
component
)
...
...
@@ -217,7 +219,8 @@ object ClassMap {
UpdateCheckService
::
class
.
java
to
a
.
g
::
class
.
java
,
GeneralReceiver
::
class
.
java
to
a
.
h
::
class
.
java
,
DownloadService
::
class
.
java
to
a
.
j
::
class
.
java
,
SuRequestActivity
::
class
.
java
to
a
.
m
::
class
.
java
SuRequestActivity
::
class
.
java
to
a
.
m
::
class
.
java
,
RedesignActivity
::
class
.
java
to
a
.
i
::
class
.
java
)
operator
fun
get
(
c
:
Class
<
*
>)
=
map
.
getOrElse
(
c
)
{
throw
IllegalArgumentException
()
}
...
...
app/src/main/java/com/topjohnwu/magisk/extensions/XView.kt
View file @
93c422dc
...
...
@@ -18,6 +18,6 @@ fun View.addOnGlobalLayoutListener(oneShot: Boolean = false, callback: () -> Uni
})
fun
ViewGroup
.
startAnimations
()
{
val
transition
=
AutoTransition
().
setInterpolator
(
FastOutSlowInInterpolator
())
val
transition
=
AutoTransition
().
setInterpolator
(
FastOutSlowInInterpolator
())
.
setDuration
(
400
)
TransitionManager
.
beginDelayedTransition
(
this
,
transition
)
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt
View file @
93c422dc
...
...
@@ -123,7 +123,7 @@ class UpdateSafetyNetEvent : ViewEvent(), ContextExecutor, KoinComponent, Safety
onClick
{
downloadInternal
()
}
}
.
applyButton
(
MagiskDialog
.
ButtonType
.
NEGATIVE
)
{
titleRes
=
R
.
string
.
no_thanks
titleRes
=
android
.
R
.
string
.
no
onClick
{
rxBus
.
post
(
SafetyNetResult
(-
2
))
}
}
.
reveal
()
...
...
app/src/main/java/com/topjohnwu/magisk/model/events/dialog/EnvFixDialog.kt
View file @
93c422dc
...
...
@@ -42,7 +42,7 @@ class EnvFixDialog : DialogEvent() {
}
}
.
applyButton
(
MagiskDialog
.
ButtonType
.
NEGATIVE
)
{
titleRes
=
R
.
string
.
no_thanks
titleRes
=
android
.
R
.
string
.
no
}
.
let
{
Unit
}
...
...
app/src/main/java/com/topjohnwu/magisk/model/events/dialog/MagiskInstallDialog.kt
View file @
93c422dc
...
...
@@ -95,7 +95,7 @@ class MagiskInstallDialog : DialogEvent() {
}
}
.
applyButton
(
MagiskDialog
.
ButtonType
.
NEGATIVE
)
{
titleRes
=
R
.
string
.
no_thanks
titleRes
=
android
.
R
.
string
.
no
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/model/events/dialog/SuperuserRevokeDialog.kt
View file @
93c422dc
...
...
@@ -17,7 +17,7 @@ class SuperuserRevokeDialog(
onClick
{
callbacks
.
listenerOnSuccess
()
}
}
.
applyButton
(
MagiskDialog
.
ButtonType
.
NEGATIVE
)
{
titleRes
=
R
.
string
.
no_thanks
titleRes
=
android
.
R
.
string
.
no
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt
View file @
93c422dc
...
...
@@ -3,9 +3,9 @@ package com.topjohnwu.magisk.model.navigation
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
com.topjohnwu.magisk.ClassMap
import
com.topjohnwu.magisk.Config
import
com.topjohnwu.magisk.Const
import
com.topjohnwu.magisk.intent
import
com.topjohnwu.magisk.redesign.install.InstallFragment
import
com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment
import
com.topjohnwu.magisk.ui.MainActivity
...
...
@@ -115,7 +115,7 @@ object Navigation {
Config
.
redesign
->
RedesignActivity
::
class
.
java
else
->
MainActivity
::
class
.
java
}
Intent
(
context
,
ClassMap
[
destination
]
)
context
.
intent
(
destination
)
.
putExtra
(
Const
.
Key
.
OPEN_SECTION
,
launchIntent
.
getStringExtra
(
Const
.
Key
.
OPEN_SECTION
))
.
putExtra
(
Const
.
Key
.
OPEN_SETTINGS
,
...
...
app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt
View file @
93c422dc
...
...
@@ -7,10 +7,10 @@ import android.view.ViewGroup
import
androidx.databinding.OnRebindCallback
import
androidx.databinding.ViewDataBinding
import
androidx.fragment.app.Fragment
import
androidx.transition.TransitionManager
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.base.BaseActivity
import
com.topjohnwu.magisk.extensions.snackbar
import
com.topjohnwu.magisk.extensions.startAnimations
import
com.topjohnwu.magisk.model.events.SnackbarEvent
import
com.topjohnwu.magisk.model.events.ViewEvent
import
com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
...
...
@@ -40,7 +40,7 @@ abstract class CompatActivity<ViewModel : CompatViewModel, Binding : ViewDataBin
binding
.
addOnRebindCallback
(
object
:
OnRebindCallback
<
Binding
>()
{
override
fun
onPreBind
(
binding
:
Binding
):
Boolean
{
TransitionManager
.
beginDelayedTransition
(
binding
.
root
as
ViewGroup
)
(
binding
.
root
as
?
ViewGroup
)
?.
startAnimations
(
)
return
super
.
onPreBind
(
binding
)
}
})
...
...
app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt
View file @
93c422dc
...
...
@@ -5,8 +5,8 @@ import android.view.View
import
android.view.ViewGroup
import
androidx.databinding.OnRebindCallback
import
androidx.databinding.ViewDataBinding
import
androidx.transition.TransitionManager
import
com.topjohnwu.magisk.base.BaseFragment
import
com.topjohnwu.magisk.extensions.startAnimations
import
com.topjohnwu.magisk.model.events.ViewEvent
abstract
class
CompatFragment
<
ViewModel
:
CompatViewModel
,
Binding
:
ViewDataBinding
>
...
...
@@ -24,7 +24,7 @@ abstract class CompatFragment<ViewModel : CompatViewModel, Binding : ViewDataBin
binding
.
addOnRebindCallback
(
object
:
OnRebindCallback
<
Binding
>()
{
override
fun
onPreBind
(
binding
:
Binding
):
Boolean
{
TransitionManager
.
beginDelayedTransition
(
binding
.
root
as
ViewGroup
)
(
binding
.
root
as
?
ViewGroup
)
?.
startAnimations
(
)
return
super
.
onPreBind
(
binding
)
}
})
...
...
app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatNavigationDelegate.kt
View file @
93c422dc
...
...
@@ -2,9 +2,9 @@ package com.topjohnwu.magisk.redesign.compat
import
android.content.Intent
import
android.os.Bundle
import
androidx.fragment.app.FragmentTransaction
import
com.ncapdevi.fragnav.FragNavController
import
com.ncapdevi.fragnav.FragNavTransactionOptions
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.model.navigation.MagiskAnimBuilder
import
com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
import
com.topjohnwu.magisk.model.navigation.Navigator
...
...
@@ -106,10 +106,18 @@ class CompatNavigationDelegate<out Source>(
}
private
fun
FragNavTransactionOptions
.
Builder
.
customAnimations
(
options
:
MagiskAnimBuilder
)
=
customAnimations
(
options
.
enter
,
options
.
exit
,
options
.
popEnter
,
options
.
popExit
).
apply
{
if
(!
options
.
anySet
)
{
transition
(
FragmentTransaction
.
TRANSIT_FRAGMENT_OPEN
)
}
apply
{
if
(!
options
.
anySet
)
customAnimations
(
R
.
anim
.
fragment_enter
,
R
.
anim
.
fragment_exit
,
R
.
anim
.
fragment_enter_pop
,
R
.
anim
.
fragment_exit_pop
)
else
customAnimations
(
options
.
enter
,
options
.
exit
,
options
.
popEnter
,
options
.
popExit
)
}
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt
View file @
93c422dc
...
...
@@ -111,7 +111,7 @@ class HomeViewModel(
stateVersionUpdateMagisk
.
value
=
when
{
info
.
magisk
.
isObsolete
->
"%s > %s"
.
format
(
Info
.
magiskVersionString
.
clipVersion
(),
Info
.
env
.
magiskVersionString
.
clipVersion
(),
info
.
magisk
.
version
.
clipVersion
()
)
else
->
""
...
...
@@ -168,9 +168,9 @@ class HomeViewModel(
@Suppress
(
"unused"
)
val
MagiskJson
.
isInstalled
get
()
=
Info
.
magiskVersionCode
>
0
get
()
=
Info
.
env
.
magiskVersionCode
>
0
val
MagiskJson
.
isObsolete
get
()
=
Info
.
magiskVersionCode
<
versionCode
&&
isInstalled
get
()
=
Info
.
env
.
magiskVersionCode
<
versionCode
&&
isInstalled
val
ManagerJson
.
isUpdateChannelCorrect
get
()
=
versionCode
>
0
val
ManagerJson
.
isObsolete
...
...
app/src/main/res/anim/fragment_enter.xml
0 → 100644
View file @
93c422dc
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<alpha
android:duration=
"@android:integer/config_shortAnimTime"
android:fromAlpha=
"0"
android:toAlpha=
"1"
/>
<scale
android:duration=
"@android:integer/config_shortAnimTime"
android:fromXScale=
"0.9"
android:fromYScale=
"0.9"
android:pivotX=
"50%p"
android:pivotY=
"50%p"
android:toXScale=
"1"
android:toYScale=
"1"
/>
</set>
\ No newline at end of file
app/src/main/res/anim/fragment_enter_pop.xml
0 → 100644
View file @
93c422dc
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<alpha
android:duration=
"@android:integer/config_shortAnimTime"
android:fromAlpha=
"0"
android:toAlpha=
"1"
/>
<scale
android:duration=
"@android:integer/config_shortAnimTime"
android:fromXScale=
"1.1"
android:fromYScale=
"1.1"
android:pivotX=
"50%p"
android:pivotY=
"50%p"
android:toXScale=
"1"
android:toYScale=
"1"
/>
</set>
\ No newline at end of file
app/src/main/res/anim/fragment_exit.xml
0 → 100644
View file @
93c422dc
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<alpha
android:duration=
"@android:integer/config_shortAnimTime"
android:fromAlpha=
"1"
android:toAlpha=
"0"
/>
<scale
android:duration=
"@android:integer/config_shortAnimTime"
android:fromXScale=
"1"
android:fromYScale=
"1"
android:pivotX=
"50%p"
android:pivotY=
"50%p"
android:toXScale=
"1.1"
android:toYScale=
"1.1"
/>
</set>
\ No newline at end of file
app/src/main/res/anim/fragment_exit_pop.xml
0 → 100644
View file @
93c422dc
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<alpha
android:duration=
"@android:integer/config_shortAnimTime"
android:fromAlpha=
"1"
android:toAlpha=
"0"
/>
<scale
android:duration=
"@android:integer/config_shortAnimTime"
android:fromXScale=
"1"
android:fromYScale=
"1"
android:pivotX=
"50%p"
android:pivotY=
"50%p"
android:toXScale=
"0.9"
android:toYScale=
"0.9"
/>
</set>
\ No newline at end of file
app/src/main/res/layout/activity_main_md2.xml
View file @
93c422dc
...
...
@@ -42,24 +42,6 @@
</com.google.android.material.appbar.AppBarLayout>
<!--<com.google.android.material.card.MaterialCardView
style="?styleCardElevated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/main_toolbar_wrapper"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1">
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_gravity="start|bottom"
android:background="@drawable/bg_accent" />
</com.google.android.material.card.MaterialCardView>-->
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/main_bottom_bar"
style=
"?styleCardElevated"
...
...
app/src/main/res/layout/fragment_home_md2.xml
View file @
93c422dc
...
...
@@ -250,7 +250,7 @@
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/home_magisk_wrapper"
style=
"?styleCardVariant"
isEnabled=
"@{Info.magiskVersionCode >= 0}"
isEnabled=
"@{Info.
env.
magiskVersionCode >= 0}"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
...
...
@@ -355,7 +355,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/home_magisk_extra_version_value"
style=
"@style/W.Home.Extra.Value"
android:text=
"@{Info.magiskVersionString}"
android:text=
"@{Info.
env.
magiskVersionString}"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_extra_version_title"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/home_magisk_extra_version_title"
...
...
@@ -372,7 +372,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/home_magisk_extra_code_value"
style=
"@style/W.Home.Extra.Value"
android:text=
"@{Integer.toString(Info.magiskVersionCode)}"
android:text=
"@{Integer.toString(Info.
env.
magiskVersionCode)}"
app:layout_constraintBottom_toBottomOf=
"@+id/home_magisk_extra_code_title"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/home_magisk_extra_code_title"
...
...
@@ -416,7 +416,7 @@
tools:text=
"Normal"
/>
<androidx.constraintlayout.widget.Group
gone=
"@{Info.magiskVersionCode < 0}"
gone=
"@{Info.
env.
magiskVersionCode < 0}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:constraint_referenced_ids=
"home_magisk_extra_version_title,home_magisk_extra_version_value,home_magisk_extra_code_title,home_magisk_extra_code_value,home_magisk_extra_mode_title,home_magisk_extra_mode_value,home_magisk_extra_connection_title,home_magisk_extra_connection_value"
/>
...
...
@@ -613,7 +613,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/home_manager_extra_code_title"
/>
<!--todo(diareuse) Info.isRunningAsStub ? @string/home_extra_mode_stub : @string/home_extra_mode_normal-->
<!--todo(diareuse) Info.
env.
isRunningAsStub ? @string/home_extra_mode_stub : @string/home_extra_mode_normal-->
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/home_manager_extra_mode_value"
...
...
app/src/main/res/layout/fragment_safetynet_md2.xml
View file @
93c422dc
...
...
@@ -77,7 +77,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l_50"
android:text=
"@{Info.magiskVersionString}"
android:text=
"@{Info.
env.
magiskVersionString}"
android:textAppearance=
"?appearanceTextCaptionNormal"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"@+id/safetynet_magisk_title"
...
...
app/src/main/res/values/strings_md2.xml
View file @
93c422dc
...
...
@@ -2,7 +2,6 @@
<resources>
<string
name=
"manager"
>
Manager
</string>
<string
name=
"magisk"
>
Magisk
</string>
<string
name=
"system"
>
System
</string>
<string
name=
"yes"
>
Yes
</string>
...
...
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