fix: rename ComponentsV2-Beta -> ComponentsV2Beta
This commit is contained in:
parent
0efe20ccc0
commit
03a3d69447
2 changed files with 11 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import com.aliucord.Constants
|
||||||
import com.aliucord.Utils
|
import com.aliucord.Utils
|
||||||
import com.aliucord.annotations.AliucordPlugin
|
import com.aliucord.annotations.AliucordPlugin
|
||||||
import com.aliucord.coreplugins.componentsv2.ComponentV2Type
|
import com.aliucord.coreplugins.componentsv2.ComponentV2Type
|
||||||
|
|
@ -30,6 +31,7 @@ import com.discord.widgets.chat.list.entries.BotUiComponentEntry
|
||||||
import com.google.gson.stream.JsonReader
|
import com.google.gson.stream.JsonReader
|
||||||
import com.lytefast.flexinput.R
|
import com.lytefast.flexinput.R
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
@AliucordPlugin(requiresRestart = true)
|
@AliucordPlugin(requiresRestart = true)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
|
|
@ -64,6 +66,14 @@ class ComponentsV2 : Plugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun start(context: Context) {
|
override fun start(context: Context) {
|
||||||
|
val oldFile = File("${Constants.PLUGINS_PATH}/ComponentsV2-Beta.zip")
|
||||||
|
if (oldFile.exists()) {
|
||||||
|
logger.info("old plugin found, deleting and prompting restart")
|
||||||
|
oldFile.delete()
|
||||||
|
Utils.promptRestart()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
XposedBridge.makeClassInheritable(BotUiComponentEntry::class.java)
|
XposedBridge.makeClassInheritable(BotUiComponentEntry::class.java)
|
||||||
ComponentV2Type.make()
|
ComponentV2Type.make()
|
||||||
patchGson()
|
patchGson()
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ rootProject.children.forEach {
|
||||||
val isCanary = it.name in canaryPlugins
|
val isCanary = it.name in canaryPlugins
|
||||||
val dir = if (isCanary) "canary" else "plugins"
|
val dir = if (isCanary) "canary" else "plugins"
|
||||||
val name = it.name
|
val name = it.name
|
||||||
if (isCanary) it.name += "-Beta"
|
if (isCanary) it.name += "Beta"
|
||||||
it.projectDir = file("${dir}/${name}")
|
it.projectDir = file("${dir}/${name}")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue