Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.drdisagree.iconify.R
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_FAILURE
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_SUBJECT
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_SUCCESS
import com.drdisagree.iconify.data.common.Const.ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY
import com.drdisagree.iconify.xposed.modules.lockscreen.AlbumArt.Companion.addAlbumArtVisibilityListener
import com.drdisagree.iconify.data.common.Const.AI_PLUGIN_PACKAGE
import com.drdisagree.iconify.data.common.Const.SYSTEMUI_PACKAGE
import com.drdisagree.iconify.data.common.Preferences.CUSTOM_DEPTH_WALLPAPER_SWITCH
Expand Down Expand Up @@ -58,6 +58,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethod
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.log
import com.drdisagree.iconify.xposed.modules.lockscreen.AlbumArt.Companion.shouldShowAlbumArt
import com.drdisagree.iconify.xposed.modules.lockscreen.Lockscreen.Companion.isComposeLockscreen
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
Expand Down Expand Up @@ -103,14 +104,7 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {
)

private var shouldShowForeground = true
private var mBroadcastRegistered = false
private val mReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent?.action == ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY) {
updateForegroundVisibility()
}
}
}
private var mAlbumArtListenerRegistered = false

override fun updatePrefs(vararg key: String) {
Xprefs.apply {
Expand Down Expand Up @@ -145,26 +139,12 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {

@SuppressLint("UnspecifiedRegisterReceiverFlag", "NewApi")
override fun handleLoadPackage(loadPackageParam: LoadPackageParam) {
// Receiver to handle foreground visibility
if (!mBroadcastRegistered) {
val intentFilter = IntentFilter().apply {
addAction(ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY)
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mContext.registerReceiver(
mReceiver,
intentFilter,
Context.RECEIVER_EXPORTED
)
} else {
mContext.registerReceiver(
mReceiver,
intentFilter
)
// Listen for album art visibility changes directly (in-process)
if (!mAlbumArtListenerRegistered) {
addAlbumArtVisibilityListener {
updateForegroundVisibility()
}

mBroadcastRegistered = true
mAlbumArtListenerRegistered = true
}

mPluginReceiver = object : BroadcastReceiver() {
Expand Down Expand Up @@ -269,6 +249,11 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

if (!mLayersCreated) {
createLayers()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.callMethodSile
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookConstructor
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookLayout
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethod
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
Expand Down Expand Up @@ -139,6 +140,11 @@ class Lockscreen(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

listOf(
"device_entry_icon_bg",
"device_entry_icon_fg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.log
import com.drdisagree.iconify.xposed.modules.extras.views.AodBurnInProtection
import com.drdisagree.iconify.xposed.modules.extras.views.ArcProgressImageView
import com.drdisagree.iconify.xposed.modules.lockscreen.Lockscreen.Companion.isComposeLockscreen
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import com.drdisagree.iconify.xposed.utils.XPrefs.XprefsIsInitialized
import de.robv.android.xposed.XC_MethodHook
Expand Down Expand Up @@ -270,6 +271,11 @@ class LockscreenClockA15(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

mLockscreenRootView = rootView

mLsItemsContainer = rootView.getLsItemsContainer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethod
import com.drdisagree.iconify.xposed.modules.extras.views.AodBurnInProtection
import com.drdisagree.iconify.xposed.modules.extras.views.CurrentWeatherView
import com.drdisagree.iconify.xposed.modules.lockscreen.Lockscreen.Companion.isComposeLockscreen
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import com.drdisagree.iconify.xposed.utils.XPrefs.XprefsIsInitialized
import de.robv.android.xposed.XC_MethodHook
Expand Down Expand Up @@ -226,6 +227,11 @@ class LockscreenWeatherA15(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

dateSmartSpaceViewAvailable = rootView.findViewById<View?>(
mContext.resources.getIdentifier(
"date_smartspace_view",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import com.drdisagree.iconify.xposed.modules.extras.views.LockscreenWidgetsView
import com.drdisagree.iconify.xposed.modules.lockscreen.Lockscreen.Companion.isComposeLockscreen
import com.drdisagree.iconify.xposed.modules.lockscreen.widgets.LockscreenWidgets.Companion.launchableImageViewClass
import com.drdisagree.iconify.xposed.modules.lockscreen.widgets.LockscreenWidgets.Companion.launchableLinearLayoutClass
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import com.drdisagree.iconify.xposed.utils.XPrefs.XprefsIsInitialized
import de.robv.android.xposed.XC_MethodHook
Expand Down Expand Up @@ -301,6 +302,11 @@ class LockscreenWidgetsA15(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

dateSmartSpaceViewAvailable = rootView.findViewById<View?>(
mContext.resources.getIdentifier(
"date_smartspace_view",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethod
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethodMatchPattern
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.log
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.setField
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.SystemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import de.robv.android.xposed.XC_MethodHook
Expand Down Expand Up @@ -954,6 +955,11 @@ class QSLightThemeA15(context: Context) : ModPack(context) {

calculateColors()

// Sony devices don't support QSLT/QSDT framework overlays due to
// different QS resource structures. The Xposed hooks in calculateColors()
// handle theming instead.
if (OemUtils.isSony) return

Utils.disableOverlays(qsLightThemeOverlay, qsDualToneOverlay)

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.drdisagree.iconify.xposed.modules.quicksettings.themes
import android.service.quicksettings.Tile
import com.drdisagree.iconify.xposed.HookEntry.Companion.enqueueProxyCommand
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.getField
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.log
import de.robv.android.xposed.XC_MethodHook

object Utils {
Expand Down Expand Up @@ -43,15 +44,23 @@ object Utils {

fun enableOverlay(pkgName: String) {
enqueueProxyCommand { proxy ->
proxy.runCommand("cmd overlay enable --user current $pkgName")
proxy.runCommand("cmd overlay set-priority $pkgName highest")
try {
proxy.runCommand("cmd overlay enable --user current $pkgName")
proxy.runCommand("cmd overlay set-priority $pkgName highest")
} catch (e: Throwable) {
log("QSThemeUtils", "Failed to enable overlay $pkgName: ${e.message}")
}
}
}

fun enableOverlay(pkgName: String, priority: String) {
enqueueProxyCommand { proxy ->
proxy.runCommand("cmd overlay enable --user current $pkgName")
proxy.runCommand("cmd overlay set-priority $pkgName $priority")
try {
proxy.runCommand("cmd overlay enable --user current $pkgName")
proxy.runCommand("cmd overlay set-priority $pkgName $priority")
} catch (e: Throwable) {
log("QSThemeUtils", "Failed to enable overlay $pkgName: ${e.message}")
}
}
}

Expand All @@ -64,13 +73,21 @@ object Utils {
}

enqueueProxyCommand { proxy ->
proxy.runCommand(command.toString().trim { it <= ' ' })
try {
proxy.runCommand(command.toString().trim { it <= ' ' })
} catch (e: Throwable) {
log("QSThemeUtils", "Failed to enable overlays: ${e.message}")
}
}
}

fun disableOverlay(pkgName: String) {
enqueueProxyCommand { proxy ->
proxy.runCommand("cmd overlay disable --user current $pkgName")
try {
proxy.runCommand("cmd overlay disable --user current $pkgName")
} catch (e: Throwable) {
log("QSThemeUtils", "Failed to disable overlay $pkgName: ${e.message}")
}
}
}

Expand All @@ -82,7 +99,11 @@ object Utils {
}

enqueueProxyCommand { proxy ->
proxy.runCommand(command.toString().trim { it <= ' ' })
try {
proxy.runCommand(command.toString().trim { it <= ' ' })
} catch (e: Throwable) {
log("QSThemeUtils", "Failed to disable overlays: ${e.message}")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.drdisagree.iconify.xposed.utils

import android.os.Build

object OemUtils {
val isSony: Boolean by lazy {
Build.MANUFACTURER.equals("Sony", ignoreCase = true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.drdisagree.iconify.R
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_FAILURE
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_SUBJECT
import com.drdisagree.iconify.data.common.Const.ACTION_EXTRACT_SUCCESS
import com.drdisagree.iconify.data.common.Const.ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY
import com.drdisagree.iconify.xposed.modules.lockscreen.AlbumArt.Companion.addAlbumArtVisibilityListener
import com.drdisagree.iconify.data.common.Const.AI_PLUGIN_PACKAGE
import com.drdisagree.iconify.data.common.Const.SYSTEMUI_PACKAGE
import com.drdisagree.iconify.data.common.Preferences.CUSTOM_DEPTH_WALLPAPER_SWITCH
Expand Down Expand Up @@ -60,6 +60,7 @@ import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.hookMethod
import com.drdisagree.iconify.xposed.modules.extras.utils.toolkit.log
import com.drdisagree.iconify.xposed.modules.lockscreen.AlbumArt.Companion.shouldShowAlbumArt
import com.drdisagree.iconify.xposed.modules.lockscreen.Lockscreen.Companion.isComposeLockscreen
import com.drdisagree.iconify.xposed.utils.OemUtils
import com.drdisagree.iconify.xposed.utils.XPrefs.Xprefs
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
Expand Down Expand Up @@ -105,14 +106,7 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {
)

private var shouldShowForeground = true
private var mBroadcastRegistered = false
private val mReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent?.action == ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY) {
updateForegroundVisibility()
}
}
}
private var mAlbumArtListenerRegistered = false

override fun updatePrefs(vararg key: String) {
Xprefs.apply {
Expand Down Expand Up @@ -147,26 +141,12 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {

@SuppressLint("UnspecifiedRegisterReceiverFlag", "NewApi")
override fun handleLoadPackage(loadPackageParam: LoadPackageParam) {
// Receiver to handle foreground visibility
if (!mBroadcastRegistered) {
val intentFilter = IntentFilter().apply {
addAction(ACTION_UPDATE_DEPTH_WALLPAPER_FOREGROUND_VISIBILITY)
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mContext.registerReceiver(
mReceiver,
intentFilter,
Context.RECEIVER_EXPORTED
)
} else {
mContext.registerReceiver(
mReceiver,
intentFilter
)
// Listen for album art visibility changes directly (in-process)
if (!mAlbumArtListenerRegistered) {
addAlbumArtVisibilityListener {
updateForegroundVisibility()
}

mBroadcastRegistered = true
mAlbumArtListenerRegistered = true
}

mPluginReceiver = object : BroadcastReceiver() {
Expand Down Expand Up @@ -271,6 +251,11 @@ class DepthWallpaperA15(context: Context) : ModPack(context) {
return@postDelayed
}

// Sony has duplicate keyguard_root_view; the correct one has clipChildren=false
if (OemUtils.isSony && rootView.clipChildren) {
return@postDelayed
}

if (!mLayersCreated) {
createLayers()
}
Expand Down
Loading