im a moron im a moron im a moron
This commit is contained in:
parent
c52ef9ca1a
commit
0b26d2bd9e
5 changed files with 8 additions and 39 deletions
|
|
@ -12,8 +12,8 @@ android {
|
|||
applicationId = "cocobo1.pupu.xposed"
|
||||
minSdk = 22
|
||||
targetSdk = 36
|
||||
versionCode = 1100
|
||||
versionName = "1.1.0"
|
||||
versionCode = 1110
|
||||
versionName = "1.1.1"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
|||
|
|
@ -50,37 +50,6 @@ class FontsModule: Module() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun hookClass(classLoader: ClassLoader, className: String) {
|
||||
XposedHelpers.findAndHookMethod(
|
||||
className,
|
||||
classLoader,
|
||||
"createAssetTypeface",
|
||||
String::class.java,
|
||||
Int::class.java,
|
||||
"android.content.res.AssetManager",
|
||||
object : XC_MethodReplacement() {
|
||||
override fun replaceHookedMethod(param: MethodHookParam): Typeface? {
|
||||
val fontFamilyName: String = param.args[0].toString()
|
||||
val style: Int = param.args[1] as Int
|
||||
val assetManager: AssetManager = param.args[2] as AssetManager
|
||||
return createAssetTypeface(fontFamilyName, style, assetManager)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// override fun onInit(packageParam: XC_LoadPackage.LoadPackageParam) = with (packageParam) {
|
||||
// XposedHelpers.findAndHookMethod("com.facebook.react.views.text.ReactFontManager", classLoader, "createAssetTypeface",
|
||||
// String::class.java,
|
||||
// Int::class.java,
|
||||
// "android.content.res.AssetManager", object : XC_MethodReplacement() {
|
||||
// override fun replaceHookedMethod(param: MethodHookParam): Typeface? {
|
||||
// val fontFamilyName: String = param.args[0].toString()
|
||||
// val style: Int = param.args[1] as Int
|
||||
// val assetManager: AssetManager = param.args[2] as AssetManager
|
||||
// return createAssetTypeface(fontFamilyName, style, assetManager)
|
||||
// }
|
||||
// })
|
||||
|
||||
override fun onInit(packageParam: XC_LoadPackage.LoadPackageParam) = with (packageParam) {
|
||||
try {
|
||||
// Try to hook on versions (280201+)
|
||||
|
|
@ -93,7 +62,7 @@ class FontsModule: Module() {
|
|||
}
|
||||
}
|
||||
|
||||
val fontDefFile = File(appInfo.dataDir, "files/pyon/fonts.json")
|
||||
val fontDefFile = File(appInfo.dataDir, "files/pyoncord/fonts.json")
|
||||
if (!fontDefFile.exists()) return@with
|
||||
|
||||
val fontDef = try {
|
||||
|
|
@ -101,7 +70,7 @@ class FontsModule: Module() {
|
|||
json.decodeFromString<FontDefinition>(fontDefFile.readText())
|
||||
} catch (_: Throwable) { return@with }
|
||||
|
||||
fontsDownloadsDir = File(appInfo.dataDir, "files/pyon/downloads/fonts").apply { mkdirs() }
|
||||
fontsDownloadsDir = File(appInfo.dataDir, "files/pyoncord/downloads/fonts").apply { mkdirs() }
|
||||
fontsDir = File(fontsDownloadsDir, fontDef.name!!).apply { mkdirs() }
|
||||
fontsAbsPath = fontsDir.absolutePath + "/"
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class LogBoxModule: Module() {
|
|||
reloadApp()
|
||||
}
|
||||
1 -> {
|
||||
val bundleFile = File(packageParam.appInfo.dataDir, "cache/pyon/bundle.js")
|
||||
val bundleFile = File(packageParam.appInfo.dataDir, "cache/pyoncord/bundle.js")
|
||||
if (bundleFile.exists()) {
|
||||
bundleFile.delete()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ class Main : IXposedHookLoadPackage {
|
|||
String::class.java
|
||||
).apply { isAccessible = true }
|
||||
|
||||
val cacheDir = File(appInfo.dataDir, "cache/pyon").apply { mkdirs() }
|
||||
val filesDir = File(appInfo.dataDir, "files/pyon").apply { mkdirs() }
|
||||
val cacheDir = File(appInfo.dataDir, "cache/pyoncord").apply { mkdirs() }
|
||||
val filesDir = File(appInfo.dataDir, "files/pyoncord").apply { mkdirs() }
|
||||
|
||||
val preloadsDir = File(filesDir, "preloads").apply { mkdirs() }
|
||||
val bundle = File(cacheDir, "bundle.js")
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class ThemeModule : Module() {
|
|||
|
||||
private fun getTheme(): Theme? {
|
||||
val filesDir = File(param.appInfo.dataDir, "files").apply { mkdirs() }
|
||||
val pyonDir = File(filesDir, "pyon").apply { mkdirs() }
|
||||
val pyonDir = File(filesDir, "pyoncord").apply { mkdirs() }
|
||||
val themeFile = File(pyonDir, "current-theme.json")
|
||||
|
||||
val legacyThemeFile = File(filesDir, "vendetta_theme.json")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue