-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71067d9
commit 5e812da
Showing
6 changed files
with
138 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/src/main/kotlin/star/sky/voyager/hook/hooks/systemui/MonetTheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package star.sky.voyager.hook.hooks.systemui | ||
|
||
import android.graphics.Color | ||
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClassOrNull | ||
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook | ||
import com.github.kyuubiran.ezxhelper.Log | ||
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder | ||
import star.sky.voyager.utils.init.HookRegister | ||
import star.sky.voyager.utils.key.XSPUtils | ||
import star.sky.voyager.utils.key.hasEnable | ||
|
||
object MonetTheme : HookRegister() { | ||
override fun init() = hasEnable("monet_theme") { | ||
loadClassOrNull("com.android.systemui.theme.ThemeOverlayController")?.methodFinder() | ||
?.first { | ||
name == "getOverlay" && parameterCount == 3 && parameterTypes[0] == Int::class.java && parameterTypes[1] == Int::class.java | ||
}?.createHook { | ||
before { param -> | ||
param.args[0] = | ||
Color.parseColor(XSPUtils.getString("your_theme_accent_color", "#0d84ff")) | ||
param.args[1] = | ||
Color.parseColor(XSPUtils.getString("your_theme_neutral_color", "#0d84ff")) | ||
Log.i("Your monet theme color1:" + param.args[0]) | ||
Log.i("Your monet theme color2:" + param.args[1]) | ||
Log.i("Your monet theme style:" + param.args[2]) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters