-
Notifications
You must be signed in to change notification settings - Fork 165
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
967911f
commit f04fe0a
Showing
3 changed files
with
48 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
.../main/java/com/sevtinge/hyperceiler/module/hook/screenrecorder/UnlockMoreVolumeFromNew.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,37 @@ | ||
package com.sevtinge.hyperceiler.module.hook.screenrecorder | ||
|
||
import com.github.kyuubiran.ezxhelper.EzXHelper | ||
import com.sevtinge.hyperceiler.module.base.BaseHook | ||
import com.sevtinge.hyperceiler.utils.DexKit.addUsingStringsEquals | ||
import com.sevtinge.hyperceiler.utils.DexKit.dexKitBridge | ||
import com.sevtinge.hyperceiler.utils.log.XposedLogUtils | ||
import de.robv.android.xposed.XposedHelpers | ||
import java.lang.reflect.Modifier | ||
|
||
object UnlockMoreVolumeFromNew : BaseHook() { | ||
private val getClass by lazy { | ||
dexKitBridge.findClass { | ||
matcher { | ||
addUsingStringsEquals("ro.vendor.audio.screenrecorder.bothrecor") | ||
} | ||
}.map { it.getInstance(EzXHelper.classLoader) }.first() | ||
} | ||
|
||
private val getObject by lazy { | ||
dexKitBridge.findField { | ||
matcher { | ||
declaredClass { getClass } | ||
modifiers = Modifier.PRIVATE | ||
type = "boolean" | ||
} | ||
}.map { it.getFieldInstance(EzXHelper.classLoader) }.toList() | ||
} | ||
|
||
override fun init() { | ||
XposedLogUtils.logI("hook class $getClass") | ||
for (i in getObject) { | ||
XposedHelpers.setStaticBooleanField(getClass, i.name, true) | ||
logD("hook ${i.name} true") | ||
} | ||
} | ||
} |
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