Skip to content

Commit 46071f1

Browse files
authored
android: remove broken volume panel hook
Removed volume panel hooking logic and related classes.
1 parent 13ab2d1 commit 46071f1

1 file changed

Lines changed: 0 additions & 61 deletions

File tree

android/app/src/main/java/me/kavishdevar/librepods/utils/KotlinModule.kt

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -109,67 +109,6 @@ class KotlinModule(base: XposedInterface, param: ModuleLoadedParam): XposedModul
109109
Log.e(TAG, "Failed to hook Bluetooth icon handler: ${e.message}", e)
110110
}
111111
}
112-
113-
if (param.packageName == "com.android.systemui") {
114-
Log.i(TAG, "SystemUI detected, hooking volume panel")
115-
try {
116-
val volumePanelViewClass = param.classLoader.loadClass("com.android.systemui.volume.VolumeDialogImpl")
117-
118-
try {
119-
val initDialogMethod = volumePanelViewClass.getDeclaredMethod("initDialog", Int::class.java)
120-
hook(initDialogMethod, VolumeDialogInitHooker::class.java)
121-
Log.i(TAG, "Hooked initDialog method successfully")
122-
} catch (e: Exception) {
123-
Log.e(TAG, "Failed to hook initDialog method: ${e.message}")
124-
}
125-
126-
try {
127-
val showHMethod = volumePanelViewClass.getDeclaredMethod("showH", Int::class.java, Boolean::class.java, Int::class.java)
128-
hook(showHMethod, VolumeDialogShowHooker::class.java)
129-
Log.i(TAG, "Hooked showH method successfully")
130-
} catch (e: Exception) {
131-
Log.e(TAG, "Failed to hook showH method: ${e.message}")
132-
}
133-
134-
Log.i(TAG, "Volume panel hook setup attempted on multiple methods")
135-
} catch (e: Exception) {
136-
Log.e(TAG, "Failed to hook volume panel: ${e.message}", e)
137-
}
138-
}
139-
}
140-
141-
@XposedHooker
142-
class VolumeDialogInitHooker : XposedInterface.Hooker {
143-
companion object {
144-
@JvmStatic
145-
@AfterInvocation
146-
fun afterInitDialog(callback: AfterHookCallback) {
147-
try {
148-
val volumeDialog = callback.thisObject
149-
Log.i(TAG, "Volume dialog initialized, adding AirPods controls")
150-
addAirPodsControlsToDialog(volumeDialog!!)
151-
} catch (e: Exception) {
152-
Log.e(TAG, "Error in initDialog hook: ${e.message}", e)
153-
}
154-
}
155-
}
156-
}
157-
158-
@XposedHooker
159-
class VolumeDialogShowHooker : XposedInterface.Hooker {
160-
companion object {
161-
@JvmStatic
162-
@AfterInvocation
163-
fun afterShowH(callback: AfterHookCallback) {
164-
try {
165-
val volumeDialog = callback.thisObject
166-
Log.i(TAG, "Volume dialog shown, ensuring AirPods controls are added")
167-
addAirPodsControlsToDialog(volumeDialog!!)
168-
} catch (e: Exception) {
169-
Log.e(TAG, "Error in showH hook: ${e.message}", e)
170-
}
171-
}
172-
}
173112
}
174113

175114
@XposedHooker

0 commit comments

Comments
 (0)