mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-17 16:55:10 +00:00
fixed suffix
This commit is contained in:
parent
37cc8ae766
commit
6f75f025ad
2 changed files with 34 additions and 17 deletions
|
@ -75,7 +75,7 @@ open class Home : BaseFragment() {
|
|||
|
||||
val microgVerText = view.findViewById<TextView>(R.id.microg_installed_version)
|
||||
if (microgStatus!!) {
|
||||
val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName
|
||||
val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName.removeSuffix("-dirty")
|
||||
|
||||
microguninstallbtn.setOnClickListener {
|
||||
uninstallApk("com.mgoogle.android.gms")
|
||||
|
|
|
@ -76,34 +76,51 @@ class HomeFragment : Home() {
|
|||
|
||||
val vancedRemoteVer =
|
||||
GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/vanced.json")
|
||||
.get("version").asString
|
||||
.get("version").asInt
|
||||
val microgRemoteVer =
|
||||
GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/microg.json")
|
||||
.get("version").asString
|
||||
vancedLatestTxt?.text = vancedRemoteVer
|
||||
microgLatestTxt?.text = microgRemoteVer
|
||||
.get("version").asInt
|
||||
vancedLatestTxt?.text = vancedRemoteVer.toString()
|
||||
microgLatestTxt?.text = microgRemoteVer.toString()
|
||||
|
||||
if (microgStatus!!) {
|
||||
val microgVer =
|
||||
pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName
|
||||
if (microgRemoteVer == microgVer) {
|
||||
pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName.removeSuffix("-dirty").toInt()
|
||||
when {
|
||||
microgRemoteVer > microgVer -> {
|
||||
microginstallbtn?.text =
|
||||
activity?.getString(com.vanced.manager.R.string.button_installed)
|
||||
activity?.getString(R.string.update)
|
||||
microginstallbtn?.icon =
|
||||
activity?.getDrawable(com.vanced.manager.R.drawable.outline_cloud_done_24)
|
||||
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
|
||||
}
|
||||
|
||||
microgRemoteVer == microgVer -> {
|
||||
microginstallbtn?.text =
|
||||
activity?.getString(R.string.button_installed)
|
||||
microginstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.outline_cloud_done_24)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vancedStatus!!) {
|
||||
val vancedVer =
|
||||
pm.getPackageInfo("com.vanced.android.youtube", 0).versionName
|
||||
if (vancedRemoteVer == vancedVer) {
|
||||
pm.getPackageInfo("com.vanced.android.youtube", 0).versionName.toInt()
|
||||
when {
|
||||
vancedRemoteVer > vancedVer -> {
|
||||
vancedinstallbtn?.text =
|
||||
activity?.getString(R.string.update)
|
||||
vancedinstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
|
||||
}
|
||||
vancedRemoteVer == vancedVer -> {
|
||||
vancedinstallbtn?.text =
|
||||
activity?.getString(R.string.button_installed)
|
||||
vancedinstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.outline_cloud_done_24)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
|
||||
|
|
Loading…
Reference in a new issue