-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 华为音乐支持 * Update app_rules.json --------- Co-authored-by: xiao_wine <[email protected]>
- Loading branch information
Showing
5 changed files
with
64 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package cn.lyric.getter.hook.app | ||
|
||
import cn.lyric.getter.hook.BaseHook | ||
import cn.lyric.getter.tool.HookTools | ||
import cn.lyric.getter.tool.HookTools.eventTools | ||
import cn.xiaowine.xkt.LogTool.log | ||
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass | ||
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook | ||
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder | ||
import java.util.Arrays | ||
|
||
object Huawei : BaseHook() { | ||
override fun init() { | ||
super.init() | ||
//// 让程序以为连接了蓝牙 | ||
loadClass("com.android.mediacenter.localmusic.VehicleLyricControl").methodFinder() | ||
.first { name == "isEnableRefreshShowLyric" } | ||
.createHook { | ||
after { param -> | ||
val resultIntent = param.result as Boolean | ||
//resultIntent.log() | ||
} | ||
before { | ||
val field = it.thisObject.javaClass.getDeclaredField("mIsBluetoothA2dpConnect") | ||
field.isAccessible = true // 确保可以访问私有字段 | ||
field.setBoolean(it.thisObject, true) // 设置值为 true | ||
} | ||
} | ||
|
||
|
||
loadClass("com.android.mediacenter.localmusic.MediaSessionController").methodFinder() | ||
.first { name == "updateLyric" } | ||
.createHook { | ||
before { | ||
val lyric = it.args | ||
val lyricWithoutBrackets = Arrays.toString(lyric).substring(1, Arrays.toString(lyric).length - 1) | ||
//lyricWithoutBrackets.log() | ||
eventTools.sendLyric(lyricWithoutBrackets) | ||
} | ||
} | ||
} | ||
} |
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