From 0f3bb6bc4a781be201ce626112dcc6ecf17f2537 Mon Sep 17 00:00:00 2001 From: spicy Date: Sun, 9 Aug 2020 21:15:34 +0700 Subject: [PATCH 001/138] Update strings.xml Nyan~ --- app/src/main/res/values/strings.xml | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b46c2164..ec0c5e36 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,17 +18,17 @@ Error Downloading %1$s Install Installing %1$s - Operation failed because the user aborted the installation. - Operation failed because the user blocked the installation. - Operation failed because the user tried to downgrade the package. Do you have stock YouTube Installed? - Operation failed because the app conflicts with an already installed app. - Operation failed for an unknown reason, please join our Telegram or Discord for support. - Operation failed because the app is incompatible with your device. - Operation failed because the apk files are invalid. - Operation failed because the user didn\'t disable apk signature verification - An unexpected error occurred while installing Vanced. Have you disabled MIUI Optimisations? - Operation failed due to a storage error. - Please wait until the installation finishes + Installation failed because user aborted the installation. + Installation failed because user blocked the installation. + Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app then try again. + Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced then try again. + Installation failed for unknown reasons, join our Telegram or Discord for futher support. + Installation failed because the installation file is incompatible with your device. Choose another architecture for instalation. + Installation failed because the apk files are corrupted. + Installation failed because apk signature verification is enabled. Disable apk signature verification then try again. + Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization then try again. + Installation failed due to a storage error. + DO NOT leave the app until the installation finishes. Reinstall Installed: Latest: @@ -41,7 +41,7 @@ Useful Links Website Support us! - %1$s version was copied! + %1$s version number was copied! Accent Color @@ -76,22 +76,22 @@ Dismiss Guide - Hold on! - Looks like you\'re using the Magisk/TWRP version of Vanced, which is discontinued and can not be updated using this app. Please remove it first by removing the magisk module/using TWRP Vanced uninstaller. + Stop! + You are using the Magisk/TWRP version of Vanced, which is discontinued and cannot be updated using this app. Please remove it by removing the magisk module/using TWRP Vanced uninstaller. MIUI detected! - Hey! it looks like you\'re a MIUI user. in order to properly use this application, you will have to disable MIUI optimisations in the developer settings. (You can safely ignore this warning if you are on a 20.2.20 or later ROM based on xiaomi.eu) + In order to properly install Vanced, you MUST disable MIUI Optimisations in the developer settings. (You can ignore this warning if you are on a 20.2.20 or later xiaomi.eu based ROM) Error - Please make sure, that you downloaded the app from vanced.app, the Vanced Discord server or the Vanced GitHub + Make sure that you downloaded the app from vanced.app, the Vanced Discord server or the Vanced GitHub Success! - Vanced has successfully been installed! Launch now? - Launch + Vanced has successfully been installed! Open now? + Open Welcome - Choose your preferred language for Vanced + Choose your preferred language(s) for Vanced Note: English will always be installed as an additional language as well. Choose your preferred theme for Vanced - Root mode detected! To install Vanced, you will need to disable the apk signature verification. + Root mode detected! To install Vanced, you MUST disable the apk signature verification. Finish Light + Black Light + Dark @@ -102,4 +102,4 @@ Sources Vanced Team - \ No newline at end of file + From 6984ce0370cc1a18bfb2cf50d0fb5cc2bae9f6de Mon Sep 17 00:00:00 2001 From: spicy Date: Sun, 9 Aug 2020 21:33:27 +0700 Subject: [PATCH 002/138] Update strings.xml --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ec0c5e36..f15171ac 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,7 +23,7 @@ Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app then try again. Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced then try again. Installation failed for unknown reasons, join our Telegram or Discord for futher support. - Installation failed because the installation file is incompatible with your device. Choose another architecture for instalation. + Installation failed because the installation file is incompatible with your device. Choose another architecture for installation. Installation failed because the apk files are corrupted. Installation failed because apk signature verification is enabled. Disable apk signature verification then try again. Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization then try again. From 34980c2605fbc10b0fdca49deb9d9f0f131cc1ba Mon Sep 17 00:00:00 2001 From: X1nto Date: Sun, 9 Aug 2020 19:28:56 +0400 Subject: [PATCH 003/138] some crash fixes --- app/src/main/AndroidManifest.xml | 3 +- .../VancedLanguageSelectionFragment.kt | 40 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 52f5c22b..d468ac35 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,7 +37,8 @@ + android:theme="@style/DarkTheme.Blue" + android:exported="true"/> - val loc = Locale(lang) - val box: MaterialCheckBox = MaterialCheckBox(requireActivity()).apply { - tag = lang - text = loc.getDisplayLanguage(loc).capitalize(Locale.ROOT) - textSize = 18F - typeface = ResourcesCompat.getFont(requireActivity(), R.font.exo_bold) - } - view.findViewById(R.id.lang_button_ll) - .addView(box, MATCH_PARENT, WRAP_CONTENT) - } - } - } + loadBoxes(view.findViewById(R.id.lang_button_ll)) view.findViewById(R.id.vanced_install_finish).setOnClickListener { val chosenLangs = mutableListOf("en") if (!langs.contains("null")) @@ -75,4 +60,25 @@ class VancedLanguageSelectionFragment : Fragment() { } } + @ExperimentalStdlibApi + private fun loadBoxes(ll: LinearLayout) { + CoroutineScope(Dispatchers.Main).launch { + if (this@VancedLanguageSelectionFragment::langs.isInitialized) { + if (!langs.contains("null")) { + langs.forEach { lang -> + val loc = Locale(lang) + val box: MaterialCheckBox = MaterialCheckBox(requireActivity()).apply { + tag = lang + text = loc.getDisplayLanguage(loc).capitalize(Locale.ROOT) + textSize = 18F + typeface = ResourcesCompat.getFont(requireActivity(), R.font.exo_bold) + } + ll.addView(box, MATCH_PARENT, WRAP_CONTENT) + } + } + } else + loadBoxes(ll) + } + } + } From 499c37371425cf63bdac3af368d54de567f73831 Mon Sep 17 00:00:00 2001 From: spicy Date: Sun, 9 Aug 2020 22:34:04 +0700 Subject: [PATCH 004/138] Update strings.xml --- app/src/main/res/values/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f15171ac..7e48e972 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,13 +20,13 @@ Installing %1$s Installation failed because user aborted the installation. Installation failed because user blocked the installation. - Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app then try again. - Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced then try again. + Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app and try again. + Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced and try again. Installation failed for unknown reasons, join our Telegram or Discord for futher support. - Installation failed because the installation file is incompatible with your device. Choose another architecture for installation. + Installation failed because the installation file is incompatible with your device. Clear downloaded files in the Settings and try again. Installation failed because the apk files are corrupted. - Installation failed because apk signature verification is enabled. Disable apk signature verification then try again. - Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization then try again. + Installation failed because apk signature verification is enabled. Disable apk signature verification and try again. + Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization and try again. Installation failed due to a storage error. DO NOT leave the app until the installation finishes. Reinstall From d5db86536c28d8ee97cc023392c7156a458c4c6d Mon Sep 17 00:00:00 2001 From: spicy Date: Mon, 10 Aug 2020 00:14:03 +0700 Subject: [PATCH 005/138] Update strings.xml --- app/src/main/res/values/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7e48e972..c41dcda4 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,13 +20,13 @@ Installing %1$s Installation failed because user aborted the installation. Installation failed because user blocked the installation. - Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app and try again. - Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced and try again. + Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app, then try again. + Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced, then try again. Installation failed for unknown reasons, join our Telegram or Discord for futher support. - Installation failed because the installation file is incompatible with your device. Clear downloaded files in the Settings and try again. + Installation failed because the installation file is incompatible with your device. Clear downloaded files in the Settings, then try again. Installation failed because the apk files are corrupted. - Installation failed because apk signature verification is enabled. Disable apk signature verification and try again. - Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization and try again. + Installation failed because apk signature verification is enabled. Disable apk signature verification, then try again. + Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization, then try again. Installation failed due to a storage error. DO NOT leave the app until the installation finishes. Reinstall From 6c2277b0b0505704599a5af71b042d4e4be6d1d4 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 16:21:23 +0400 Subject: [PATCH 006/138] small fixes --- README.md | 9 +++++---- .../vanced/manager/ui/viewmodels/HomeViewModel.kt | 14 ++++++++------ app/src/main/res/values/strings.xml | 6 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3cc0a264..5c43370d 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ For anyone who wants to provide translations please submit them to https://trans Hi, when we released Vanced 15.05.54, people were upset because it used the .apks format, which was way harder to install than a traditional .apk file. Even though we wrote clear instructions on how to install the new Vanced build, people still couldn't figure it out. Then we thought, "why don't we make a manager for vanced, which will download, update and uninstall Vanced and MicroG, have an easy and understandable UI and be less than 5mb?" and that's how Vanced Manager was born. -After 3 months of development, we are finally ready to introduce Vanced Manager to the masses. Vanced manager can easily install and uninstall vanced and microg, has various settings for customisation and better experience. The Manager comes with an easy-to-use interface, support for background download and installation* -##### *Due to changes in Android Oreo and up, and because of aggressive battery optimisations in some ROMs, feature may not be available for all devices. +After 3 months of development, we are finally ready to introduce Vanced Manager to the masses. Vanced manager can easily install and uninstall vanced and microg, has various settings for customisation and better experience. The Manager comes with an easy-to-use interface* + +##### Background download/installation feature is no longer supported due to problems with some ROMs, please do NOT report problems regarding background activity. ## Vanced Developers - xfileFIN @@ -23,5 +24,5 @@ After 3 months of development, we are finally ready to introduce Vanced Manager - topjohnwu for his wonderful [LibSU](https://github.com/topjohnwu/libsu) - Mindorks for their amazing [PRDownloader](https://github.com/MindorksOpenSource/PRDownloader) - aefyr for [SAI](https://github.com/aefyr/SAI), which was an inspiration for our Manager -- kittinunf for the [Fuel](https://github.com/kittinunf/Fuel) library -- cbeust for the [klaxon](https://github.com/cbeust/klaxon) library +- kittinunf for [Fuel](https://github.com/kittinunf/Fuel) HTTP client +- cbeust for [klaxon](https://github.com/cbeust/klaxon) JSON parser diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index 4056810a..b6d16cad 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -65,11 +65,13 @@ open class HomeViewModel(application: Application): AndroidViewModel(application fun fetchData() { CoroutineScope(Dispatchers.IO).launch { fetching.set(true) - try { - Crowdin.forceUpdate(getApplication()) - } catch (e: Exception) { - Log.d("VMLocalisation", "Error: ", e) - } + //Crowdin has problems with R, skip fetching + if (Build.SDK_INT < Build.VERSION_CODES.R) + try { + Crowdin.forceUpdate(getApplication()) + } catch (e: Exception) { + Log.d("VMLocalisation", "Error: ", e) + } vancedVersion.set(getJsonString("vanced.json", "version", getApplication())) microgVersion.set(getJsonString("microg.json", "version", getApplication())) microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm)) @@ -171,4 +173,4 @@ open class HomeViewModel(application: Application): AndroidViewModel(application fetchData() } -} \ No newline at end of file +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c41dcda4..edb55aad 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -22,9 +22,9 @@ Installation failed because user blocked the installation. Installation failed because user tried to downgrade the package. Uninstall updates from stock YouTube app, then try again. Installation failed because the app conflicts with an already installed app. Uninstall the current version of Vanced, then try again. - Installation failed for unknown reasons, join our Telegram or Discord for futher support. + Installation failed for unknown reasons, join our Telegram or Discord for further support. Installation failed because the installation file is incompatible with your device. Clear downloaded files in the Settings, then try again. - Installation failed because the apk files are corrupted. + Installation failed because the apk files are corrupted, please try again. Installation failed because apk signature verification is enabled. Disable apk signature verification, then try again. Installation failed because MIUI Optimization is enabled. Disable MIUI Optimization, then try again. Installation failed due to a storage error. @@ -79,7 +79,7 @@ Stop! You are using the Magisk/TWRP version of Vanced, which is discontinued and cannot be updated using this app. Please remove it by removing the magisk module/using TWRP Vanced uninstaller. MIUI detected! - In order to properly install Vanced, you MUST disable MIUI Optimisations in the developer settings. (You can ignore this warning if you are on a 20.2.20 or later xiaomi.eu based ROM) + In order to install Vanced, you MUST disable MIUI Optimisations in the developer settings. (You can ignore this warning if you are using 20.2.20 or later xiaomi.eu based ROM) Error Make sure that you downloaded the app from vanced.app, the Vanced Discord server or the Vanced GitHub Success! From c3c9029b0e3356c5b84245fee6ba8f2471e168a4 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 16:29:21 +0400 Subject: [PATCH 007/138] more fixes --- .../java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index b6d16cad..c5e83b8e 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -66,7 +66,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application CoroutineScope(Dispatchers.IO).launch { fetching.set(true) //Crowdin has problems with R, skip fetching - if (Build.SDK_INT < Build.VERSION_CODES.R) + if (Build.VERSION_SDK_INT < Build.VERSION_CODES.R) try { Crowdin.forceUpdate(getApplication()) } catch (e: Exception) { @@ -153,7 +153,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application return when { int1 == 0 -> application.getString(R.string.install) int2 > int1 -> application.getString(R.string.update) - int2 == int1 -> application.getString(R.string.button_reinstall) + int2 == int1 || int1 > int2 -> application.getString(R.string.button_reinstall) else -> application.getString(R.string.install) } From 6069553f4a30d1da327d0cb649adbeafb233f5f6 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 16:35:00 +0400 Subject: [PATCH 008/138] why is kate so sht --- .../main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index c5e83b8e..40cb5c3b 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -66,7 +66,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application CoroutineScope(Dispatchers.IO).launch { fetching.set(true) //Crowdin has problems with R, skip fetching - if (Build.VERSION_SDK_INT < Build.VERSION_CODES.R) + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) try { Crowdin.forceUpdate(getApplication()) } catch (e: Exception) { From 4b45a2acd63708c29f0cb8c77f21cb9806eaa769 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 17:40:13 +0400 Subject: [PATCH 009/138] exception handling for crowdin --- .../main/java/com/vanced/manager/core/App.kt | 18 ++++++++++++------ .../manager/ui/viewmodels/HomeViewModel.kt | 11 ++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt index d69f5c14..5be5f2c1 100644 --- a/app/src/main/java/com/vanced/manager/core/App.kt +++ b/app/src/main/java/com/vanced/manager/core/App.kt @@ -1,6 +1,7 @@ package com.vanced.manager.core import android.app.Application +import android.util.Log import com.crowdin.platform.Crowdin import com.crowdin.platform.CrowdinConfig import com.crowdin.platform.data.remote.NetworkType @@ -12,11 +13,16 @@ class App: Application() { super.onCreate() PRDownloader.initialize(this) - Crowdin.init(this, - CrowdinConfig.Builder() - .withDistributionHash("36c51aed3180a4f43073d28j4s6") - .withNetworkType(NetworkType.WIFI) - .build()) + try { + Crowdin.init(this, + CrowdinConfig.Builder() + .withDistributionHash("36c51aed3180a4f43073d28j4s6") + .withNetworkType(NetworkType.WIFI) + .build() + ) + } catch (e: Exception) { + Log.d("VMLocalisation", "Failed to initialize Crowdin") + } } /* @@ -26,4 +32,4 @@ class App: Application() { } */ -} \ No newline at end of file +} diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index 40cb5c3b..64a81c7b 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -65,13 +65,10 @@ open class HomeViewModel(application: Application): AndroidViewModel(application fun fetchData() { CoroutineScope(Dispatchers.IO).launch { fetching.set(true) - //Crowdin has problems with R, skip fetching - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) - try { - Crowdin.forceUpdate(getApplication()) - } catch (e: Exception) { - Log.d("VMLocalisation", "Error: ", e) - } + try { + Crowdin.forceUpdate(getApplication()) + } catch (e: Exception) { + Log.d("VMLocalisation", "Error: ", e) vancedVersion.set(getJsonString("vanced.json", "version", getApplication())) microgVersion.set(getJsonString("microg.json", "version", getApplication())) microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm)) From 0f7166b72c1cd2437518a1361386422870e22178 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 17:52:17 +0400 Subject: [PATCH 010/138] fixed build --- .../main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index 64a81c7b..ca2dcfa4 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -69,6 +69,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application Crowdin.forceUpdate(getApplication()) } catch (e: Exception) { Log.d("VMLocalisation", "Error: ", e) + } vancedVersion.set(getJsonString("vanced.json", "version", getApplication())) microgVersion.set(getJsonString("microg.json", "version", getApplication())) microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm)) From 9670a50d1f180fbe8078547c35fc2720f42f3ace Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 18:16:53 +0400 Subject: [PATCH 011/138] exception test --- app/src/main/java/com/vanced/manager/core/App.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt index 5be5f2c1..d3ee6e76 100644 --- a/app/src/main/java/com/vanced/manager/core/App.kt +++ b/app/src/main/java/com/vanced/manager/core/App.kt @@ -6,6 +6,7 @@ import com.crowdin.platform.Crowdin import com.crowdin.platform.CrowdinConfig import com.crowdin.platform.data.remote.NetworkType import com.downloader.PRDownloader +import java.lang.Exception class App: Application() { From dc4b0144e0a40ee187ae2549f288a504d00cb112 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 18:54:24 +0400 Subject: [PATCH 012/138] more crowdin tests --- app/src/main/java/com/vanced/manager/core/App.kt | 6 +++--- .../java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt index d3ee6e76..18df3701 100644 --- a/app/src/main/java/com/vanced/manager/core/App.kt +++ b/app/src/main/java/com/vanced/manager/core/App.kt @@ -2,6 +2,7 @@ package com.vanced.manager.core import android.app.Application import android.util.Log +import android.os.Build import com.crowdin.platform.Crowdin import com.crowdin.platform.CrowdinConfig import com.crowdin.platform.data.remote.NetworkType @@ -14,16 +15,15 @@ class App: Application() { super.onCreate() PRDownloader.initialize(this) - try { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { Crowdin.init(this, CrowdinConfig.Builder() .withDistributionHash("36c51aed3180a4f43073d28j4s6") .withNetworkType(NetworkType.WIFI) .build() ) - } catch (e: Exception) { - Log.d("VMLocalisation", "Failed to initialize Crowdin") } + } /* diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index ca2dcfa4..d8884e03 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -65,11 +65,8 @@ open class HomeViewModel(application: Application): AndroidViewModel(application fun fetchData() { CoroutineScope(Dispatchers.IO).launch { fetching.set(true) - try { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) Crowdin.forceUpdate(getApplication()) - } catch (e: Exception) { - Log.d("VMLocalisation", "Error: ", e) - } vancedVersion.set(getJsonString("vanced.json", "version", getApplication())) microgVersion.set(getJsonString("microg.json", "version", getApplication())) microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm)) From dc13e76a5c928b117a5a5c9ac5af6ad358c4a4f7 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 18:54:24 +0400 Subject: [PATCH 013/138] fixed crowdin --- app/src/main/java/com/vanced/manager/core/App.kt | 6 +++--- .../java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt index d3ee6e76..18df3701 100644 --- a/app/src/main/java/com/vanced/manager/core/App.kt +++ b/app/src/main/java/com/vanced/manager/core/App.kt @@ -2,6 +2,7 @@ package com.vanced.manager.core import android.app.Application import android.util.Log +import android.os.Build import com.crowdin.platform.Crowdin import com.crowdin.platform.CrowdinConfig import com.crowdin.platform.data.remote.NetworkType @@ -14,16 +15,15 @@ class App: Application() { super.onCreate() PRDownloader.initialize(this) - try { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { Crowdin.init(this, CrowdinConfig.Builder() .withDistributionHash("36c51aed3180a4f43073d28j4s6") .withNetworkType(NetworkType.WIFI) .build() ) - } catch (e: Exception) { - Log.d("VMLocalisation", "Failed to initialize Crowdin") } + } /* diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index ca2dcfa4..d8884e03 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -65,11 +65,8 @@ open class HomeViewModel(application: Application): AndroidViewModel(application fun fetchData() { CoroutineScope(Dispatchers.IO).launch { fetching.set(true) - try { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) Crowdin.forceUpdate(getApplication()) - } catch (e: Exception) { - Log.d("VMLocalisation", "Error: ", e) - } vancedVersion.set(getJsonString("vanced.json", "version", getApplication())) microgVersion.set(getJsonString("microg.json", "version", getApplication())) microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm)) From cccbb16c4e131ed4df3e13299131641e32c854ca Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 12 Aug 2020 19:23:15 +0400 Subject: [PATCH 014/138] import cleanup --- app/src/main/java/com/vanced/manager/core/App.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt index 18df3701..38450be3 100644 --- a/app/src/main/java/com/vanced/manager/core/App.kt +++ b/app/src/main/java/com/vanced/manager/core/App.kt @@ -7,7 +7,6 @@ import com.crowdin.platform.Crowdin import com.crowdin.platform.CrowdinConfig import com.crowdin.platform.data.remote.NetworkType import com.downloader.PRDownloader -import java.lang.Exception class App: Application() { From 73ba5fc9bcbacf4ea4dcc56e9c4fa0ddf136ad52 Mon Sep 17 00:00:00 2001 From: AioiLight Date: Sun, 16 Aug 2020 18:39:27 +0900 Subject: [PATCH 015/138] Block dialog clossing to tap outside when downloding manager --- .../manager/ui/fragments/UpdateCheckFragment.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt index 69888bb2..e899004d 100644 --- a/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt +++ b/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt @@ -45,6 +45,8 @@ class UpdateCheckFragment : DialogFragment() { checkUpdates() view.findViewById