diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
new file mode 100644
index 0000000000..e9c71277e0
--- /dev/null
+++ b/.github/workflows/android.yml
@@ -0,0 +1,45 @@
+name: Signed APK Builder
+
+on:
+ push:
+ branches:
+ - master
+ - dev
+ pull_request:
+ branches:
+ - master
+ - dev
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+
+ - name: Grant rights
+ run: chmod +x ./gradlew
+
+ - name: Build project with Gradle
+ run: ./gradlew build
+
+ - name: Build Release APK with Gradle
+ run: ./gradlew assembleRelease
+
+ - name: Sign APK
+ uses: r0adkll/sign-android-release@v1
+ id: sign-app
+ with:
+ releaseDirectory: app/build/outputs/apk/release
+ signingKeyBase64: ${{ secrets.TOKEN }}
+ alias: ${{ secrets.ALIAS }}
+ keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
+
+ - name: Upload to GitHub
+ uses: actions/upload-artifact@v2
+ with:
+ name: 'Vanced-Manager'
+ path: ${{ steps.sign-app.outputs.signedReleaseFile }}
diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml
new file mode 100644
index 0000000000..1cb6367c54
--- /dev/null
+++ b/.github/workflows/debug.yml
@@ -0,0 +1,36 @@
+name: Debug APK Builder
+
+on:
+ push:
+ branches:
+ - master
+ - dev
+ pull_request:
+ branches:
+ - master
+ - dev
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+
+ - name: Grant rights
+ run: chmod +x ./gradlew
+
+ - name: Build project with Gradle
+ run: ./gradlew build
+
+ - name: Build Release APK with Gradle
+ run: ./gradlew assembleDebug
+
+ - name: Upload to GitHub
+ uses: actions/upload-artifact@v2
+ with:
+ name: 'Vanced-Manager'
+ path: app/build/outputs/apk/debug/app-debug.apk
diff --git a/.gitignore b/.gitignore
index 603b140773..6acf51c6a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,7 @@
-*.iml
-.gradle
-/local.properties
-/.idea/caches
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-/.idea/navEditor.xml
-/.idea/assetWizardSettings.xml
-.DS_Store
-/build
-/captures
-.externalNativeBuild
-.cxx
+.gradle/
+.idea/
+.github/
+build/
+out/
+app/src/main/java/com/vanced/manager/core/base/DummyJava.java
+local.properties
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 88ea3aa1e5..0000000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xmlns:android
-
- ^$
-
-
-
-
-
-
-
-
- xmlns:.*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*:id
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- .*:name
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- name
-
- ^$
-
-
-
-
-
-
-
-
- style
-
- ^$
-
-
-
-
-
-
-
-
- .*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*
-
- http://schemas.android.com/apk/res/android
-
-
- ANDROID_ATTRIBUTE_ORDER
-
-
-
-
-
-
- .*
-
- .*
-
-
- BY_NAME
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 79ee123c2b..0000000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 5cd135a064..0000000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 7bfef59df1..0000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460d8b..0000000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1ddfbb..0000000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 353c3b3687..201e0d0225 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,21 @@
-# VancedInstaller
-Vanced Installer
+# Vanced Manager
+Hi, when we released Vanced 15.05.54, people were upset because it used .apks format, which was way harder to install than a traditional .apk file. even tho we wrote clear instructions on how to install new Vanced, 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. that's how Vanced Manager was born.
+
+After 3 months of making, we are finally ready to introduce Vanced Manager to you. Vanced manager can easily install and uninstall vanced and microg, has various settings for customisation and better experience. Manager comes with easy-to-use interface, support for background download and installation*
+##### *Due to changes in Android Oreo and up, also because of aggressive battery optimisations in some ROMs, feature may not be available for all devices.
+
+## Vanced Developers
+- xfileFIN
+- KevinX8
+- Zanezam
+- Laura Almeida
+
+## Vanced Manager Developer
+- Xinto (X1nto)
+
+## Credits
+- topjohnwu for his wonderful [LibSU](https://github.com/topjohnwu/libsu)
+- Mindorks for their amazing [PRDownloader](https://github.com/MindorksOpenOource/PRDownloader)
+- aefyr for [SAI](https://github.com/aefyr/SAI), which was inspiration for our Manager
+- 100rabhkr for [GetJson](https://github.com/100rabhkr/getjson) library
\ No newline at end of file
diff --git a/READMEME.md b/READMEME.md
new file mode 100644
index 0000000000..b6afbd3a2c
--- /dev/null
+++ b/READMEME.md
@@ -0,0 +1,42 @@
+![Signed APK Builder](https://github.com/X1nto/VancedInstaller/workflows/Signed%20APK%20Builder/badge.svg?branch=master)
+
+# Prelude
+Hi, my name is Steve Cock, I'm the main developer for the upcoming Vanced Manager. When xfileFIN first published Vanced 15.05.54, people were upset because new Vanced used split apk files. The reason for that was pretty simple:
+1) YouTube itself does that
+2) Split apk files reduce the size of the downloaded file itself
+
+No one really thought there would be problems with this format, because installation was pretty simple, at least that's what xfile thought...
+## Problems with .apks format
+Main problems with new format were either with device CPU architecture or MemeUI shit with MiUI optimisations. We wrote instructions for VancedHelper but no one used it for troubleshooting. Then some users complained about new format and refused to upgrade to newest version (We don't give a fuck about that) because "I dOn'T WaNT To HaVe OnE MoRE apP To insTalL VanCeD" so we decided to make an installer for Vanced
+# Vanced Manager
+Ladies and gentlemen, I'm very proud to introduce the new **Vancad Manger 1.0.0™** (typo is intentional)
+Vanced Manager is an universal utility for installing/updating Vanced and MicroG. It will push notifications once the update is ready (Now that's what I call pwetty epic).
+Vanced manager comes with a slick UI ~~that was stolen from the new Magisk Manager (I'm very sorry John but I looked at your code for about 100 times).~~ Actually, while UI may look very similar to new Magisk Manager's UI, It's still very different (that's a blatant lie, I know).
+
+Main Menu screenshot taken from tablet
+![screenshot](https://i.imgur.com/r2jiq7J.png)
+Isn't this lovely and beautiful?
+
+## Manager (clap) Reviews (clap)
+
+- 1337Potato: shit
+- Response: Yes
+
+- Noobbot: The app is not useful because I have YT Premium. Thank you bye
+- Response: I hope you get sucked by a di-
+
+- Vortextriangle: The app is so useful that I uninstalled it after installing Vanced
+- Response: yo that's finna woke
+
+## Credits
+### Vanced Manager developers
+- X1nto (UI, UX, Downloader, Installer, Signature Checker, PussiSlayer69, Collector of 400 BAT, Professional Liar)
+### The Vanced Team
+- xfileFIN
+![xfileFIN](https://i.imgur.com/hLdzTVq.png)
+- KevinX8
+![KevinX8](https://i.imgur.com/cS9C7P8.png)
+- Zanezam
+![Zanezam](https://i.imgur.com/QVcXA6q.png)
+- Laura Almeida
+![Laura Almeida](https://i.imgur.com/ovVD939.png)
diff --git a/Vanced Manager.iml b/Vanced Manager.iml
new file mode 100644
index 0000000000..30b06914f8
--- /dev/null
+++ b/Vanced Manager.iml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/app.iml b/app/app.iml
new file mode 100644
index 0000000000..874c5236e8
--- /dev/null
+++ b/app/app.iml
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 827fa744ec..ba62862188 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
@@ -10,25 +11,38 @@ android {
applicationId "com.vanced.manager"
minSdkVersion 21
targetSdkVersion 29
- versionCode 1
- versionName "1.0"
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ versionCode 8
+ versionName "1.0.0"
vectorDrawables.useSupportLibrary = true
}
+ lintOptions {
+ disable 'MissingTranslation', 'ExtraTranslation'
+ }
+
+ aaptOptions {
+ noCompress 'apk', '.apk'
+ }
+
+ applicationVariants.all { variant ->
+ variant.resValue "string", "versionName", variant.versionName
+ }
+
buildTypes {
release {
- minifyEnabled false
+ minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
+ dataBinding {
+ enabled = true
+ }
+
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
-
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -42,16 +56,18 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'androidx.appcompat:appcompat:1.0.2'
- implementation 'androidx.core:core-ktx:1.0.2'
- implementation 'com.google.android.material:material:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.core:core-ktx:1.3.0'
+ implementation 'androidx.fragment:fragment-ktx:1.2.5'
+ implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- implementation 'androidx.navigation:navigation-fragment:2.0.0'
- implementation 'androidx.navigation:navigation-ui:2.0.0'
- implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
- implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
- implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+ implementation 'androidx.browser:browser:1.2.0'
+ implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
+ implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
+ implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'com.google.android.material:material:1.1.0'
+ implementation 'com.github.100rabhkr:GetJSON:1.0'
+ implementation 'com.github.topjohnwu.libsu:core:2.5.1'
+ implementation 'com.mindorks.android:prdownloader:0.6.0'
}
diff --git a/app/src/androidTest/java/com/vanced/manager/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/vanced/manager/ExampleInstrumentedTest.kt
deleted file mode 100644
index 0be9c2b2e3..0000000000
--- a/app/src/androidTest/java/com/vanced/manager/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.vanced.manager
-
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.ext.junit.runners.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.vanced.manager", appContext.packageName)
- }
-}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1887bd3ae8..55350fe611 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,26 +1,70 @@
-
+
+
+
+
+
+
+ tools:ignore="UnusedAttribute"
+ tools:replace="android:allowBackup">
+
+ android:name=".ui.core.SplashScreenActivity"
+ android:label="@string/app_name"
+ android:theme="@style/SplashTheme">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png
new file mode 100644
index 0000000000..c78215cd29
Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ
diff --git a/app/src/main/java/com/vanced/manager/MainActivity.kt b/app/src/main/java/com/vanced/manager/MainActivity.kt
deleted file mode 100644
index 3d57882b66..0000000000
--- a/app/src/main/java/com/vanced/manager/MainActivity.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.vanced.manager
-
-import android.os.Bundle
-import com.google.android.material.bottomnavigation.BottomNavigationView
-import androidx.appcompat.app.AppCompatActivity
-import androidx.navigation.findNavController
-import androidx.navigation.ui.AppBarConfiguration
-import androidx.navigation.ui.setupActionBarWithNavController
-import androidx.navigation.ui.setupWithNavController
-
-class MainActivity : AppCompatActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- val navView: BottomNavigationView = findViewById(R.id.navigation_home)
-
- val navController = findNavController(R.id.mobile_navigation)
- // Passing each menu ID as a set of Ids because each
- // menu should be considered as top level destinations.
- val appBarConfiguration = AppBarConfiguration(setOf(
- R.id.navigation_home))
- setupActionBarWithNavController(navController, appBarConfiguration)
- navView.setupWithNavController(navController)
- }
-}
diff --git a/app/src/main/java/com/vanced/manager/adapter/SectionPageAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/SectionPageAdapter.kt
new file mode 100644
index 0000000000..134c86cb42
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/adapter/SectionPageAdapter.kt
@@ -0,0 +1,26 @@
+package com.vanced.manager.adapter
+
+import androidx.fragment.app.Fragment
+import androidx.viewpager2.adapter.FragmentStateAdapter
+import com.vanced.manager.ui.fragments.ManagerChangelogFragment
+import com.vanced.manager.ui.fragments.MicrogChangelogFragment
+import com.vanced.manager.ui.fragments.VancedChangelogFragment
+
+class SectionPageAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
+
+ private val fragmentItems = 3
+ override fun getItemCount(): Int {
+ return fragmentItems
+ }
+
+ override fun createFragment(position: Int): Fragment {
+ var fragment: Fragment? = null
+ when (position) {
+ 0 -> fragment = VancedChangelogFragment()
+ 1 -> fragment = MicrogChangelogFragment()
+ 2 -> fragment = ManagerChangelogFragment()
+ }
+ return fragment!!
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/adapter/SectionPageRootAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/SectionPageRootAdapter.kt
new file mode 100644
index 0000000000..ec7b1e4e49
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/adapter/SectionPageRootAdapter.kt
@@ -0,0 +1,24 @@
+package com.vanced.manager.adapter
+
+import androidx.fragment.app.Fragment
+import androidx.viewpager2.adapter.FragmentStateAdapter
+import com.vanced.manager.ui.fragments.ManagerChangelogFragment
+import com.vanced.manager.ui.fragments.VancedChangelogFragment
+
+class SectionPageRootAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
+
+ private val fragmentItems = 2
+ override fun getItemCount(): Int {
+ return fragmentItems
+ }
+
+ override fun createFragment(position: Int): Fragment {
+ var fragment: Fragment? = null
+ when (position) {
+ 0 -> fragment = VancedChangelogFragment()
+ 1 -> fragment = ManagerChangelogFragment()
+ }
+ return fragment!!
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/App.kt b/app/src/main/java/com/vanced/manager/core/App.kt
new file mode 100644
index 0000000000..e0dcf9a7b9
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/App.kt
@@ -0,0 +1,15 @@
+package com.vanced.manager.core
+
+import android.app.Application
+import com.downloader.PRDownloader
+import com.vanced.manager.utils.NotificationHelper.createNotifChannel
+
+class App: Application() {
+
+ override fun onCreate() {
+ super.onCreate()
+ PRDownloader.initialize(applicationContext)
+ createNotifChannel(this)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/Main.kt b/app/src/main/java/com/vanced/manager/core/Main.kt
new file mode 100644
index 0000000000..0b9a854c14
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/Main.kt
@@ -0,0 +1,64 @@
+package com.vanced.manager.core
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.os.Bundle
+import android.widget.Toast
+import androidx.appcompat.app.AppCompatActivity
+import androidx.preference.PreferenceManager
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.ui.dialogs.DialogContainer.showSecurityDialog
+import com.vanced.manager.ui.dialogs.DialogContainer.statementFalse
+import com.vanced.manager.ui.fragments.UpdateCheckFragment
+import com.vanced.manager.utils.InternetTools
+import com.vanced.manager.R
+import com.vanced.manager.ui.dialogs.DialogContainer.secondMiuiDialog
+import com.vanced.manager.ui.dialogs.DialogContainer.showRootDialog
+import com.vanced.manager.utils.MiuiHelper.isMiui
+import com.vanced.manager.utils.MiuiHelper.isMiuiOptimisationsDisabled
+
+// This activity will NOT be used in manifest
+// since MainActivity will extend it
+@SuppressLint("Registered")
+open class Main: AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ checkUpdates()
+
+ val prefs = PreferenceManager.getDefaultSharedPreferences(this)
+ val firstStart = prefs.getBoolean("firstStart", true)
+ val isUpgrading = prefs.getBoolean("isUpgrading", false)
+ val variant = prefs.getString("vanced_variant", "nonroot")
+ val shouldShowRootDialog = prefs.getBoolean("show_root_dialog", true)
+
+ val falseStatement = prefs.getBoolean("statement", true)
+
+ when {
+ firstStart -> showSecurityDialog(this)
+ !falseStatement -> statementFalse(this)
+ isUpgrading -> prefs.edit().putBoolean("isUpgrading", false).apply()
+ variant == "root" && shouldShowRootDialog -> showRootDialog(this)
+ !firstStart && !isMiuiOptimisationsDisabled() -> secondMiuiDialog(this)
+ }
+
+ }
+
+ override fun onPause() {
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isInstalling", false).apply()
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isVancedDownloading", false).apply()
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isMicrogDownloading", false).apply()
+ super.onPause()
+ }
+
+ private fun checkUpdates() {
+ val checkPrefs = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("auto_check_update", false)
+ if (checkPrefs) {
+ if (GetJson().isConnected(this) && InternetTools.isUpdateAvailable()) {
+ UpdateCheckFragment().show(supportFragmentManager, "Update")
+ } else Toast.makeText(this, getString(R.string.update_notfound), Toast.LENGTH_SHORT).show()
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/base/BaseFragment.kt b/app/src/main/java/com/vanced/manager/core/base/BaseFragment.kt
new file mode 100644
index 0000000000..1bcd46fbd0
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/base/BaseFragment.kt
@@ -0,0 +1,7 @@
+package com.vanced.manager.core.base
+
+import androidx.fragment.app.Fragment
+
+open class BaseFragment : Fragment() {
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt b/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt
new file mode 100644
index 0000000000..b2f49440c2
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt
@@ -0,0 +1,84 @@
+package com.vanced.manager.core.downloader
+
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.os.Build
+import android.os.IBinder
+import android.widget.Toast
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.dezlum.codelabs.getjson.GetJson
+import com.downloader.Error
+import com.downloader.OnDownloadListener
+import com.downloader.OnStartOrResumeListener
+import com.downloader.PRDownloader
+import com.vanced.manager.R
+import com.vanced.manager.core.installer.AppInstaller
+import com.vanced.manager.ui.fragments.HomeFragment
+import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
+import com.vanced.manager.utils.NotificationHelper
+import com.vanced.manager.utils.NotificationHelper.cancelNotif
+import com.vanced.manager.utils.NotificationHelper.createBasicNotif
+import java.util.concurrent.ExecutionException
+
+class MicrogDownloadService: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ try {
+ downloadMicrog()
+ } catch (e: Exception) {
+ when (e) {
+ is ExecutionException, is InterruptedException -> Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
+ else -> throw e
+ }
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ private fun downloadMicrog() {
+ val prefs = getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+
+ val apkUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/microg.json")
+ val dwnldUrl = apkUrl.get("url").asString
+ val channel = 420
+ PRDownloader.download(dwnldUrl, filesDir.path, "microg.apk")
+ .build()
+ .setOnStartOrResumeListener { OnStartOrResumeListener { prefs?.edit()?.putBoolean("isMicrogDownloading", true)?.apply() } }
+ .setOnProgressListener { progress ->
+ val mProgress = progress.currentBytes * 100 / progress.totalBytes
+ NotificationHelper.displayDownloadNotif(
+ channel,
+ mProgress.toInt(),
+ getFileNameFromUrl(dwnldUrl),
+ this
+ )
+ }
+ .start(object : OnDownloadListener {
+ override fun onDownloadComplete() {
+ prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
+ cancelNotif(channel, this@MicrogDownloadService)
+ val intent = Intent(this@MicrogDownloadService, AppInstaller::class.java)
+ intent.putExtra("path", "${filesDir.path}/microg.apk")
+ intent.putExtra("pkg", "com.mgoogle.android.gms")
+ val mIntent = Intent(HomeFragment.MICROG_DOWNLOADED)
+ mIntent.action = HomeFragment.MICROG_DOWNLOADED
+ LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(mIntent)
+ startService(intent)
+ }
+ override fun onError(error: Error) {
+ prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
+ createBasicNotif(getString(R.string.error_downloading, "Microg"), channel, this@MicrogDownloadService)
+ }
+ })
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ cancelNotif(420, this)
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt b/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt
new file mode 100644
index 0000000000..d03becc4e4
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt
@@ -0,0 +1,121 @@
+package com.vanced.manager.core.downloader
+
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.os.Build
+import android.os.IBinder
+import android.widget.Toast
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import androidx.preference.PreferenceManager
+import com.dezlum.codelabs.getjson.GetJson
+import com.downloader.Error
+import com.downloader.OnDownloadListener
+import com.downloader.OnStartOrResumeListener
+import com.downloader.PRDownloader
+import com.vanced.manager.R
+import com.vanced.manager.core.installer.RootSplitInstallerService
+import com.vanced.manager.core.installer.SplitInstaller
+import com.vanced.manager.ui.fragments.HomeFragment
+import com.vanced.manager.utils.InternetTools.baseUrl
+import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
+import com.vanced.manager.utils.NotificationHelper.cancelNotif
+import com.vanced.manager.utils.NotificationHelper.createBasicNotif
+import com.vanced.manager.utils.NotificationHelper.displayDownloadNotif
+import java.util.concurrent.ExecutionException
+
+class VancedDownloadService: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ try {
+ downloadSplits()
+ } catch (e: Exception) {
+ when (e) {
+ is ExecutionException, is InterruptedException -> Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
+ else -> throw e
+ }
+
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ private fun downloadSplits(
+ type: String = "arch"
+ ) {
+ val baseUrl = PreferenceManager.getDefaultSharedPreferences(this).getString("install_url", baseUrl)
+ val vancedVer = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/vanced.json").get("version").asString
+ val prefs = getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+ val variant = PreferenceManager.getDefaultSharedPreferences(this).getString("vanced_variant", "nonroot")
+ val lang = prefs?.getString("lang", "en")
+ val theme = prefs?.getString("theme", "dark")
+ val arch =
+ when {
+ Build.SUPPORTED_ABIS.contains("x86") -> "x86"
+ Build.SUPPORTED_ABIS.contains("arm64-v8a") -> "arm64_v8a"
+ else -> "armeabi_v7a"
+ }
+ val url =
+ when (type) {
+ "arch" -> "$baseUrl/apks/v$vancedVer/$variant/Config/config.$arch.apk"
+ "theme" -> "$baseUrl/apks/v$vancedVer/$variant/Theme/$theme.apk"
+ "lang" -> "$baseUrl/apks/v$vancedVer/$variant/Language/split_config.$lang.apk"
+ "enlang" -> "$baseUrl/apks/v$vancedVer/$variant/Language/split_config.en.apk"
+ else -> throw NotImplementedError("This type of APK is NOT valid. What the hell did you even do?")
+ }
+
+ val channel = 69
+ PRDownloader
+ .download(url, cacheDir.path, getFileNameFromUrl(url))
+ .build()
+ .setOnStartOrResumeListener { OnStartOrResumeListener { prefs?.edit()?.putBoolean("isVancedDownloading", true)?.apply() } }
+ .setOnProgressListener { progress ->
+ val mProgress = progress.currentBytes * 100 / progress.totalBytes
+ displayDownloadNotif(channel, mProgress.toInt(), getFileNameFromUrl(url), this)
+ }
+ .start(object : OnDownloadListener {
+ override fun onDownloadComplete() {
+ when (type) {
+ "arch" -> downloadSplits("theme")
+ "theme" -> downloadSplits("lang")
+ "lang" -> {
+ if (lang == "en") {
+ prepareInstall(variant!!)
+ cancelNotif(channel, this@VancedDownloadService)
+ } else {
+ downloadSplits("enlang")
+ }
+ }
+ "enlang" -> {
+ prepareInstall(variant!!)
+ cancelNotif(channel, this@VancedDownloadService)
+ }
+ }
+ }
+
+ override fun onError(error: Error) {
+ createBasicNotif(getString(R.string.error_downloading, "Vanced"), channel, this@VancedDownloadService)
+ }
+ })
+ }
+
+ private fun prepareInstall(variant: String) {
+ val intent = Intent(HomeFragment.VANCED_DOWNLOADED)
+ intent.action = HomeFragment.VANCED_DOWNLOADED
+ LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
+ if (variant == "root")
+ startService(Intent(this, RootSplitInstallerService::class.java))
+ else
+ startService(Intent(this, SplitInstaller::class.java))
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ cancelNotif(69, this)
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/fragments/About.kt b/app/src/main/java/com/vanced/manager/core/fragments/About.kt
new file mode 100644
index 0000000000..9d470173dd
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/fragments/About.kt
@@ -0,0 +1,48 @@
+package com.vanced.manager.core.fragments
+
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.view.MotionEvent
+import android.view.View
+import android.widget.Toast
+import androidx.preference.PreferenceManager
+import com.vanced.manager.core.base.BaseFragment
+
+open class About : BaseFragment() {
+
+ private var count = 0
+ private var startMillSec: Long = 0
+
+ @SuppressLint("ClickableViewAccessibility")
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ view.setOnTouchListener { _, event: MotionEvent ->
+
+ val eventAction = event.action
+ if (eventAction == MotionEvent.ACTION_UP) {
+ val time = System.currentTimeMillis()
+ if (startMillSec == 0L || time - startMillSec > 3000) {
+ startMillSec = time
+ count = 1
+ } else {
+ count++
+ }
+
+ if (count == 5) {
+ val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
+ val devSettings = prefs.getBoolean("devSettings", false)
+ if (!devSettings) {
+ Toast.makeText(requireContext(), "Dev options unlocked!", Toast.LENGTH_SHORT).show()
+ prefs.edit().putBoolean("devSettings", true).apply()
+ } else
+ Toast.makeText(requireContext(), "Dev options already unlocked", Toast.LENGTH_SHORT).show()
+
+ }
+ return@setOnTouchListener true
+ }
+ false
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/fragments/Home.kt b/app/src/main/java/com/vanced/manager/core/fragments/Home.kt
new file mode 100644
index 0000000000..c4be33fa40
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/fragments/Home.kt
@@ -0,0 +1,127 @@
+package com.vanced.manager.core.fragments
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.util.Log
+import android.view.View
+import android.widget.*
+import androidx.navigation.findNavController
+import androidx.preference.PreferenceManager
+import androidx.preference.PreferenceManager.getDefaultSharedPreferences
+import com.google.android.material.button.MaterialButton
+import com.topjohnwu.superuser.Shell
+import com.vanced.manager.R
+import com.vanced.manager.core.base.BaseFragment
+import com.vanced.manager.core.downloader.MicrogDownloadService
+import com.vanced.manager.core.downloader.VancedDownloadService
+import com.vanced.manager.ui.MainActivity
+import com.vanced.manager.ui.dialogs.DialogContainer.secondMiuiDialog
+import com.vanced.manager.utils.MiuiHelper
+import com.vanced.manager.utils.PackageHelper.uninstallApk
+
+open class Home : BaseFragment(), View.OnClickListener {
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val microginstallbtn = view.findViewById(R.id.microg_installbtn)
+ val vancedinstallbtn = view.findViewById(R.id.vanced_installbtn)
+ val microguninstallbtn = view.findViewById(R.id.microg_uninstallbtn)
+ val vanceduninstallbtn = view.findViewById(R.id.vanced_uninstallbtn)
+ val rootswitch = view.findViewById(R.id.root_switch)
+ val nonrootswitch = view.findViewById(R.id.nonroot_switch)
+
+ vancedinstallbtn.setOnClickListener(this)
+ microginstallbtn.setOnClickListener(this)
+ microguninstallbtn.setOnClickListener(this)
+ vanceduninstallbtn.setOnClickListener(this)
+ rootswitch.setOnClickListener(this)
+ nonrootswitch.setOnClickListener(this)
+
+ }
+
+ override fun onResume() {
+ super.onResume()
+ val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+ val isInstalling = prefs?.getBoolean("isInstalling", false)
+ if (isInstalling!!) {
+ activity?.startService(Intent(activity, VancedDownloadService::class.java))
+ prefs.edit().putBoolean("isInstalling", false).apply()
+ }
+ }
+
+ override fun onClick(v: View?) {
+ val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+ val defPrefs = getDefaultSharedPreferences(activity)
+ val isVancedDownloading: Boolean? = prefs?.getBoolean("isVancedDownloading", false)
+ val isMicrogDownloading: Boolean? = prefs?.getBoolean("isMicrogDownloading", false)
+ val variant = getDefaultSharedPreferences(activity).getString("vanced_variant", "nonroot")
+ val vancedPkgName =
+ if (variant == "root") {
+ "com.google.android.youtube"
+ } else {
+ "com.vanced.android.youtube"
+ }
+
+ when (v?.id) {
+ R.id.vanced_installbtn -> {
+ if (!isVancedDownloading!!) {
+ try {
+ activity?.cacheDir?.deleteRecursively()
+ } catch (e: Exception) {
+ Log.d("VMCache", "Unable to delete cacheDir")
+ }
+ if (prefs.getBoolean("valuesModified", false)) {
+ activity?.startService(
+ Intent(
+ activity,
+ VancedDownloadService::class.java
+ )
+ )
+ } else {
+ view?.findNavController()?.navigate(R.id.toInstallThemeFragment)
+ }
+ } else {
+ Toast.makeText(
+ activity,
+ "Please wait until installation finishes",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ }
+ R.id.microg_installbtn -> {
+ if (!isMicrogDownloading!!) {
+ try {
+ activity?.startService(Intent(activity, MicrogDownloadService::class.java))
+ } catch (e: Exception) {
+ Toast.makeText(activity, "Unable to start installation", Toast.LENGTH_SHORT).show()
+ }
+ } else {
+ Toast.makeText(activity, "Please wait until installation finishes", Toast.LENGTH_SHORT).show()
+ }
+ }
+ R.id.microg_uninstallbtn -> activity?.let { uninstallApk("com.mgoogle.android.gms", it) }
+ R.id.vanced_uninstallbtn -> activity?.let { uninstallApk(vancedPkgName, it) }
+ R.id.nonroot_switch -> writeToVariantPref("nonroot", R.anim.slide_in_left, R.anim.slide_out_right)
+ R.id.root_switch ->
+ if (Shell.rootAccess())
+ writeToVariantPref("root", R.anim.slide_in_right, R.anim.slide_out_left)
+ else {
+ writeToVariantPref("nonroot", R.anim.slide_in_left, R.anim.slide_out_right)
+ Toast.makeText(activity, "Root access not granted", Toast.LENGTH_SHORT).show()
+ }
+ }
+ }
+
+ private fun writeToVariantPref(variant: String, animIn: Int, animOut: Int) {
+ val prefs = getDefaultSharedPreferences(activity)
+ if (prefs.getString("vanced_variant", "nonroot") != variant) {
+ prefs.edit().putString("vanced_variant", variant).apply()
+ startActivity(Intent(activity, MainActivity::class.java))
+ activity?.overridePendingTransition(animIn, animOut)
+ activity?.finish()
+ } else Log.d("VMvariant", "$variant is already selected")
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/fragments/LanguageInstall.kt b/app/src/main/java/com/vanced/manager/core/fragments/LanguageInstall.kt
new file mode 100644
index 0000000000..db7616b64f
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/fragments/LanguageInstall.kt
@@ -0,0 +1,37 @@
+package com.vanced.manager.core.fragments
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import android.widget.Button
+import android.widget.RadioButton
+import android.widget.RadioGroup
+import androidx.navigation.findNavController
+import com.vanced.manager.R
+import com.vanced.manager.core.base.BaseFragment
+
+open class LanguageInstall : BaseFragment() {
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val finishButton = view.findViewById(R.id.vanced_install_finish)
+ val langGroup = view.findViewById(R.id.lang_radiogroup)
+ val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+
+ val langPref = prefs?.getString("lang", "en")
+ val button = langGroup.findViewWithTag(langPref)
+ button.isChecked = true
+
+ finishButton.setOnClickListener {
+ val selectedLangId = langGroup.checkedRadioButtonId
+ val selectedButton = view.findViewById(selectedLangId)
+ prefs?.edit()?.putString("lang", selectedButton.tag.toString())?.apply()
+ prefs?.edit()?.putBoolean("isInstalling", true)?.apply()
+ prefs?.edit()?.putBoolean("valuesModified", true)?.apply()
+ view.findNavController().navigate(R.id.action_installTo_homeFragment)
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/fragments/ThemeInstall.kt b/app/src/main/java/com/vanced/manager/core/fragments/ThemeInstall.kt
new file mode 100644
index 0000000000..58d8c9d087
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/fragments/ThemeInstall.kt
@@ -0,0 +1,32 @@
+package com.vanced.manager.core.fragments
+
+import android.content.Context
+import android.os.Bundle
+import android.view.View
+import android.widget.*
+import androidx.navigation.findNavController
+import com.vanced.manager.R
+import com.vanced.manager.core.base.BaseFragment
+
+open class ThemeInstall : BaseFragment() {
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val nextButton = view.findViewById(R.id.vanced_next_to_variant)
+ val themeGroup = view.findViewById(R.id.theme_radiogroup)
+ val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+
+ val themePref = prefs?.getString("theme", "dark")
+ val button = themeGroup.findViewWithTag(themePref)
+ button.isChecked = true
+
+ nextButton.setOnClickListener {
+ val selectedThemeId = themeGroup.checkedRadioButtonId
+ val selectedButton = view.findViewById(selectedThemeId)
+ prefs?.edit()?.putString("theme", selectedButton.tag.toString())?.apply()
+ view.findNavController().navigate(R.id.toInstallLanguageFragment)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/AppInstaller.kt b/app/src/main/java/com/vanced/manager/core/installer/AppInstaller.kt
new file mode 100644
index 0000000000..7c53e0ddd8
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/AppInstaller.kt
@@ -0,0 +1,38 @@
+package com.vanced.manager.core.installer
+
+import android.app.PendingIntent
+import android.app.Service
+import android.content.Intent
+import android.content.pm.PackageInstaller
+import android.os.IBinder
+import java.io.FileInputStream
+import java.io.InputStream
+
+class AppInstaller: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ val callbackIntent = Intent(applicationContext, AppInstallerService::class.java)
+ val pendingIntent = PendingIntent.getService(applicationContext, 0, callbackIntent, 0)
+ val packageInstaller = packageManager.packageInstaller
+ val params = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL)
+ params.setAppPackageName(intent?.getStringExtra("pkg"))
+ val sessionId = packageInstaller.createSession(params)
+ val session = packageInstaller.openSession(sessionId)
+ val inputStream: InputStream = FileInputStream(intent?.getStringExtra("path") as String)
+ val outputStream = session.openWrite("install", 0, -1)
+ val buffer = ByteArray(65536)
+ var c: Int
+ while (inputStream.read(buffer).also { c = it } != -1) {
+ outputStream.write(buffer, 0, c)
+ }
+ session.fsync(outputStream)
+ inputStream.close()
+ outputStream.close()
+ session.commit(pendingIntent.intentSender)
+ return START_STICKY
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/AppInstallerService.kt b/app/src/main/java/com/vanced/manager/core/installer/AppInstallerService.kt
new file mode 100644
index 0000000000..197ae14fe0
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/AppInstallerService.kt
@@ -0,0 +1,93 @@
+package com.vanced.manager.core.installer
+
+import android.app.Notification
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageInstaller
+import android.os.Build
+import android.os.IBinder
+import android.util.Log
+import android.widget.Toast
+import androidx.annotation.Nullable
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+import com.vanced.manager.utils.MiuiHelper
+import com.vanced.manager.utils.NotificationHelper
+import com.vanced.manager.utils.NotificationHelper.createBasicNotif
+
+class AppInstallerService: Service() {
+
+ override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
+ val notifId = 42
+ when (intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)) {
+ PackageInstaller.STATUS_PENDING_USER_ACTION -> {
+ Toast.makeText(this, "Installing...", Toast.LENGTH_SHORT).show()
+ Log.d(TAG, "Requesting user confirmation for installation")
+ createBasicNotif(getString(R.string.installing_app, "MicroG"), notifId, this)
+ val confirmationIntent = intent.getParcelableExtra(Intent.EXTRA_INTENT)
+ confirmationIntent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ try {
+ startActivity(confirmationIntent)
+ } catch (e: Exception) {
+ }
+ }
+ PackageInstaller.STATUS_SUCCESS -> {
+ Log.d(TAG, "Installation succeed")
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isInstalling", false).apply()
+ val mIntent = Intent(MainActivity.INSTALL_COMPLETED)
+ mIntent.action = MainActivity.INSTALL_COMPLETED
+ mIntent.putExtra("package", "normal")
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ createBasicNotif(getString(
+ R.string.successfully_installed,
+ "Microg"
+ ), notifId, this)
+ }
+ else -> {
+ sendFailure(intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999))
+ createBasicNotif(
+ getErrorMessage(intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)),
+ notifId,
+ this
+ )
+ }
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ private fun sendFailure(status: Int) {
+ val mIntent = Intent(MainActivity.INSTALL_FAILED)
+ mIntent.action = MainActivity.INSTALL_FAILED
+ mIntent.putExtra("errorMsg", getErrorMessage(status))
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ }
+
+ private fun getErrorMessage(status: Int): String {
+ return when (status) {
+ PackageInstaller.STATUS_FAILURE_ABORTED -> getString(R.string.installation_aborted)
+ PackageInstaller.STATUS_FAILURE_BLOCKED -> getString(R.string.installation_blocked)
+ PackageInstaller.STATUS_FAILURE_STORAGE -> getString(R.string.installation_storage)
+ PackageInstaller.STATUS_FAILURE_INVALID -> getString(R.string.installation_invalid)
+ PackageInstaller.STATUS_FAILURE_INCOMPATIBLE -> getString(R.string.installation_incompatible)
+ PackageInstaller.STATUS_FAILURE_CONFLICT -> getString(R.string.installation_conflict)
+ else ->
+ if (MiuiHelper.isMiui())
+ getString(R.string.installation_miui)
+ else
+ getString(R.string.installation_failed)
+ }
+ }
+
+ @Nullable
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+
+ companion object{
+ const val TAG = "VMInstall"
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/AppUninstallerService.kt b/app/src/main/java/com/vanced/manager/core/installer/AppUninstallerService.kt
new file mode 100644
index 0000000000..a6fc4c794e
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/AppUninstallerService.kt
@@ -0,0 +1,52 @@
+package com.vanced.manager.core.installer
+
+import android.app.Service
+import android.content.Intent
+import android.content.pm.PackageInstaller
+import android.os.Handler
+import android.os.IBinder
+import android.util.Log
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.vanced.manager.ui.MainActivity
+
+class AppUninstallerService: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ val pkgName = intent?.getStringExtra("pkg")
+ when (intent?.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)) {
+ PackageInstaller.STATUS_PENDING_USER_ACTION -> {
+ Log.d(AppInstallerService.TAG, "Requesting user confirmation for uninstallation")
+ val confirmationIntent = intent.getParcelableExtra(Intent.EXTRA_INTENT)
+ confirmationIntent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ try {
+ startActivity(confirmationIntent)
+ } catch (e: Exception) {
+ }
+ }
+ PackageInstaller.STATUS_SUCCESS -> {
+ Handler().postDelayed({
+ val mIntent = Intent()
+ mIntent.action = MainActivity.APP_UNINSTALLED
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ Log.d("VMpm", "Successfully uninstalled $pkgName")
+ }, 500)
+ }
+ PackageInstaller.STATUS_FAILURE -> {
+ Handler().postDelayed({
+ val mIntent = Intent()
+ mIntent.action = MainActivity.APP_NOT_UNINSTALLED
+ mIntent.putExtra("pkgName", pkgName)
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ Log.d("VMpm", "Failed to uninstall $pkgName")
+ }, 500)
+ }
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/RootSplitInstallerService.kt b/app/src/main/java/com/vanced/manager/core/installer/RootSplitInstallerService.kt
new file mode 100644
index 0000000000..7af46208bd
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/RootSplitInstallerService.kt
@@ -0,0 +1,144 @@
+package com.vanced.manager.core.installer
+
+import android.app.Notification
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.os.AsyncTask
+import android.os.Build
+import android.os.IBinder
+import android.util.Log
+import androidx.annotation.Nullable
+import androidx.annotation.WorkerThread
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.topjohnwu.superuser.Shell
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+import com.vanced.manager.utils.FileInfo
+import com.vanced.manager.utils.NotificationHelper.createBasicNotif
+import java.io.File
+import java.nio.charset.Charset
+import java.text.SimpleDateFormat
+import java.util.*
+import java.util.regex.Pattern
+import kotlin.collections.ArrayList
+
+class RootSplitInstallerService: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ Shell.getShell {
+ val isRoot = it.isRoot
+ Log.d("AppLog", "isRoot ?$isRoot ")
+ AsyncTask.execute {
+ val apkFilesPath = cacheDir.path
+ val fileInfoList = getFileInfoList(apkFilesPath)
+ installSplitApkFiles(fileInfoList)
+ }
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ @WorkerThread
+ private fun installSplitApkFiles(apkFiles: ArrayList) {
+ var sessionId: Int?
+ val notifId = 666
+ Log.d("AppLog", "installing split apk files:$apkFiles")
+ run {
+ val sessionIdResult = Shell.su("pm install-create -r -t").exec().out
+ val sessionIdPattern = Pattern.compile("(\\d+)")
+ val sessionIdMatcher = sessionIdPattern.matcher(sessionIdResult[0])
+ sessionIdMatcher.find()
+ sessionId = Integer.parseInt(sessionIdMatcher.group(1)!!)
+ }
+ for (apkFile in apkFiles) {
+ Log.d("AppLog", "installing APK : ${apkFile.name} ${apkFile.fileSize} ")
+ createBasicNotif(getString(R.string.installing_app, "Vanced"), notifId, this)
+ val command = arrayOf("su", "-c", "pm", "install-write", "-S", "${apkFile.fileSize}", "$sessionId", apkFile.name)
+ val process: Process = Runtime.getRuntime().exec(command)
+ val inputPipe = apkFile.getInputStream()
+ try {
+ process.outputStream.use { outputStream -> inputPipe.copyTo(outputStream) }
+ } catch (e: java.lang.Exception) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+ process.destroyForcibly()
+ else
+ process.destroy()
+
+ throw RuntimeException(e)
+ }
+ process.waitFor()
+ val inputStr = process.inputStream.readBytes().toString(Charset.defaultCharset())
+ val errStr = process.errorStream.readBytes().toString(Charset.defaultCharset())
+ val isSucceeded = process.exitValue() == 0
+ Log.d("AppLog", "isSucceeded?$isSucceeded inputStr:$inputStr errStr:$errStr")
+ }
+ Log.d("AppLog", "committing...")
+ val installResult = Shell.su("pm install-commit $sessionId").exec()
+ Log.d("AppLog", "succeeded installing?${installResult.isSuccess}")
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isInstalling", false).apply()
+ if (installResult.isSuccess) {
+ val mIntent = Intent(MainActivity.INSTALL_COMPLETED)
+ mIntent.action = MainActivity.INSTALL_COMPLETED
+ mIntent.putExtra("package", "split")
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ createBasicNotif(getString(R.string.successfully_installed, "Vanced"), notifId, this)
+ } else {
+ val mIntent = Intent(MainActivity.INSTALL_FAILED)
+ mIntent.action = MainActivity.INSTALL_FAILED
+ mIntent.putExtra("errorMsg", getString(R.string.installation_signature))
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ createBasicNotif(getString(R.string.installation_signature), notifId, this)
+ }
+ }
+
+ private fun SimpleDateFormat.tryParse(str: String) = try {
+ parse(str) != null
+ } catch (e: Exception) {
+ false
+ }
+
+ @WorkerThread
+ private fun getFileInfoList(splitApkPath: String): ArrayList {
+ val parentFile = File(splitApkPath)
+ val result = ArrayList()
+
+ if (parentFile.exists() && parentFile.canRead()) {
+ val listFiles = parentFile.listFiles() ?: return ArrayList()
+ for (file in listFiles)
+ result.add(FileInfo(file.name, file.length(), file))
+ return result
+ }
+ val longLines = Shell.su("ls -l $splitApkPath").exec().out
+ val pattern = Pattern.compile(" +")
+ val formatter = SimpleDateFormat("HH:mm", Locale.getDefault())
+ longLinesLoop@ for (line in longLines) {
+ val matcher = pattern.matcher(line)
+ for (i in 0 until 4)
+ if (!matcher.find())
+ continue@longLinesLoop
+ val startSizeStr = matcher.end()
+ matcher.find()
+ val endSizeStr = matcher.start()
+ val fileSizeStr = line.substring(startSizeStr, endSizeStr)
+ while (true) {
+ val testTimeStr: String =
+ line.substring(matcher.end(), line.indexOf(' ', matcher.end()))
+ if (formatter.tryParse(testTimeStr)) {
+ //found time, so apk is next
+ val fileName = line.substring(line.indexOf(' ', matcher.end()) + 1)
+ if (fileName.endsWith("apk"))
+ result.add(FileInfo(fileName, fileSizeStr.toLong(), File(splitApkPath, fileName)))
+ break
+ }
+ matcher.find()
+ }
+ }
+ return result
+ }
+
+ @Nullable
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/SplitInstaller.kt b/app/src/main/java/com/vanced/manager/core/installer/SplitInstaller.kt
new file mode 100644
index 0000000000..6d76af4e45
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/SplitInstaller.kt
@@ -0,0 +1,124 @@
+package com.vanced.manager.core.installer
+
+import android.app.PendingIntent
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageInstaller
+import android.os.IBinder
+import android.util.Log
+import java.io.*
+
+class SplitInstaller: Service() {
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ installSplitApk(this)
+ return START_STICKY
+ }
+
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+
+ private fun installSplitApk(context: Context): Int {
+ val apkFolderPath = context.cacheDir.path + "/"
+ val nameSizeMap = HashMap()
+ var totalSize: Long = 0
+ var sessionId = 0
+ val folder = File(apkFolderPath)
+ val listOfFiles = folder.listFiles()
+ try {
+ for (listOfFile in listOfFiles!!) {
+ if (listOfFile.isFile) {
+ Log.d("AppLog", "installApk: " + listOfFile.name)
+ nameSizeMap[listOfFile.name] = listOfFile.length()
+ totalSize += listOfFile.length()
+ }
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
+ return -1
+ }
+ val installParams = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL)
+ installParams.setSize(totalSize)
+ try {
+ sessionId = context.packageManager.packageInstaller.createSession(installParams)
+ Log.d("AppLog","Success: created install session [$sessionId]")
+ for ((key, value) in nameSizeMap) {
+ doWriteSession(sessionId, apkFolderPath + key, value, key, context)
+ }
+ doCommitSession(sessionId, context)
+ Log.d("AppLog","Success")
+ } catch (e: IOException) {
+ e.printStackTrace()
+ }
+ return sessionId
+ }
+
+ private fun doWriteSession(sessionId: Int, inPath: String?, sizeBytes: Long, splitName: String, context: Context): Int {
+ var inPathToUse = inPath
+ var sizeBytesToUse = sizeBytes
+ if ("-" == inPathToUse) {
+ inPathToUse = null
+ } else if (inPathToUse != null) {
+ val file = File(inPathToUse)
+ if (file.isFile)
+ sizeBytesToUse = file.length()
+ }
+ var session: PackageInstaller.Session? = null
+ var inputStream: InputStream? = null
+ var out: OutputStream? = null
+ try {
+ session = context.packageManager.packageInstaller.openSession(sessionId)
+ if (inPathToUse != null) {
+ inputStream = FileInputStream(inPathToUse)
+ }
+ out = session.openWrite(splitName, 0, sizeBytesToUse)
+ var total = 0
+ val buffer = ByteArray(65536)
+ var c: Int
+ while (true) {
+ c = inputStream!!.read(buffer)
+ if (c == -1)
+ break
+ total += c
+ out.write(buffer, 0, c)
+ }
+ session.fsync(out)
+ Log.d("AppLog", "Success: streamed $total bytes")
+ return PackageInstaller.STATUS_SUCCESS
+ } catch (e: IOException) {
+ Log.e("AppLog", "Error: failed to write; " + e.message)
+ return PackageInstaller.STATUS_FAILURE
+ } finally {
+ try {
+ out?.close()
+ inputStream?.close()
+ session?.close()
+ } catch (e: IOException) {
+ e.printStackTrace()
+ }
+ }
+ }
+
+ private fun doCommitSession(sessionId: Int, context: Context) {
+ var session: PackageInstaller.Session? = null
+ try {
+ try {
+ session = context.packageManager.packageInstaller.openSession(sessionId)
+ val callbackIntent = Intent(context.applicationContext, SplitInstallerService::class.java)
+ val pendingIntent = PendingIntent.getService(context.applicationContext, 0, callbackIntent, 0)
+ session.commit(pendingIntent.intentSender)
+ session.close()
+ Log.d("AppLog", "install request sent")
+ Log.d("AppLog", "doCommitSession: " + context.packageManager.packageInstaller.mySessions)
+ Log.d("AppLog", "doCommitSession: after session commit ")
+ } catch (e: IOException) {
+ e.printStackTrace()
+ }
+
+ } finally {
+ session!!.close()
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/core/installer/SplitInstallerService.kt b/app/src/main/java/com/vanced/manager/core/installer/SplitInstallerService.kt
new file mode 100644
index 0000000000..767d3a0248
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/core/installer/SplitInstallerService.kt
@@ -0,0 +1,111 @@
+package com.vanced.manager.core.installer
+
+import android.app.Notification
+import android.app.Service
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageInstaller
+import android.os.Build
+import android.os.IBinder
+import android.util.Log
+import android.widget.Toast
+import androidx.annotation.Nullable
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+import com.vanced.manager.utils.MiuiHelper.isMiui
+import com.vanced.manager.utils.NotificationHelper.createBasicNotif
+
+class SplitInstallerService: Service() {
+
+ override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
+ val notifId = 666
+ when (intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)) {
+ PackageInstaller.STATUS_PENDING_USER_ACTION -> {
+ Toast.makeText(this, "Installing...", Toast.LENGTH_SHORT).show()
+ createBasicNotif(getString(R.string.installing_app, "Vanced"), notifId, this)
+ Log.d(TAG, "Requesting user confirmation for installation")
+ val confirmationIntent =
+ intent.getParcelableExtra(Intent.EXTRA_INTENT)
+ confirmationIntent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ try {
+ startActivity(confirmationIntent)
+ } catch (e: Exception) {
+ }
+ }
+ PackageInstaller.STATUS_SUCCESS -> {
+ Log.d(TAG, "Installation succeed")
+ getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isInstalling", false).apply()
+ val mIntent = Intent(MainActivity.INSTALL_COMPLETED)
+ mIntent.action = MainActivity.INSTALL_COMPLETED
+ mIntent.putExtra("package", "split")
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ createBasicNotif(
+ getString(R.string.successfully_installed, "Vanced"),
+ notifId,
+ this
+ )
+ }
+ else -> {
+ sendFailure(intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999))
+ createBasicNotif(
+ getErrorMessage(intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)),
+ notifId,
+ this
+ )
+ }
+ }
+ stopSelf()
+ return START_NOT_STICKY
+ }
+
+ private fun sendFailure(status: Int) {
+ val mIntent = Intent(MainActivity.INSTALL_FAILED)
+ mIntent.action = MainActivity.INSTALL_FAILED
+ mIntent.putExtra("errorMsg", getErrorMessage(status))
+ LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
+ }
+
+ private fun getErrorMessage(status: Int): String {
+ return when (status) {
+ PackageInstaller.STATUS_FAILURE_ABORTED -> getString(R.string.installation_aborted)
+ PackageInstaller.STATUS_FAILURE_BLOCKED -> getString(R.string.installation_blocked)
+ PackageInstaller.STATUS_FAILURE_STORAGE -> getString(R.string.installation_storage)
+ PackageInstaller.STATUS_FAILURE_INVALID -> getString(R.string.installation_invalid)
+ PackageInstaller.STATUS_FAILURE_INCOMPATIBLE -> getString(R.string.installation_incompatible)
+ PackageInstaller.STATUS_FAILURE_CONFLICT -> getString(R.string.installation_conflict)
+ else ->
+ if (isMiui())
+ getString(R.string.installation_miui)
+ else
+ getString(R.string.installation_failed)
+ }
+ }
+
+ private fun startForegroundNotif(text: String) {
+ val notifBuilder =
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+ Notification.Builder(this, 666.toString()).setChannelId("69420")
+ else
+ Notification.Builder(this).setPriority(Notification.PRIORITY_DEFAULT)
+
+ notifBuilder.apply {
+ setContentTitle(getString(R.string.app_name))
+ setContentText(text)
+ setSmallIcon(R.drawable.ic_stat_name)
+ }
+
+ val notif = notifBuilder.build()
+ startForeground(666, notif)
+ }
+
+ @Nullable
+ override fun onBind(intent: Intent?): IBinder? {
+ return null
+ }
+
+ companion object{
+ const val TAG = "VMInstall"
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt
new file mode 100644
index 0000000000..ad23d05e38
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt
@@ -0,0 +1,140 @@
+package com.vanced.manager.ui
+
+import android.content.*
+import android.os.Bundle
+import android.util.Log
+import android.view.MenuItem
+import androidx.databinding.DataBindingUtil
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import androidx.navigation.NavDestination
+import androidx.navigation.findNavController
+import androidx.navigation.ui.AppBarConfiguration
+import androidx.navigation.ui.setupWithNavController
+import androidx.preference.PreferenceManager
+import com.google.android.material.appbar.MaterialToolbar
+import com.vanced.manager.R
+import com.vanced.manager.core.Main
+import com.vanced.manager.databinding.ActivityMainBinding
+import com.vanced.manager.ui.dialogs.DialogContainer.installAlertBuilder
+import com.vanced.manager.ui.dialogs.DialogContainer.launchVanced
+import com.vanced.manager.ui.dialogs.DialogContainer.regularPackageInstalled
+import com.vanced.manager.utils.ThemeHelper.setFinalTheme
+
+class MainActivity : Main() {
+
+ private var isParent = true
+ private lateinit var binding: ActivityMainBinding
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ setFinalTheme(this)
+ super.onCreate(savedInstanceState)
+
+ binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
+ binding.lifecycleOwner = this
+
+ val toolbar: MaterialToolbar = findViewById(R.id.home_toolbar)
+ setSupportActionBar(toolbar)
+
+ val navHost = findNavController(R.id.bottom_nav_host)
+ val appBarConfiguration = AppBarConfiguration(navHost.graph)
+ toolbar.setupWithNavController(navHost, appBarConfiguration)
+
+ navHost.addOnDestinationChangedListener{_, currFrag: NavDestination, _ ->
+ isParent = when (currFrag.id) {
+ R.id.home_fragment -> true
+ else -> false
+ }
+
+ setDisplayHomeAsUpEnabled(!isParent)
+
+ }
+
+ registerReceivers()
+
+ }
+
+ private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ when (intent.action) {
+ INSTALL_COMPLETED -> {
+ if (intent.getStringExtra("package") == "split")
+ launchVanced(this@MainActivity)
+ else
+ regularPackageInstalled(getString(R.string.microg_installed), this@MainActivity)
+ }
+ INSTALL_FAILED -> installAlertBuilder(intent.getStringExtra("errorMsg") as String, this@MainActivity)
+ APP_UNINSTALLED -> {
+ restartActivity()
+ Log.d("VMpm", "test")
+ }
+ APP_NOT_UNINSTALLED -> installAlertBuilder(getString(R.string.failed_uninstall) + intent.getStringExtra("pkgName"), this@MainActivity)
+ }
+ }
+ }
+
+ override fun onPause() {
+ super.onPause()
+ LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver)
+ }
+
+ override fun onResume() {
+ setFinalTheme(this)
+ super.onResume()
+ registerReceivers()
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val navHost = findNavController(R.id.bottom_nav_host)
+ when (item.itemId) {
+ android.R.id.home -> {
+ onBackPressed()
+ return true
+ }
+ R.id.toolbar_about -> {
+ navHost.navigate(R.id.toAboutFragment)
+ return true
+ }
+ R.id.toolbar_settings -> {
+ navHost.navigate(R.id.action_settingsFragment)
+ return true
+ }
+ R.id.dev_settings -> {
+ navHost.navigate(R.id.toDevSettingsFragment)
+ return true
+ }
+ else -> super.onOptionsItemSelected(item)
+ }
+ return false
+ }
+
+ private fun setDisplayHomeAsUpEnabled(isNeeded: Boolean) {
+ val toolbar: MaterialToolbar = findViewById(R.id.home_toolbar)
+ when {
+ isNeeded -> toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
+ else -> toolbar.navigationIcon = null
+ }
+ }
+
+ private fun registerReceivers() {
+ val intentFilter = IntentFilter()
+ intentFilter.addAction(INSTALL_COMPLETED)
+ intentFilter.addAction(INSTALL_FAILED)
+ intentFilter.addAction(APP_UNINSTALLED)
+ intentFilter.addAction(APP_NOT_UNINSTALLED)
+ LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, intentFilter)
+
+ }
+
+ fun restartActivity() {
+ startActivity(Intent(this@MainActivity, MainActivity::class.java))
+ overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
+ finish()
+ }
+
+ companion object {
+ const val INSTALL_COMPLETED = "Installation completed"
+ const val INSTALL_FAILED = "it just failed idk"
+ const val APP_UNINSTALLED = "App uninstalled"
+ const val APP_NOT_UNINSTALLED = "App not uninstalled"
+ }
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/core/SlidingConstraintLayout.kt b/app/src/main/java/com/vanced/manager/ui/core/SlidingConstraintLayout.kt
new file mode 100644
index 0000000000..79f0c59f8e
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/core/SlidingConstraintLayout.kt
@@ -0,0 +1,32 @@
+package com.vanced.manager.ui.core
+
+import android.content.Context
+import android.util.AttributeSet
+import androidx.constraintlayout.widget.ConstraintLayout
+
+open class SlidingConstraintLayout : ConstraintLayout {
+
+ constructor(context: Context?) : super(context)
+ constructor(context: Context?, attrs: AttributeSet?) : super(
+ context,
+ attrs
+ )
+
+ var xFraction: Float
+ get() {
+ val width = width
+ return if (width != 0)
+ x / getWidth()
+ else
+ x
+ }
+ set(xFraction) {
+ val width = width
+ val newWidth =
+ if (width > 0)
+ xFraction * width
+ else
+ (1).toFloat()
+ x = newWidth
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt b/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt
new file mode 100644
index 0000000000..b106240463
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/core/SlidingLinearLayout.kt
@@ -0,0 +1,33 @@
+package com.vanced.manager.ui.core
+
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.LinearLayout
+
+open class SlidingLinearLayout: LinearLayout {
+
+ constructor(context: Context?) : super(context)
+ constructor(context: Context?, attrs: AttributeSet?) : super(
+ context,
+ attrs
+ )
+
+ var yFraction: Float
+ get() {
+ val height = height
+ return if (height != 0)
+ y / height
+ else
+ y
+ }
+ set(yFraction) {
+ val height = height
+ val newHeight =
+ if (height > 0)
+ yFraction * height
+ else
+ (1).toFloat()
+ y = newHeight
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/core/SlidingNestedScrollView.kt b/app/src/main/java/com/vanced/manager/ui/core/SlidingNestedScrollView.kt
new file mode 100644
index 0000000000..9492e41bb5
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/core/SlidingNestedScrollView.kt
@@ -0,0 +1,31 @@
+package com.vanced.manager.ui.core
+
+import android.content.Context
+import android.util.AttributeSet
+import androidx.core.widget.NestedScrollView
+
+open class SlidingNestedScrollView : NestedScrollView {
+ constructor(context: Context?) : super(context!!)
+ constructor(context: Context?, attrs: AttributeSet?) : super(
+ context!!,
+ attrs
+ )
+
+ var xFraction: Float
+ get() {
+ val width = width
+ return if (width != 0)
+ x / getWidth()
+ else
+ x
+ }
+ set(xFraction) {
+ val width = width
+ val newWidth =
+ if (width > 0)
+ xFraction * width
+ else
+ (1).toFloat()
+ x = newWidth
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/core/SplashScreenActivity.kt b/app/src/main/java/com/vanced/manager/ui/core/SplashScreenActivity.kt
new file mode 100644
index 0000000000..303e681ba7
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/core/SplashScreenActivity.kt
@@ -0,0 +1,18 @@
+package com.vanced.manager.ui.core
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+
+class SplashScreenActivity : AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ setTheme(R.style.SplashTheme)
+ super.onCreate(savedInstanceState)
+
+ startActivity(Intent(this@SplashScreenActivity, MainActivity::class.java))
+ finish()
+ }
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardFragment.kt b/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardFragment.kt
deleted file mode 100644
index 9de3a92cdc..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardFragment.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.vanced.manager.ui.dashboard
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.Observer
-import androidx.lifecycle.ViewModelProviders
-import com.vanced.manager.R
-
-class DashboardFragment : Fragment() {
-
- private lateinit var dashboardViewModel: DashboardViewModel
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- dashboardViewModel =
- ViewModelProviders.of(this).get(DashboardViewModel::class.java)
- val root = inflater.inflate(R.layout.fragment_dashboard, container, false)
- val textView: TextView = root.findViewById(R.id.text_dashboard)
- dashboardViewModel.text.observe(viewLifecycleOwner, Observer {
- textView.text = it
- })
- return root
- }
-}
diff --git a/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardViewModel.kt b/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardViewModel.kt
deleted file mode 100644
index d9e4f5632c..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/dashboard/DashboardViewModel.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.vanced.manager.ui.dashboard
-
-import androidx.lifecycle.LiveData
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.ViewModel
-
-class DashboardViewModel : ViewModel() {
-
- private val _text = MutableLiveData().apply {
- value = "This is dashboard Fragment"
- }
- val text: LiveData = _text
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt b/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt
new file mode 100644
index 0000000000..23fedcf62a
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt
@@ -0,0 +1,140 @@
+package com.vanced.manager.ui.dialogs
+
+import android.app.Activity
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.view.View
+import androidx.appcompat.app.AlertDialog
+import androidx.core.content.ContextCompat.startActivity
+import androidx.navigation.findNavController
+import androidx.preference.PreferenceManager
+import com.vanced.manager.R
+import com.vanced.manager.core.downloader.VancedDownloadService
+import com.vanced.manager.ui.MainActivity
+import com.vanced.manager.utils.InternetTools.openUrl
+import com.vanced.manager.utils.MiuiHelper
+
+object DialogContainer {
+
+ fun showSecurityDialog(context: Context) {
+ AlertDialog.Builder(context)
+ .setTitle(context.resources.getString(R.string.welcome))
+ .setMessage(context.resources.getString(R.string.security_context))
+ .setCancelable(false)
+ .setPositiveButton(context.resources.getString(R.string.close)) { dialog, _ ->
+ run {
+ dialog.dismiss()
+ if (MiuiHelper.isMiui()) {
+ showMiuiDialog(context)
+ }
+ }
+ }
+ .create()
+ .show()
+
+ val prefs = PreferenceManager.getDefaultSharedPreferences(context)
+ prefs.edit().putBoolean("firstStart", false).apply()
+ }
+
+ private fun showMiuiDialog(context: Context) {
+ AlertDialog.Builder(context)
+ .setTitle(context.getString(R.string.miui_one_title))
+ .setMessage(context.getString(R.string.miui_one))
+ .setPositiveButton(context.getString(R.string.close)) { dialog, _ -> dialog.dismiss() }
+ .setNeutralButton(context.getString(R.string.guide)) { _, _ ->
+ openUrl("https://telegra.ph/How-to-install-v15-on-MIUI-02-11", R.color.Telegram, context)
+ }
+ .create()
+ .show()
+ }
+
+ fun showRootDialog(activity: Activity) {
+ AlertDialog.Builder(activity)
+ .setTitle(activity.getString(R.string.hold_on))
+ .setMessage(activity.getString(R.string.disable_signature))
+ .setPositiveButton(activity.getString(R.string.button_dismiss)) { dialog, _ ->
+ dialog.dismiss()
+ PreferenceManager.getDefaultSharedPreferences(activity).edit().putBoolean("show_root_dialog", false).apply()
+ }
+ .setNeutralButton(activity.getString(R.string.guide)) { _, _ ->
+ openUrl("https://lmgtfy.com/?q=andnixsh+apk+verification+disable", R.color.Twitter, activity)
+ }
+ .create()
+ .show()
+ }
+
+ fun secondMiuiDialog(context: Context) {
+ AlertDialog.Builder(context)
+ .setTitle(context.getString(R.string.miui_two_title))
+ .setMessage(context.getString(R.string.miui_two))
+ .setPositiveButton(context.getString(R.string.button_fine)) { dialog, _ ->
+ dialog.dismiss()
+ }
+ .setNeutralButton(context.getString(R.string.guide)) { _, _ ->
+ openUrl("https://telegra.ph/How-to-install-v15-on-MIUI-02-11", R.color.Telegram, context)
+ }
+ .create()
+ .show()
+ }
+
+ //Easter Egg
+ fun statementFalse(context: Context) {
+ AlertDialog.Builder(context)
+ .setTitle("Wait what?")
+ .setMessage("So this statement is false huh? I'll go with True!")
+ .setPositiveButton("wut?") { dialog, _ -> dialog.dismiss() }
+ .create()
+ .show()
+
+ val prefs = PreferenceManager.getDefaultSharedPreferences(context)
+ prefs.edit().putBoolean("statement", true).apply()
+ }
+
+ fun installAlertBuilder(msg: String, context: Context) {
+ AlertDialog.Builder(context)
+ .setTitle(context.getString(R.string.error))
+ .setMessage(msg)
+ .setPositiveButton(context.getString(R.string.close)) { dialog, _ -> dialog.dismiss() }
+ .create()
+ .show()
+ }
+
+ fun regularPackageInstalled(msg: String, activity: MainActivity) {
+ AlertDialog.Builder(activity)
+ .setTitle(activity.getString(R.string.success))
+ .setMessage(msg)
+ .setPositiveButton(activity.getString(R.string.close)) { _, _ -> activity.restartActivity() }
+ .setCancelable(false)
+ .create()
+ .show()
+ }
+
+ fun launchVanced(activity: MainActivity) {
+ val intent = Intent()
+ intent.component =
+ if (PreferenceManager.getDefaultSharedPreferences(activity).getString("vanced_variant", "nonroot") == "root")
+ ComponentName("com.google.android.youtube", "com.google.android.youtube.HomeActivity")
+ else
+ ComponentName("com.vanced.android.youtube", "com.google.android.youtube.HomeActivity")
+ AlertDialog.Builder(activity)
+ .setTitle(activity.getString(R.string.success))
+ .setMessage(activity.getString(R.string.vanced_installed))
+ .setPositiveButton(activity.getString(R.string.launch)) { _, _ ->
+ run {
+ startActivity(activity, intent, null)
+ activity.finish()
+ }
+ }
+ .setNegativeButton(activity.getString(R.string.close)) { dialog, _ ->
+ run {
+ dialog.dismiss()
+ activity.restartActivity()
+ }
+ }
+ .setCancelable(false)
+ .create()
+ .show()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/AboutFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/AboutFragment.kt
new file mode 100644
index 0000000000..7e67c2ab4d
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/AboutFragment.kt
@@ -0,0 +1,34 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.viewModels
+import com.vanced.manager.R
+import com.vanced.manager.core.fragments.About
+import com.vanced.manager.databinding.FragmentAboutBinding
+import com.vanced.manager.ui.viewmodels.AboutViewModel
+
+class AboutFragment : About() {
+
+ private lateinit var binding: FragmentAboutBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ activity?.title = getString(R.string.title_about)
+ binding = DataBindingUtil.inflate(inflater, R.layout.fragment_about, container, false)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val viewModel: AboutViewModel by viewModels()
+ binding.viewModel = viewModel
+ }
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/ChosenPreferenceDialogFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/ChosenPreferenceDialogFragment.kt
new file mode 100644
index 0000000000..6e4635656e
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/ChosenPreferenceDialogFragment.kt
@@ -0,0 +1,56 @@
+package com.vanced.manager.ui.fragments
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.drawable.ColorDrawable
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.TextView
+import androidx.fragment.app.DialogFragment
+
+import com.vanced.manager.R
+
+class ChosenPreferenceDialogFragment : DialogFragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ if (dialog != null && dialog?.window != null) {
+ dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
+ }
+ return inflater.inflate(R.layout.fragment_chosen_preferences, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val closebtn = view.findViewById(R.id.chosen_prefs_close)
+ val resetbtn = view.findViewById(R.id.chosen_prefs_reset)
+ val themetxt = view.findViewById(R.id.chosen_theme)
+ val langtxt = view.findViewById(R.id.chosen_lang)
+
+ val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
+
+ themetxt.text = activity?.getString(R.string.chosen_theme, prefs?.getString("theme", "dark"))
+ langtxt.text = activity?.getString(R.string.chosen_lang, prefs?.getString("lang", "en"))
+
+ closebtn.setOnClickListener { dismiss() }
+
+ resetbtn.setOnClickListener {
+ prefs?.edit()?.putString("theme", "dark")?.apply()
+ prefs?.edit()?.putString("lang", "en")?.apply()
+ prefs?.edit()?.putBoolean("valuesModified", false)?.apply()
+ dismiss()
+ }
+
+
+
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/DevSettingsFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/DevSettingsFragment.kt
new file mode 100644
index 0000000000..9dedfe745d
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/DevSettingsFragment.kt
@@ -0,0 +1,49 @@
+package com.vanced.manager.ui.fragments
+
+import android.content.Intent
+import android.os.Build
+import android.os.Bundle
+import androidx.appcompat.app.AlertDialog
+import androidx.preference.Preference
+import androidx.preference.PreferenceFragmentCompat
+import androidx.preference.PreferenceManager
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+
+class DevSettingsFragment: PreferenceFragmentCompat() {
+
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ setPreferencesFromResource(R.xml.dev_settings, rootKey)
+
+ val ftSwitch: Preference? = findPreference("firststart_switch")
+
+ val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
+ ftSwitch?.setOnPreferenceClickListener {
+
+ AlertDialog.Builder(requireContext())
+ .setTitle("FirstStart activated")
+ .setMessage("boolean will be activated on next app start")
+ .setPositiveButton("Restart") { _, _ ->
+ run {
+ startActivity(Intent(requireContext(), MainActivity::class.java))
+ activity?.finish()
+ }
+ }
+ .create()
+ .show()
+
+ prefs.edit().putBoolean("firstStart", true).apply()
+ true
+
+ }
+ val archPref: Preference? = findPreference("device_arch")
+ val supportedAbis: Array = Build.SUPPORTED_ABIS
+
+ if (supportedAbis.contains("arm64-v8a") || supportedAbis.contains("x86_64")) {
+ archPref?.summary = "64bit"
+ } else {
+ archPref?.summary = "32bit"
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt
new file mode 100644
index 0000000000..9773c1e913
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt
@@ -0,0 +1,165 @@
+package com.vanced.manager.ui.fragments
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.content.res.ColorStateList
+import android.graphics.Color
+import android.os.Bundle
+import android.util.Log
+import android.view.*
+import android.view.animation.AccelerateDecelerateInterpolator
+import android.view.animation.Animation
+import android.view.animation.RotateAnimation
+import android.widget.*
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.viewModels
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import androidx.preference.PreferenceManager.getDefaultSharedPreferences
+import androidx.viewpager2.widget.ViewPager2
+import com.google.android.material.button.MaterialButton
+import com.google.android.material.tabs.TabLayout
+import com.google.android.material.tabs.TabLayoutMediator
+import com.vanced.manager.R
+import com.vanced.manager.adapter.SectionPageAdapter
+import com.vanced.manager.adapter.SectionPageRootAdapter
+import com.vanced.manager.core.fragments.Home
+import com.vanced.manager.databinding.FragmentHomeBinding
+import com.vanced.manager.ui.viewmodels.HomeViewModel
+import com.vanced.manager.utils.PackageHelper.installApp
+
+class HomeFragment : Home() {
+
+ private lateinit var binding: FragmentHomeBinding
+ private var isExpanded: Boolean = false
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ activity?.title = getString(R.string.title_home)
+ setHasOptionsMenu(true)
+ binding = DataBindingUtil.inflate(inflater, R.layout.fragment_home, container, false)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val viewModel: HomeViewModel by viewModels()
+ binding.viewModel = viewModel
+
+ val variantPref = getDefaultSharedPreferences(activity).getString("vanced_variant", "nonroot")
+ registerReceivers()
+
+ if (variantPref == "root")
+ attachRootChangelog()
+ else {
+ attachNonrootChangelog()
+ if (!viewModel.microgInstalled) {
+ disableVancedButton()
+ }
+ }
+
+ view.findViewById(R.id.changelog_button).setOnClickListener {
+ cardExpandCollapse()
+ }
+ }
+
+ private fun cardExpandCollapse() {
+ val viewPagerContainer = view?.findViewById(R.id.viewpager)
+ val tabLayoutContainer = view?.findViewById(R.id.tablayout)
+ val arrow = view?.findViewById(R.id.changelog_button)
+ if (isExpanded) {
+ viewPagerContainer?.visibility = View.GONE
+ tabLayoutContainer?.visibility = View.GONE
+ isExpanded = false
+ arrow?.animate()?.rotation(0F)?.interpolator = AccelerateDecelerateInterpolator()
+ } else {
+ viewPagerContainer?.visibility = View.VISIBLE
+ tabLayoutContainer?.visibility = View.VISIBLE
+ isExpanded = true
+ arrow?.animate()?.rotation(180F)?.interpolator = AccelerateDecelerateInterpolator()
+ }
+ }
+
+ override fun onPause() {
+ super.onPause()
+ activity?.let { LocalBroadcastManager.getInstance(it).unregisterReceiver(broadcastReceiver) }
+ }
+
+ private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ when (intent.action) {
+ MICROG_DOWNLOADED -> {
+ view?.findViewById(R.id.microg_installing)?.visibility = View.VISIBLE
+ activity?.let { installApp(it, it.filesDir.path + "/microg.apk", "com.mgoogle.android.gms") }
+ }
+ VANCED_DOWNLOADED -> {
+ view?.findViewById(R.id.vanced_installing)?.visibility = View.VISIBLE
+ }
+ }
+ }
+ }
+
+ private fun registerReceivers() {
+ val intentFilter = IntentFilter()
+ intentFilter.addAction(VANCED_DOWNLOADED)
+ intentFilter.addAction(MICROG_DOWNLOADED)
+ activity?.let {
+ LocalBroadcastManager.getInstance(it).registerReceiver(broadcastReceiver, intentFilter)
+ }
+
+ }
+
+ private fun attachNonrootChangelog() {
+ val sectionPageAdapter = SectionPageAdapter(this)
+ val tabLayout = view?.findViewById(R.id.tablayout) as TabLayout
+ val viewPager = view?.findViewById(R.id.viewpager) as ViewPager2
+ viewPager.adapter = sectionPageAdapter
+
+ TabLayoutMediator(tabLayout, viewPager) { tab, position ->
+ when (position) {
+ 0 -> tab.text = "Vanced"
+ 1 -> tab.text = "MicroG"
+ 2 -> tab.text = "Manager"
+ }
+ }.attach()
+ }
+
+ private fun attachRootChangelog() {
+ val sectionPageRootAdapter = SectionPageRootAdapter(this)
+ val tabLayout = view?.findViewById(R.id.tablayout) as TabLayout
+ val viewPager = view?.findViewById(R.id.viewpager) as ViewPager2
+ viewPager.adapter = sectionPageRootAdapter
+
+ TabLayoutMediator(tabLayout, viewPager) { tab, position ->
+ when (position) {
+ 0 -> tab.text = "Vanced"
+ 1 -> tab.text = "Manager"
+ }
+ }.attach()
+ }
+
+ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
+ inflater.inflate(R.menu.toolbar_menu, menu)
+ super .onCreateOptionsMenu(menu, inflater)
+ }
+
+ private fun disableVancedButton() {
+ val vancedinstallbtn = view?.findViewById(R.id.vanced_installbtn)
+ vancedinstallbtn?.isEnabled = false
+ vancedinstallbtn?.backgroundTintList = ColorStateList.valueOf(Color.DKGRAY)
+ vancedinstallbtn?.setTextColor(ColorStateList.valueOf(Color.GRAY))
+ vancedinstallbtn?.icon = null
+ }
+
+ companion object {
+ const val VANCED_DOWNLOADED = "Vanced downloaded"
+ const val MICROG_DOWNLOADED = "MicroG downloaded"
+
+ }
+
+}
+
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/ManagerChangelogFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/ManagerChangelogFragment.kt
new file mode 100644
index 0000000000..e76b3d509b
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/ManagerChangelogFragment.kt
@@ -0,0 +1,32 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.R
+
+class ManagerChangelogFragment : Fragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ return inflater.inflate(R.layout.fragment_manager_changelog, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val changelogTxt = view.findViewById(R.id.manager_changelog)
+
+ if (GetJson().isConnected(activity)) {
+ val checkUrl = GetJson().AsJSONObject("https://vanced.app/api/v1/manager.json")
+ val changelog = checkUrl.get("changelog").asString
+ changelogTxt.text = changelog
+ }
+ }
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/MicrogChangelogFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/MicrogChangelogFragment.kt
new file mode 100644
index 0000000000..44a42712ac
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/MicrogChangelogFragment.kt
@@ -0,0 +1,32 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.R
+
+class MicrogChangelogFragment : Fragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ return inflater.inflate(R.layout.fragment_microg_changelog, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val changelogTxt = view.findViewById(R.id.microg_changelog)
+
+ if (GetJson().isConnected(activity)) {
+ val checkUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/microg.json")
+ val changelog = checkUrl.get("changelog").asString
+ changelogTxt.text = changelog
+ }
+ }
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/SettingsFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/SettingsFragment.kt
new file mode 100644
index 0000000000..748ce019de
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/SettingsFragment.kt
@@ -0,0 +1,67 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import android.view.Menu
+import android.view.MenuInflater
+import androidx.preference.*
+import com.vanced.manager.R
+import com.vanced.manager.utils.MiuiHelper.isMiui
+
+class SettingsFragment : PreferenceFragmentCompat() {
+
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ setPreferencesFromResource(R.xml.preferences, rootKey)
+
+ activity?.title = getString(R.string.title_settings)
+ setHasOptionsMenu(true)
+
+ val updateCheck: Preference? = findPreference("update_check")
+ updateCheck?.setOnPreferenceClickListener {
+ val fm = childFragmentManager.beginTransaction()
+ val updateDialog = UpdateCheckFragment()
+ updateDialog.show(fm, "Update Center")
+ true
+ }
+
+ val themeSwitch: ListPreference? = findPreference("theme_mode")
+ themeSwitch?.summary =
+ preferenceScreen.sharedPreferences.getString("theme_mode", "Follow System")
+ themeSwitch?.setOnPreferenceChangeListener { _, _ ->
+ activity?.recreate()
+ true
+ }
+
+ val accentSwitch: ListPreference? = findPreference("accent_color")
+ accentSwitch?.summary = preferenceScreen.sharedPreferences.getString("accent_color", "Blue")
+ accentSwitch?.setOnPreferenceChangeListener { _, _ ->
+ activity?.recreate()
+ true
+ }
+
+ val chosenPrefs: Preference? = findPreference("vanced_chosen_modes")
+ chosenPrefs?.setOnPreferenceClickListener {
+ val fm = childFragmentManager.beginTransaction()
+ val chosenPrefsDialog = ChosenPreferenceDialogFragment()
+ chosenPrefsDialog.show(fm, "Chosen Preferences")
+ true
+ }
+
+ val installUrl: Preference? = findPreference("install_url")
+ installUrl?.setOnPreferenceClickListener {
+ val fm = childFragmentManager.beginTransaction()
+ val chosenPrefsDialog = URLChangeFragment()
+ chosenPrefsDialog.show(fm, "Install URL")
+ true
+ }
+
+ }
+
+ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
+ val devSettings = PreferenceManager.getDefaultSharedPreferences(activity).getBoolean("devSettings", false)
+ if (devSettings) {
+ inflater.inflate(R.menu.dev_settings_menu, menu)
+ }
+ super .onCreateOptionsMenu(menu, inflater)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/URLChangeFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/URLChangeFragment.kt
new file mode 100644
index 0000000000..58fcb8a3cc
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/URLChangeFragment.kt
@@ -0,0 +1,43 @@
+package com.vanced.manager.ui.fragments
+
+import android.graphics.Color
+import android.graphics.drawable.ColorDrawable
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.EditText
+import androidx.fragment.app.DialogFragment
+import androidx.preference.PreferenceManager
+import com.google.android.material.button.MaterialButton
+import com.vanced.manager.R
+import com.vanced.manager.utils.InternetTools.baseUrl
+
+class URLChangeFragment : DialogFragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ if (dialog != null && dialog?.window != null) {
+ dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
+ }
+ return inflater.inflate(R.layout.fragment_custom_url, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ val urlField = view.findViewById(R.id.url_input)
+ val prefs = PreferenceManager.getDefaultSharedPreferences(activity)
+ urlField.hint = prefs.getString("install_url", baseUrl)
+ view.findViewById(R.id.url_save).setOnClickListener {
+ prefs.edit().putString("install_url", urlField.text.toString()).apply()
+ dismiss()
+ }
+ view.findViewById(R.id.url_reset).setOnClickListener {
+ prefs.edit().putString("install_url", baseUrl).apply()
+ dismiss()
+ }
+ }
+
+}
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
new file mode 100644
index 0000000000..0342b126e4
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt
@@ -0,0 +1,101 @@
+package com.vanced.manager.ui.fragments
+
+import android.graphics.Color
+import android.graphics.drawable.ColorDrawable
+import android.os.Bundle
+import android.util.Log
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.ProgressBar
+import android.widget.TextView
+import android.widget.Toast
+import androidx.fragment.app.DialogFragment
+import com.dezlum.codelabs.getjson.GetJson
+import androidx.preference.PreferenceManager
+import com.downloader.Error
+import com.downloader.OnDownloadListener
+import com.downloader.PRDownloader
+import com.google.android.material.button.MaterialButton
+import com.vanced.manager.BuildConfig
+
+import com.vanced.manager.R
+import com.vanced.manager.utils.InternetTools.isUpdateAvailable
+import com.vanced.manager.utils.PackageHelper.installApp
+
+class UpdateCheckFragment : DialogFragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ if (dialog != null && dialog?.window != null) {
+ dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
+ }
+ return inflater.inflate(R.layout.fragment_update_check, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ checkUpdates()
+ view.findViewById(R.id.update_center_dismiss).setOnClickListener { dismiss() }
+ view.findViewById(R.id.update_center_recheck).setOnClickListener{ checkUpdates() }
+ }
+
+ private fun checkUpdates() {
+ val updatebtn = view?.findViewById(R.id.update_center_update)
+ val checkingTxt = view?.findViewById(R.id.update_center_checking)
+ if (GetJson().isConnected(requireContext())) {
+
+ if (isUpdateAvailable()) {
+ view?.findViewById(R.id.update_center_recheck)?.visibility = View.GONE
+ checkingTxt?.text = getString(R.string.update_found)
+
+ updatebtn?.setOnClickListener {
+ upgradeManager()
+ }
+ } else checkingTxt?.text = getString(R.string.update_notfound)
+
+ } else {
+ checkingTxt?.text = getString(R.string.network_error)
+ }
+ }
+
+ private fun upgradeManager() {
+ val dwnldUrl = "https://github.com/VancedManager/releases/latest/download/manager.apk"
+ val loadBar = view?.findViewById(R.id.update_center_progressbar)
+
+ PRDownloader.download(dwnldUrl, activity?.filesDir?.path, "manager.apk")
+ .build()
+ .setOnProgressListener { progress ->
+ val mProgress = progress.currentBytes * 100 / progress.totalBytes
+ loadBar?.visibility = View.VISIBLE
+ loadBar?.progress = mProgress.toInt()
+
+ }
+ .start(object : OnDownloadListener{
+ override fun onDownloadComplete() {
+ val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
+ prefs.getBoolean("isUpgrading", false)
+ prefs.edit().putBoolean("isUpgrading", true).apply()
+
+ activity?.let {
+ installApp(
+ it,
+ it.filesDir.path + "/manager.apk",
+ "com.vanced.manager")
+ }
+ }
+
+ override fun onError(error: Error?) {
+ Toast.makeText(activity, error.toString(), Toast.LENGTH_SHORT).show()
+ Log.e("VMUpgrade", error.toString())
+ }
+ })
+
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/VancedChangelogFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/VancedChangelogFragment.kt
new file mode 100644
index 0000000000..8318cff092
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/VancedChangelogFragment.kt
@@ -0,0 +1,34 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.R
+
+class VancedChangelogFragment : Fragment() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ return inflater.inflate(R.layout.fragment_vanced_changelog, container, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ val changelogTxt = view.findViewById(R.id.vanced_changelog)
+
+ if (GetJson().isConnected(activity)) {
+ val checkUrl = GetJson().AsJSONObject("https://vanced.app/api/v1/changelog/15_05_54.json")
+ val changelog = checkUrl.get("message").asString
+ changelogTxt.text = changelog
+ }
+
+ }
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/VancedLanguageSelectionFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/VancedLanguageSelectionFragment.kt
new file mode 100644
index 0000000000..eff23b3c5a
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/VancedLanguageSelectionFragment.kt
@@ -0,0 +1,20 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.vanced.manager.R
+import com.vanced.manager.core.fragments.LanguageInstall
+
+class VancedLanguageSelectionFragment : LanguageInstall() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ activity?.title = getString(R.string.title_install)
+ return inflater.inflate(R.layout.fragment_vanced_language_selection, container, false)
+ }
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/VancedThemeSelectionFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/VancedThemeSelectionFragment.kt
new file mode 100644
index 0000000000..f2a60abd50
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/fragments/VancedThemeSelectionFragment.kt
@@ -0,0 +1,20 @@
+package com.vanced.manager.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.vanced.manager.R
+import com.vanced.manager.core.fragments.ThemeInstall
+
+class VancedThemeSelectionFragment : ThemeInstall() {
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ activity?.title = getString(R.string.title_install)
+ return inflater.inflate(R.layout.fragment_vanced_theme_selection, container, false)
+ }
+
+}
diff --git a/app/src/main/java/com/vanced/manager/ui/home/HomeFragment.kt b/app/src/main/java/com/vanced/manager/ui/home/HomeFragment.kt
deleted file mode 100644
index aab089c66f..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/home/HomeFragment.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.vanced.manager.ui.home
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.Observer
-import androidx.lifecycle.ViewModelProviders
-import com.vanced.manager.R
-
-class HomeFragment : Fragment() {
-
- private lateinit var homeViewModel: HomeViewModel
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- homeViewModel =
- ViewModelProviders.of(this).get(HomeViewModel::class.java)
- val root = inflater.inflate(R.layout.fragment_home, container, false)
- val textView: TextView = root.findViewById(R.id.text_home)
- homeViewModel.text.observe(viewLifecycleOwner, Observer {
- textView.text = it
- })
- return root
- }
-}
diff --git a/app/src/main/java/com/vanced/manager/ui/home/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/home/HomeViewModel.kt
deleted file mode 100644
index e36bac7763..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/home/HomeViewModel.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.vanced.manager.ui.home
-
-import androidx.lifecycle.LiveData
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.ViewModel
-
-class HomeViewModel : ViewModel() {
-
- private val _text = MutableLiveData().apply {
- value = "This is home Fragment"
- }
- val text: LiveData = _text
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsFragment.kt
deleted file mode 100644
index a1b5366888..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsFragment.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.vanced.manager.ui.notifications
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.Observer
-import androidx.lifecycle.ViewModelProviders
-import com.vanced.manager.R
-
-class NotificationsFragment : Fragment() {
-
- private lateinit var notificationsViewModel: NotificationsViewModel
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- notificationsViewModel =
- ViewModelProviders.of(this).get(NotificationsViewModel::class.java)
- val root = inflater.inflate(R.layout.fragment_notifications, container, false)
- val textView: TextView = root.findViewById(R.id.text_notifications)
- notificationsViewModel.text.observe(viewLifecycleOwner, Observer {
- textView.text = it
- })
- return root
- }
-}
diff --git a/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsViewModel.kt b/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsViewModel.kt
deleted file mode 100644
index 6987f85644..0000000000
--- a/app/src/main/java/com/vanced/manager/ui/notifications/NotificationsViewModel.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.vanced.manager.ui.notifications
-
-import androidx.lifecycle.LiveData
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.ViewModel
-
-class NotificationsViewModel : ViewModel() {
-
- private val _text = MutableLiveData().apply {
- value = "This is notifications Fragment"
- }
- val text: LiveData = _text
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/AboutViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/AboutViewModel.kt
new file mode 100644
index 0000000000..3804771dd7
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/AboutViewModel.kt
@@ -0,0 +1,21 @@
+package com.vanced.manager.ui.viewmodels
+
+import android.app.Application
+import android.content.Intent
+import android.net.Uri
+import androidx.browser.customtabs.CustomTabsIntent
+import androidx.core.content.ContextCompat
+import androidx.lifecycle.AndroidViewModel
+import com.vanced.manager.R
+
+open class AboutViewModel(application: Application): AndroidViewModel(application) {
+
+ fun openUrl(Url: String) {
+ val builder = CustomTabsIntent.Builder()
+ builder.setToolbarColor(ContextCompat.getColor(getApplication(), R.color.GitHub))
+ val customTabsIntent = builder.build()
+ customTabsIntent.intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ customTabsIntent.launchUrl(getApplication(), Uri.parse(Url))
+ }
+
+}
\ 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
new file mode 100644
index 0000000000..c1485f0a41
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt
@@ -0,0 +1,159 @@
+package com.vanced.manager.ui.viewmodels
+
+import android.app.Application
+import android.content.ActivityNotFoundException
+import android.content.ComponentName
+import android.content.Intent
+import android.content.res.Resources
+import android.graphics.drawable.Drawable
+import android.net.Uri
+import android.os.Build
+import android.widget.Toast
+import androidx.browser.customtabs.CustomTabsIntent
+import androidx.core.content.ContextCompat
+import androidx.core.content.ContextCompat.startActivity
+import androidx.lifecycle.AndroidViewModel
+import androidx.lifecycle.MutableLiveData
+import androidx.preference.PreferenceManager.getDefaultSharedPreferences
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.R
+import com.vanced.manager.utils.InternetTools.displayJsonInt
+import com.vanced.manager.utils.InternetTools.displayJsonString
+import com.vanced.manager.utils.PackageHelper.isPackageInstalled
+
+class HomeViewModel(application: Application): AndroidViewModel(application) {
+
+ private val variant = getDefaultSharedPreferences(application).getString("vanced_variant", "nonroot")
+ private val connected: Boolean = GetJson().isConnected(application)
+
+ private val vancedPkgName: String =
+ if (variant== "root") {
+ "com.google.android.youtube"
+ } else {
+ "com.vanced.android.youtube"
+ }
+
+ private val pm = application.packageManager
+
+ val vancedInstallButtonTxt: MutableLiveData = MutableLiveData()
+ val vancedInstallButtonIcon: MutableLiveData = MutableLiveData()
+
+ val microgInstalled: Boolean = isPackageInstalled("com.mgoogle.android.gms", application.packageManager)
+ val vancedInstalled: Boolean = isPackageInstalled(vancedPkgName, application.packageManager)
+
+ val vancedInstalledVersion: MutableLiveData = MutableLiveData()
+ val microgInstalledVersion: MutableLiveData = MutableLiveData()
+
+ val vancedVersion: MutableLiveData = MutableLiveData()
+ val microgVersion: MutableLiveData = MutableLiveData()
+
+ private val vancedInstalledVersionCode = getPkgVerCode(vancedInstalled, vancedPkgName)
+ private val microgInstalledVersionCode = getPkgVerCode(microgInstalled, "com.mgoogle.android.gms")
+
+ private val vancedVersionCode = displayJsonInt("vanced.json", "versionCode", application)
+ private val microgVersionCode = displayJsonInt("microg.json", "versionCode", application)
+
+ val microgInstallButtonTxt = compareInt(microgInstalledVersionCode, microgVersionCode, application)
+
+ val microgInstallButtonIcon = compareIntDrawable(microgInstalledVersionCode, microgVersionCode, application)
+
+ val nonrootModeSelected: Boolean = variant == "nonroot"
+
+ fun openMicrogSettings() {
+ try {
+ val intent = Intent()
+ intent.component = ComponentName(
+ "com.mgoogle.android.gms",
+ "org.microg.gms.ui.SettingsActivity"
+ )
+ intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ startActivity(getApplication(), intent, null)
+ } catch (e: ActivityNotFoundException) {
+ Toast.makeText(getApplication(), "App not installed", Toast.LENGTH_SHORT).show()
+ }
+ }
+
+ fun openUrl(Url: String) {
+ val color: Int =
+ when (Url) {
+ "https://discord.gg/TUVd7rd" -> R.color.Discord
+ "https://t.me/joinchat/AAAAAEHf-pi4jH1SDlAL4w" -> R.color.Telegram
+ "https://twitter.com/YTVanced" -> R.color.Twitter
+ "https://reddit.com/r/vanced" -> R.color.Reddit
+ "https://vanced.app" -> R.color.Vanced
+ "https://brave.com/van874" -> R.color.Brave
+ else -> R.color.Vanced
+ }
+
+ val builder = CustomTabsIntent.Builder()
+ builder.setToolbarColor(ContextCompat.getColor(getApplication(), color))
+ val customTabsIntent = builder.build()
+ customTabsIntent.intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ customTabsIntent.launchUrl(getApplication(), Uri.parse(Url))
+ }
+
+ private fun getPkgInfo(toCheck: Boolean, pkg: String, application: Application): String {
+ return if (toCheck) {
+ pm.getPackageInfo(pkg, 0).versionName
+ } else {
+ application.getString(R.string.unavailable)
+ }
+ }
+
+ private fun getPkgVerCode(toCheck: Boolean, pkg: String): Int {
+ return if (toCheck) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
+ pm.getPackageInfo(pkg, 0).longVersionCode.and(0xFFFFFFFF).toInt()
+ else
+ pm.getPackageInfo(pkg, 0).versionCode
+ } else 0
+ }
+
+ private fun compareInt(int1: Int, int2: Int, application: Application): String {
+ return if (connected)
+ when {
+ int2 == 0 -> application.getString(R.string.install)
+ int1 > int2 -> application.getString(R.string.update)
+ int2 == int1 -> application.getString(R.string.button_reinstall)
+ else -> application.getString(R.string.install)
+ } else application.getString(R.string.install)
+ }
+
+ private fun compareIntDrawable(int1: Int, int2: Int, application: Application): Drawable? {
+ return if (connected)
+ when {
+ int2 == 0 -> application.getDrawable(R.drawable.ic_download)
+ int1 > int2 -> application.getDrawable(R.drawable.ic_update)
+ int2 == int1 -> application.getDrawable(R.drawable.ic_done)
+ else -> application.getDrawable(R.drawable.ic_download)
+ } else application.getDrawable(R.drawable.ic_download)
+
+ }
+
+ init {
+ vancedVersion.value = displayJsonString("vanced.json","version", application)
+ microgVersion.value = displayJsonString("microg.json","version", application)
+ vancedInstalledVersion.value = getPkgInfo(vancedInstalled, vancedPkgName, application)
+ microgInstalledVersion.value = getPkgInfo(microgInstalled, "com.mgoogle.android.gms", application)
+ vancedInstallButtonIcon.value =
+ if (variant == "nonroot") {
+ if (microgInstalled)
+ compareIntDrawable(vancedVersionCode, vancedInstalledVersionCode, application)
+ else
+ null
+ } else
+ compareIntDrawable(vancedVersionCode, vancedInstalledVersionCode, application)
+
+ vancedInstallButtonTxt.value =
+ if (variant == "nonroot") {
+ if (microgInstalled) {
+ compareInt(vancedVersionCode, vancedInstalledVersionCode, application)
+ } else {
+ application.getString(R.string.no_microg)
+ }
+ } else
+ compareInt(vancedVersionCode, vancedInstalledVersionCode, application)
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/utils/FileInfo.kt b/app/src/main/java/com/vanced/manager/utils/FileInfo.kt
new file mode 100644
index 0000000000..0f11232b2d
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/FileInfo.kt
@@ -0,0 +1,14 @@
+package com.vanced.manager.utils
+
+import java.io.File
+import java.io.FileInputStream
+import java.io.InputStream
+
+open class FileInfo(val name: String, val fileSize: Long, val file: File? = null) {
+
+ open fun getInputStream(): InputStream =
+ if (file!= null)
+ FileInputStream(file)
+ else
+ throw NotImplementedError("need some way to create InputStream")
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/utils/InternetTools.kt b/app/src/main/java/com/vanced/manager/utils/InternetTools.kt
new file mode 100644
index 0000000000..c1efbf7301
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/InternetTools.kt
@@ -0,0 +1,68 @@
+package com.vanced.manager.utils
+
+import android.content.Context
+import android.net.Uri
+import androidx.browser.customtabs.CustomTabsIntent
+import androidx.core.content.ContextCompat
+import androidx.preference.PreferenceManager
+import com.dezlum.codelabs.getjson.GetJson
+import com.vanced.manager.BuildConfig
+import com.vanced.manager.R
+import java.lang.Exception
+import java.lang.IllegalStateException
+
+object InternetTools {
+
+ fun openUrl(Url: String, color: Int, context: Context) {
+ val builder = CustomTabsIntent.Builder()
+ builder.setToolbarColor(ContextCompat.getColor(context, color))
+ val customTabsIntent = builder.build()
+ customTabsIntent.launchUrl(context, Uri.parse(Url))
+ }
+
+ fun getFileNameFromUrl(url: String) = url.substring(url.lastIndexOf('/')+1, url.length)
+
+ fun displayJsonString(json: String, obj: String, context: Context): String {
+ val installUrl = PreferenceManager.getDefaultSharedPreferences(context).getString("install_url", baseUrl)
+ return if (GetJson().isConnected(context)) {
+ try {
+ GetJson().AsJSONObject("$installUrl/$json").get(obj).asString
+ } catch (e: Exception) {
+ when (e) {
+ is InterruptedException, is IllegalStateException -> GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/$json").get(obj).asString
+ else -> throw e
+ }
+
+ }
+ } else {
+ context.getString(R.string.unavailable)
+ }
+ }
+
+ fun displayJsonInt(json: String, obj: String, context: Context): Int {
+ val installUrl = PreferenceManager.getDefaultSharedPreferences(context).getString("install_url", baseUrl)
+ return if (GetJson().isConnected(context)) {
+ try {
+ GetJson().AsJSONObject("$installUrl/$json").get(obj).asInt
+ } catch (e: Exception) {
+ when (e) {
+ is InterruptedException, is IllegalStateException -> GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/$json").get(obj).asInt
+ else -> throw e
+ }
+
+ }
+ } else 0
+ }
+
+ fun isUpdateAvailable(): Boolean {
+ val checkUrl = GetJson().AsJSONObject("https://vanced.app/api/v1/manager.json")
+ val remoteVersion = checkUrl.get("versionCode").asInt
+
+ return remoteVersion > BuildConfig.VERSION_CODE
+ }
+
+ const val baseUrl = "https://vanced.app/api/v1"
+
+
+}
+
diff --git a/app/src/main/java/com/vanced/manager/utils/MiuiHelper.kt b/app/src/main/java/com/vanced/manager/utils/MiuiHelper.kt
new file mode 100644
index 0000000000..afd8e396ce
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/MiuiHelper.kt
@@ -0,0 +1,43 @@
+package com.vanced.manager.utils
+
+import android.text.TextUtils
+import java.io.BufferedReader
+import java.io.IOException
+import java.io.InputStreamReader
+
+object MiuiHelper {
+
+ fun isMiui(): Boolean {
+ return !TextUtils.isEmpty(getSystemProps("ro.miui.ui.version.name"))
+ }
+
+ fun isMiuiOptimisationsDisabled(): Boolean {
+ return if (isMiui())
+ getSystemProps("persist.sys.miui_optimization") == "0"
+ else
+ true
+ }
+
+ private fun getSystemProps(propname: String): String? {
+ val line: String
+ var input: BufferedReader? = null
+ try {
+ val p = Runtime.getRuntime().exec("getprop $propname")
+ input = BufferedReader(InputStreamReader(p.inputStream), 1024)
+ line = input.readLine()
+ input.close()
+ } catch (e: IOException) {
+ return null
+ } finally {
+ if (input != null) {
+ try {
+ input.close()
+ } catch (e: IOException) {
+ e.printStackTrace()
+ }
+ }
+ }
+ return line
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/utils/NotificationHelper.kt b/app/src/main/java/com/vanced/manager/utils/NotificationHelper.kt
new file mode 100644
index 0000000000..196b9e5165
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/NotificationHelper.kt
@@ -0,0 +1,73 @@
+package com.vanced.manager.utils
+
+import android.app.Notification
+import android.app.NotificationChannel
+import android.app.NotificationManager
+import android.app.PendingIntent
+import android.content.Context
+import android.content.Intent
+import android.os.Build
+import com.vanced.manager.R
+
+object NotificationHelper {
+
+ fun createNotifChannel(context: Context) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ val notifChannel = NotificationChannel(
+ "69420",
+ context.getString(R.string.notif_channel_name),
+ NotificationManager.IMPORTANCE_HIGH
+ )
+ val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.createNotificationChannel(notifChannel)
+ }
+ }
+
+ fun displayDownloadNotif(channel: Int, progress:Int, filename: String, context: Context) {
+ val notifBuilder =
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+ Notification.Builder(context, channel.toString()).setChannelId("69420")
+ else
+ Notification.Builder(context).setPriority(Notification.PRIORITY_HIGH)
+
+ notifBuilder.apply {
+ setContentTitle(context.getString(R.string.app_name))
+ setContentText(context.getString(R.string.downloading_file, filename))
+ setSmallIcon(R.drawable.ic_stat_name)
+ setOnlyAlertOnce(true)
+ setOngoing(true)
+ }
+
+ val notif = notifBuilder.build()
+ val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.apply {
+ notifBuilder.setProgress(100, progress, false)
+ notify(channel, notif)
+ }
+
+ }
+
+ fun createBasicNotif(text: String, channel: Int, context: Context) {
+ val notifBuilder =
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+ Notification.Builder(context, channel.toString()).setChannelId("69420")
+ else
+ Notification.Builder(context).setPriority(Notification.PRIORITY_DEFAULT)
+
+ notifBuilder.apply {
+ setContentTitle(context.getString(R.string.app_name))
+ setContentText(text)
+ setSmallIcon(R.drawable.ic_stat_name)
+ }
+
+ val notif = notifBuilder.build()
+ val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.notify(channel, notif)
+ }
+
+ fun cancelNotif(id: Int, context: Context) {
+ val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.cancel(id)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt b/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt
new file mode 100644
index 0000000000..286034f871
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt
@@ -0,0 +1,58 @@
+package com.vanced.manager.utils
+
+import android.app.Activity
+import android.app.PendingIntent
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageInstaller.SessionParams
+import android.content.pm.PackageManager
+import com.vanced.manager.core.installer.AppInstallerService
+import com.vanced.manager.core.installer.AppUninstallerService
+import java.io.FileInputStream
+import java.io.IOException
+import java.io.InputStream
+
+object PackageHelper {
+
+ fun isPackageInstalled(packageName: String, packageManager: PackageManager): Boolean {
+ return try {
+ packageManager.getPackageInfo(packageName, 0)
+ true
+ } catch (e: PackageManager.NameNotFoundException) {
+ false
+ }
+ }
+
+ @Throws(IOException::class)
+ fun installApp(
+ context: Context,
+ path: String,
+ pkg: String?
+ ) {
+ val callbackIntent = Intent(context.applicationContext, AppInstallerService::class.java)
+ val pendingIntent = PendingIntent.getService(context.applicationContext, 0, callbackIntent, 0)
+ val packageInstaller = context.packageManager.packageInstaller
+ val params = SessionParams(SessionParams.MODE_FULL_INSTALL)
+ params.setAppPackageName(pkg)
+ val sessionId = packageInstaller.createSession(params)
+ val session = packageInstaller.openSession(sessionId)
+ val inputStream: InputStream = FileInputStream(path)
+ val outputStream = session.openWrite("install", 0, -1)
+ val buffer = ByteArray(65536)
+ var c: Int
+ while (inputStream.read(buffer).also { c = it } != -1) {
+ outputStream.write(buffer, 0, c)
+ }
+ session.fsync(outputStream)
+ inputStream.close()
+ outputStream.close()
+ session.commit(pendingIntent.intentSender)
+ }
+
+ fun uninstallApk(pkg: String, activity: Activity) {
+ val callbackIntent = Intent(activity.applicationContext, AppUninstallerService::class.java)
+ callbackIntent.putExtra("pkg", pkg)
+ val pendingIntent = PendingIntent.getService(activity.applicationContext, 0, callbackIntent, 0)
+ activity.packageManager.packageInstaller.uninstall(pkg, pendingIntent.intentSender)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/vanced/manager/utils/ThemeHelper.kt b/app/src/main/java/com/vanced/manager/utils/ThemeHelper.kt
new file mode 100644
index 0000000000..a9449a52a2
--- /dev/null
+++ b/app/src/main/java/com/vanced/manager/utils/ThemeHelper.kt
@@ -0,0 +1,48 @@
+package com.vanced.manager.utils
+
+import android.content.res.Configuration
+import androidx.preference.PreferenceManager
+import com.vanced.manager.R
+import com.vanced.manager.ui.MainActivity
+
+object ThemeHelper {
+
+ fun setFinalTheme(activity: MainActivity) {
+ val currentAccent = PreferenceManager.getDefaultSharedPreferences(activity).getString("accent_color", "Blue")
+ when (PreferenceManager.getDefaultSharedPreferences(activity)
+ .getString("theme_mode", "Follow System")) {
+ "Light" -> activity.setTheme(getLightAccent(currentAccent))
+ "Dark" -> activity.setTheme(getDarkAccent(currentAccent))
+ "Follow System" -> {
+ when (activity.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
+ Configuration.UI_MODE_NIGHT_YES -> activity.setTheme(getDarkAccent(currentAccent))
+ Configuration.UI_MODE_NIGHT_NO -> activity.setTheme(getLightAccent(currentAccent))
+ }
+ }
+ else -> getLightAccent("Blue")
+ }
+ }
+
+ private fun getDarkAccent(accentColor: String?): Int {
+ return when (accentColor) {
+ "Blue" -> R.style.DarkTheme_Blue
+ "Red" -> R.style.DarkTheme_Red
+ "Green" -> R.style.DarkTheme_Green
+ "Yellow" -> R.style.DarkTheme_Yellow
+ "Purple" -> R.style.DarkTheme_Purple
+ else -> R.style.DarkTheme_Blue
+ }
+ }
+
+ private fun getLightAccent(accentColor: String?): Int {
+ return when (accentColor) {
+ "Blue" -> R.style.LightTheme_Blue
+ "Red" -> R.style.LightTheme_Red
+ "Green" -> R.style.LightTheme_Green
+ "Yellow" -> R.style.LightTheme_Yellow
+ "Purple" -> R.style.LightTheme_Purple
+ else -> R.style.LightTheme_Blue
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/main.iml b/app/src/main/main.iml
new file mode 100644
index 0000000000..aa1ec54f35
--- /dev/null
+++ b/app/src/main/main.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_in_left.xml b/app/src/main/res/anim/slide_in_left.xml
new file mode 100644
index 0000000000..8eafdbfbf3
--- /dev/null
+++ b/app/src/main/res/anim/slide_in_left.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_in_right.xml b/app/src/main/res/anim/slide_in_right.xml
new file mode 100644
index 0000000000..e55110ffb2
--- /dev/null
+++ b/app/src/main/res/anim/slide_in_right.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_out_left.xml b/app/src/main/res/anim/slide_out_left.xml
new file mode 100644
index 0000000000..3cef665caf
--- /dev/null
+++ b/app/src/main/res/anim/slide_out_left.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_out_right.xml b/app/src/main/res/anim/slide_out_right.xml
new file mode 100644
index 0000000000..190a3beab2
--- /dev/null
+++ b/app/src/main/res/anim/slide_out_right.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_enter.xml b/app/src/main/res/animator/fragment_enter.xml
new file mode 100644
index 0000000000..ba067693f7
--- /dev/null
+++ b/app/src/main/res/animator/fragment_enter.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_enter_left.xml b/app/src/main/res/animator/fragment_enter_left.xml
new file mode 100644
index 0000000000..0be430f046
--- /dev/null
+++ b/app/src/main/res/animator/fragment_enter_left.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_enter_pop.xml b/app/src/main/res/animator/fragment_enter_pop.xml
new file mode 100644
index 0000000000..b917fae4c0
--- /dev/null
+++ b/app/src/main/res/animator/fragment_enter_pop.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_enter_right.xml b/app/src/main/res/animator/fragment_enter_right.xml
new file mode 100644
index 0000000000..85e54d4840
--- /dev/null
+++ b/app/src/main/res/animator/fragment_enter_right.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_exit.xml b/app/src/main/res/animator/fragment_exit.xml
new file mode 100644
index 0000000000..01d6f8e231
--- /dev/null
+++ b/app/src/main/res/animator/fragment_exit.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_exit_left.xml b/app/src/main/res/animator/fragment_exit_left.xml
new file mode 100644
index 0000000000..14c6b17cac
--- /dev/null
+++ b/app/src/main/res/animator/fragment_exit_left.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_exit_pop.xml b/app/src/main/res/animator/fragment_exit_pop.xml
new file mode 100644
index 0000000000..3d341c5601
--- /dev/null
+++ b/app/src/main/res/animator/fragment_exit_pop.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fragment_exit_right.xml b/app/src/main/res/animator/fragment_exit_right.xml
new file mode 100644
index 0000000000..7e5bc2185d
--- /dev/null
+++ b/app/src/main/res/animator/fragment_exit_right.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_name.xml b/app/src/main/res/drawable-anydpi-v24/ic_stat_name.xml
new file mode 100644
index 0000000000..25883e27df
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi-v24/ic_stat_name.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable-hdpi/ic_stat_name.png b/app/src/main/res/drawable-hdpi/ic_stat_name.png
new file mode 100644
index 0000000000..ba6a09a54f
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_stat_name.png differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_18.png b/app/src/main/res/drawable-hdpi/outline_cloud_done_black_18.png
deleted file mode 100755
index 57d9bd3b3d..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_24.png b/app/src/main/res/drawable-hdpi/outline_cloud_done_black_24.png
deleted file mode 100755
index f738fee22b..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_36.png b/app/src/main/res/drawable-hdpi/outline_cloud_done_black_36.png
deleted file mode 100755
index 1f75d7194d..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_48.png b/app/src/main/res/drawable-hdpi/outline_cloud_done_black_48.png
deleted file mode 100755
index 0947b249e3..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_done_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_18.png b/app/src/main/res/drawable-hdpi/outline_cloud_download_black_18.png
deleted file mode 100755
index 0c338e28fd..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_24.png b/app/src/main/res/drawable-hdpi/outline_cloud_download_black_24.png
deleted file mode 100755
index 0c071888e1..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_36.png b/app/src/main/res/drawable-hdpi/outline_cloud_download_black_36.png
deleted file mode 100755
index 11cc7951ed..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_48.png b/app/src/main/res/drawable-hdpi/outline_cloud_download_black_48.png
deleted file mode 100755
index 8ba0daeda1..0000000000
Binary files a/app/src/main/res/drawable-hdpi/outline_cloud_download_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_stat_name.png b/app/src/main/res/drawable-mdpi/ic_stat_name.png
new file mode 100644
index 0000000000..d8da8c9705
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_stat_name.png differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_18.png b/app/src/main/res/drawable-mdpi/outline_cloud_done_black_18.png
deleted file mode 100755
index da57c5d022..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_24.png b/app/src/main/res/drawable-mdpi/outline_cloud_done_black_24.png
deleted file mode 100755
index ee79a8a3e1..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_36.png b/app/src/main/res/drawable-mdpi/outline_cloud_done_black_36.png
deleted file mode 100755
index f738fee22b..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_48.png b/app/src/main/res/drawable-mdpi/outline_cloud_done_black_48.png
deleted file mode 100755
index 371017e5ad..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_done_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_18.png b/app/src/main/res/drawable-mdpi/outline_cloud_download_black_18.png
deleted file mode 100755
index dd17ce5307..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_24.png b/app/src/main/res/drawable-mdpi/outline_cloud_download_black_24.png
deleted file mode 100755
index b67ec52380..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_36.png b/app/src/main/res/drawable-mdpi/outline_cloud_download_black_36.png
deleted file mode 100755
index 0c071888e1..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_48.png b/app/src/main/res/drawable-mdpi/outline_cloud_download_black_48.png
deleted file mode 100755
index d7014d31f3..0000000000
Binary files a/app/src/main/res/drawable-mdpi/outline_cloud_download_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-nodpi/splash192.png b/app/src/main/res/drawable-nodpi/splash192.png
new file mode 100755
index 0000000000..e3da6cacb7
Binary files /dev/null and b/app/src/main/res/drawable-nodpi/splash192.png differ
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000000..b615627b30
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_name.png b/app/src/main/res/drawable-xhdpi/ic_stat_name.png
new file mode 100644
index 0000000000..c0052b785a
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_stat_name.png differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_18.png b/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_18.png
deleted file mode 100755
index f738fee22b..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_24.png b/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_24.png
deleted file mode 100755
index 371017e5ad..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_36.png b/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_36.png
deleted file mode 100755
index 0947b249e3..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_48.png b/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_48.png
deleted file mode 100755
index 4482b73350..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_done_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_18.png b/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_18.png
deleted file mode 100755
index 0c071888e1..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_24.png b/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_24.png
deleted file mode 100755
index d7014d31f3..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_36.png b/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_36.png
deleted file mode 100755
index 8ba0daeda1..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_48.png b/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_48.png
deleted file mode 100755
index a5badc0a34..0000000000
Binary files a/app/src/main/res/drawable-xhdpi/outline_cloud_download_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_name.png b/app/src/main/res/drawable-xxhdpi/ic_stat_name.png
new file mode 100644
index 0000000000..456ea26660
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_stat_name.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_18.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_18.png
deleted file mode 100755
index 1f75d7194d..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_24.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_24.png
deleted file mode 100755
index 0947b249e3..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_36.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_36.png
deleted file mode 100755
index 888e47c0aa..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_48.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_48.png
deleted file mode 100755
index 8c133516d3..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_done_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_18.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_18.png
deleted file mode 100755
index 11cc7951ed..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_24.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_24.png
deleted file mode 100755
index 8ba0daeda1..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_36.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_36.png
deleted file mode 100755
index 0017883d60..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_48.png b/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_48.png
deleted file mode 100755
index 8d7e128ccb..0000000000
Binary files a/app/src/main/res/drawable-xxhdpi/outline_cloud_download_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_18.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_18.png
deleted file mode 100755
index 0947b249e3..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_24.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_24.png
deleted file mode 100755
index 4482b73350..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_36.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_36.png
deleted file mode 100755
index 8c133516d3..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_48.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_48.png
deleted file mode 100755
index 4e29b725d1..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_done_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_18.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_18.png
deleted file mode 100755
index 8ba0daeda1..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_18.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_24.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_24.png
deleted file mode 100755
index a5badc0a34..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_24.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_36.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_36.png
deleted file mode 100755
index 8d7e128ccb..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_36.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_48.png b/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_48.png
deleted file mode 100755
index 12a1cb234c..0000000000
Binary files a/app/src/main/res/drawable-xxxhdpi/outline_cloud_download_black_48.png and /dev/null differ
diff --git a/app/src/main/res/drawable/Rectangle_9_logo.png b/app/src/main/res/drawable/Rectangle_9_logo.png
deleted file mode 100644
index fda060460d..0000000000
Binary files a/app/src/main/res/drawable/Rectangle_9_logo.png and /dev/null differ
diff --git a/app/src/main/res/drawable/arrow_down.xml b/app/src/main/res/drawable/arrow_down.xml
new file mode 100644
index 0000000000..7c2af79724
--- /dev/null
+++ b/app/src/main/res/drawable/arrow_down.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/brave_panel_bg.xml b/app/src/main/res/drawable/brave_panel_bg.xml
deleted file mode 100755
index c62f68d78b..0000000000
--- a/app/src/main/res/drawable/brave_panel_bg.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/discord.xml b/app/src/main/res/drawable/discord.xml
new file mode 100644
index 0000000000..dd5e6e2c31
--- /dev/null
+++ b/app/src/main/res/drawable/discord.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/github.xml b/app/src/main/res/drawable/github.xml
new file mode 100644
index 0000000000..b0b7f3ec22
--- /dev/null
+++ b/app/src/main/res/drawable/github.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_brave_logo.xml b/app/src/main/res/drawable/ic_brave_logo.xml
new file mode 100644
index 0000000000..7cc645f868
--- /dev/null
+++ b/app/src/main/res/drawable/ic_brave_logo.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_brush_black_24dp.xml b/app/src/main/res/drawable/ic_brush_black_24dp.xml
new file mode 100644
index 0000000000..d0894aa39d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_brush_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_cloud_download.xml b/app/src/main/res/drawable/ic_cloud_download.xml
deleted file mode 100755
index 587d3603da..0000000000
--- a/app/src/main/res/drawable/ic_cloud_download.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/ic_cloud_upload_black_24dp.xml b/app/src/main/res/drawable/ic_cloud_upload_black_24dp.xml
new file mode 100644
index 0000000000..a9a042ade8
--- /dev/null
+++ b/app/src/main/res/drawable/ic_cloud_upload_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml
deleted file mode 100755
index 46fc8deec3..0000000000
--- a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_delete_black_24dp.xml b/app/src/main/res/drawable/ic_delete_black_24dp.xml
new file mode 100644
index 0000000000..1a19dd1b02
--- /dev/null
+++ b/app/src/main/res/drawable/ic_delete_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_discord.xml b/app/src/main/res/drawable/ic_discord.xml
deleted file mode 100755
index ee8ab7d9cf..0000000000
--- a/app/src/main/res/drawable/ic_discord.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_done.xml b/app/src/main/res/drawable/ic_done.xml
new file mode 100644
index 0000000000..f2528cb609
--- /dev/null
+++ b/app/src/main/res/drawable/ic_done.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_done_black_24dp.xml b/app/src/main/res/drawable/ic_done_black_24dp.xml
new file mode 100644
index 0000000000..7affe9ba9f
--- /dev/null
+++ b/app/src/main/res/drawable/ic_done_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_download.xml b/app/src/main/res/drawable/ic_download.xml
new file mode 100644
index 0000000000..0feb270af4
--- /dev/null
+++ b/app/src/main/res/drawable/ic_download.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml
deleted file mode 100755
index 633987d0f7..0000000000
--- a/app/src/main/res/drawable/ic_github.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml
deleted file mode 100755
index f8bb0b5563..0000000000
--- a/app/src/main/res/drawable/ic_home_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_info_black_24dp.xml b/app/src/main/res/drawable/ic_info_black_24dp.xml
new file mode 100644
index 0000000000..44ff6b4a45
--- /dev/null
+++ b/app/src/main/res/drawable/ic_info_black_24dp.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_keyboard_backspace_black_24dp.xml b/app/src/main/res/drawable/ic_keyboard_backspace_black_24dp.xml
new file mode 100644
index 0000000000..a5d1965156
--- /dev/null
+++ b/app/src/main/res/drawable/ic_keyboard_backspace_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_keyboard_next.xml b/app/src/main/res/drawable/ic_keyboard_next.xml
new file mode 100644
index 0000000000..2d24220579
--- /dev/null
+++ b/app/src/main/res/drawable/ic_keyboard_next.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
deleted file mode 100755
index 07d5da9cbf..0000000000
--- a/app/src/main/res/drawable/ic_launcher_background.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml
deleted file mode 100755
index 2b068d1146..0000000000
--- a/app/src/main/res/drawable/ic_launcher_foreground.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_microg.xml b/app/src/main/res/drawable/ic_microg.xml
old mode 100755
new mode 100644
index cd7a6d84ad..0a035ea148
--- a/app/src/main/res/drawable/ic_microg.xml
+++ b/app/src/main/res/drawable/ic_microg.xml
@@ -1,14 +1,18 @@
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_microg_settings.xml b/app/src/main/res/drawable/ic_microg_settings.xml
new file mode 100644
index 0000000000..d4851e317f
--- /dev/null
+++ b/app/src/main/res/drawable/ic_microg_settings.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml
index 78b75c39b5..2f0d1ff096 100755
--- a/app/src/main/res/drawable/ic_notifications_black_24dp.xml
+++ b/app/src/main/res/drawable/ic_notifications_black_24dp.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
diff --git a/app/src/main/res/drawable/ic_palette_black_24dp.xml b/app/src/main/res/drawable/ic_palette_black_24dp.xml
new file mode 100644
index 0000000000..b1dfdbc785
--- /dev/null
+++ b/app/src/main/res/drawable/ic_palette_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_reddit.xml b/app/src/main/res/drawable/ic_reddit.xml
index 0a047886a5..3f13cf722b 100755
--- a/app/src/main/res/drawable/ic_reddit.xml
+++ b/app/src/main/res/drawable/ic_reddit.xml
@@ -1,18 +1,9 @@
-
-
-
-
-
+
+
diff --git a/app/src/main/res/drawable/ic_secret_settings_black_24dp.xml b/app/src/main/res/drawable/ic_secret_settings_black_24dp.xml
new file mode 100644
index 0000000000..291e24eeff
--- /dev/null
+++ b/app/src/main/res/drawable/ic_secret_settings_black_24dp.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_security_black_24dp.xml b/app/src/main/res/drawable/ic_security_black_24dp.xml
new file mode 100644
index 0000000000..f3598aef42
--- /dev/null
+++ b/app/src/main/res/drawable/ic_security_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml
deleted file mode 100755
index d45c12c358..0000000000
--- a/app/src/main/res/drawable/ic_settings.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_settings_black_24dp.xml b/app/src/main/res/drawable/ic_settings_black_24dp.xml
new file mode 100644
index 0000000000..661d05f8da
--- /dev/null
+++ b/app/src/main/res/drawable/ic_settings_black_24dp.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_shortcut_info.xml b/app/src/main/res/drawable/ic_shortcut_info.xml
new file mode 100644
index 0000000000..17d70fcf6e
--- /dev/null
+++ b/app/src/main/res/drawable/ic_shortcut_info.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_shortcut_settings.xml b/app/src/main/res/drawable/ic_shortcut_settings.xml
new file mode 100644
index 0000000000..48beb04173
--- /dev/null
+++ b/app/src/main/res/drawable/ic_shortcut_settings.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_telegram.xml b/app/src/main/res/drawable/ic_telegram.xml
deleted file mode 100755
index 1dae8ebb71..0000000000
--- a/app/src/main/res/drawable/ic_telegram.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_update.xml b/app/src/main/res/drawable/ic_update.xml
new file mode 100644
index 0000000000..55dbbae85c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_update.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_vanced.xml b/app/src/main/res/drawable/ic_vanced.xml
new file mode 100644
index 0000000000..aac7766169
--- /dev/null
+++ b/app/src/main/res/drawable/ic_vanced.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_vanced1.xml b/app/src/main/res/drawable/ic_vanced1.xml
deleted file mode 100755
index ed54d3f60a..0000000000
--- a/app/src/main/res/drawable/ic_vanced1.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-w:defaultTabStop w:val="720"/> <vector xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:aapt= "http://schemas.android.com/aapt" android:width= "36.2dp" android:height= "27.52dp" android:viewportWidth= "36.2" android:viewportHeight= "27.52" > <group> <clip-path android:pathData= "M0 0H36.2038V27.5192H0V0Z" /> <group android:translateX= "-0.254" android:translateY= "0.5" android:pivotX= "18.102" android:pivotY= "13.76" android:scaleX= "2.131" android:scaleY= "2.804" android:rotation= "-45" > <path android:pathData= "M0 0V27.5192H36.2038V0" > <aapt:attr name= "android:fillColor" > <gradient android:type= "linear" android:startX= "9.051" android:startY= "13.76" android:endX= "27.153" android:endY= "13.76" > <item android:color= "#2E73FF" android:offset= "0" /> <item android:color= "#FF0032" android:offset= "1" /> </gradient> </aapt:attr> </path> </group> </group> </vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_vanced2.xml b/app/src/main/res/drawable/ic_vanced2.xml
deleted file mode 100755
index 2073a6e460..0000000000
--- a/app/src/main/res/drawable/ic_vanced2.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-w:defaultTabStop w:val="720"/> <vector xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:aapt= "http://schemas.android.com/aapt" android:width= "9.52dp" android:height= "12.71dp" android:viewportWidth= "9.52" android:viewportHeight= "12.71" > <group> <clip-path android:pathData= "M0 0H9.52077V12.7096H0V0Z" /> <path android:pathData= "M0 0V12.7096H9.52077V0" android:fillColor= "#FFFFFF" /> </group> </vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_vanced3.xml b/app/src/main/res/drawable/ic_vanced3.xml
deleted file mode 100755
index c705eb506c..0000000000
--- a/app/src/main/res/drawable/ic_vanced3.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-w:defaultTabStop w:val="720"/> <vector xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:aapt= "http://schemas.android.com/aapt" android:width= "5.25dp" android:height= "5.74dp" android:viewportWidth= "5.25" android:viewportHeight= "5.74" > <group> <clip-path android:pathData= "M0 0H5.25417V5.73504H0V0Z" /> <group android:translateX= "704.62" android:translateY= "999.995" android:pivotX= "2.627" android:pivotY= "2.868" android:scaleX= "565.417" android:scaleY= "565.417" android:rotation= "-44.999" > <path android:pathData= "M0 0V5.73504H5.25417V0" > <aapt:attr name= "android:fillColor" > <gradient android:type= "linear" android:startX= "1.314" android:startY= "2.868" android:endX= "3.941" android:endY= "2.868" > <item android:color= "#2E73FF" android:offset= "0" /> <item android:color= "#FF0032" android:offset= "1" /> </gradient> </aapt:attr> </path> </group> </group> </vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_vanced_nobg.xml b/app/src/main/res/drawable/ic_vanced_nobg.xml
new file mode 100644
index 0000000000..beea9b7c5b
--- /dev/null
+++ b/app/src/main/res/drawable/ic_vanced_nobg.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/rectangle_1.xml b/app/src/main/res/drawable/rectangle_1.xml
deleted file mode 100755
index 338fb99c56..0000000000
--- a/app/src/main/res/drawable/rectangle_1.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_2.xml b/app/src/main/res/drawable/rectangle_2.xml
old mode 100755
new mode 100644
index 813ac8c2f9..49074b1798
--- a/app/src/main/res/drawable/rectangle_2.xml
+++ b/app/src/main/res/drawable/rectangle_2.xml
@@ -1,50 +1,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:shape="rectangle">
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rectangle_3.xml b/app/src/main/res/drawable/rectangle_3.xml
deleted file mode 100755
index 529869b618..0000000000
--- a/app/src/main/res/drawable/rectangle_3.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_4.xml b/app/src/main/res/drawable/rectangle_4.xml
deleted file mode 100755
index 6f3acb5148..0000000000
--- a/app/src/main/res/drawable/rectangle_4.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_5.xml b/app/src/main/res/drawable/rectangle_5.xml
deleted file mode 100755
index 11b30af8e9..0000000000
--- a/app/src/main/res/drawable/rectangle_5.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rectangle_6.xml b/app/src/main/res/drawable/rectangle_6.xml
deleted file mode 100755
index e72d3e60a2..0000000000
--- a/app/src/main/res/drawable/rectangle_6.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_7.xml b/app/src/main/res/drawable/rectangle_7.xml
deleted file mode 100755
index e50f52d252..0000000000
--- a/app/src/main/res/drawable/rectangle_7.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_8.xml b/app/src/main/res/drawable/rectangle_8.xml
deleted file mode 100755
index 02905ba52c..0000000000
--- a/app/src/main/res/drawable/rectangle_8.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_9.xml b/app/src/main/res/drawable/rectangle_9.xml
deleted file mode 100755
index e2ca1e5e28..0000000000
--- a/app/src/main/res/drawable/rectangle_9.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rectangle_9_logo.png b/app/src/main/res/drawable/rectangle_9_logo.png
deleted file mode 100755
index fda060460d..0000000000
Binary files a/app/src/main/res/drawable/rectangle_9_logo.png and /dev/null differ
diff --git a/app/src/main/res/drawable/site_panel_bg.xml b/app/src/main/res/drawable/site_panel_bg.xml
deleted file mode 100755
index 8e22373efd..0000000000
--- a/app/src/main/res/drawable/site_panel_bg.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-w:defaultTabStop w:val="720"/> <vector xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:aapt= "http://schemas.android.com/aapt" android:width= "30dp" android:height= "28dp" android:viewportWidth= "30" android:viewportHeight= "28" > <group> <clip-path android:pathData= "M0 0H30V28H0V0Z" /> <path android:pathData= "M0 0V28H30V0" android:fillColor= "#FFFFFF" /> </group> </vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/splash_logo.xml b/app/src/main/res/drawable/splash_logo.xml
new file mode 100644
index 0000000000..7415134a84
--- /dev/null
+++ b/app/src/main/res/drawable/splash_logo.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+ -
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/telegram.xml b/app/src/main/res/drawable/telegram.xml
new file mode 100644
index 0000000000..e2c7cbe703
--- /dev/null
+++ b/app/src/main/res/drawable/telegram.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/twitter.xml b/app/src/main/res/drawable/twitter.xml
new file mode 100644
index 0000000000..ff9fc30069
--- /dev/null
+++ b/app/src/main/res/drawable/twitter.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/vectordiscord.png b/app/src/main/res/drawable/vectordiscord.png
deleted file mode 100755
index 8820ee7d07..0000000000
Binary files a/app/src/main/res/drawable/vectordiscord.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorgithub.png b/app/src/main/res/drawable/vectorgithub.png
deleted file mode 100755
index 26b26d7f2b..0000000000
Binary files a/app/src/main/res/drawable/vectorgithub.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorlogo.png b/app/src/main/res/drawable/vectorlogo.png
deleted file mode 100755
index 4ccd8ec8b9..0000000000
Binary files a/app/src/main/res/drawable/vectorlogo.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorlogo1.png b/app/src/main/res/drawable/vectorlogo1.png
deleted file mode 100755
index 220b65d591..0000000000
Binary files a/app/src/main/res/drawable/vectorlogo1.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorlogo2.png b/app/src/main/res/drawable/vectorlogo2.png
deleted file mode 100755
index 83a04c34d3..0000000000
Binary files a/app/src/main/res/drawable/vectorlogo2.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorsetting_icon.png b/app/src/main/res/drawable/vectorsetting_icon.png
deleted file mode 100755
index ccaa98406d..0000000000
Binary files a/app/src/main/res/drawable/vectorsetting_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectorsettings_icon.png b/app/src/main/res/drawable/vectorsettings_icon.png
deleted file mode 100755
index 552807d1d8..0000000000
Binary files a/app/src/main/res/drawable/vectorsettings_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectortelegram.png b/app/src/main/res/drawable/vectortelegram.png
deleted file mode 100755
index 3f1b300fae..0000000000
Binary files a/app/src/main/res/drawable/vectortelegram.png and /dev/null differ
diff --git a/app/src/main/res/drawable/vectortwitter.png b/app/src/main/res/drawable/vectortwitter.png
deleted file mode 100755
index 3676898e00..0000000000
Binary files a/app/src/main/res/drawable/vectortwitter.png and /dev/null differ
diff --git a/app/src/main/res/font/exo.xml b/app/src/main/res/font/exo.xml
new file mode 100644
index 0000000000..b9ebbb9a3e
--- /dev/null
+++ b/app/src/main/res/font/exo.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/app/src/main/res/font/exo_2.xml b/app/src/main/res/font/exo_2.xml
new file mode 100644
index 0000000000..fd70fdcaf3
--- /dev/null
+++ b/app/src/main/res/font/exo_2.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/app/src/main/res/font/exo_2_bold.xml b/app/src/main/res/font/exo_2_bold.xml
new file mode 100644
index 0000000000..eea27a5365
--- /dev/null
+++ b/app/src/main/res/font/exo_2_bold.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 154bc6c292..704b46cc11 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,167 +1,39 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml
new file mode 100644
index 0000000000..8a4ede8dd7
--- /dev/null
+++ b/app/src/main/res/layout/fragment_about.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_chosen_preferences.xml b/app/src/main/res/layout/fragment_chosen_preferences.xml
new file mode 100644
index 0000000000..567aa7b29d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_chosen_preferences.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_custom_url.xml b/app/src/main/res/layout/fragment_custom_url.xml
new file mode 100644
index 0000000000..06609b19ff
--- /dev/null
+++ b/app/src/main/res/layout/fragment_custom_url.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml
deleted file mode 100644
index 166ab0e9e6..0000000000
--- a/app/src/main/res/layout/fragment_dashboard.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index f3d9b08ffe..50f6267317 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -1,22 +1,130 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+ android:layout_height="match_parent"
+ android:fillViewport="true"
+ android:animateLayoutChanges="true"
+ android:scrollbars="none">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_manager_changelog.xml b/app/src/main/res/layout/fragment_manager_changelog.xml
new file mode 100644
index 0000000000..a8caa605c3
--- /dev/null
+++ b/app/src/main/res/layout/fragment_manager_changelog.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_microg_changelog.xml b/app/src/main/res/layout/fragment_microg_changelog.xml
new file mode 100644
index 0000000000..8b7ccc7507
--- /dev/null
+++ b/app/src/main/res/layout/fragment_microg_changelog.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_notifications.xml b/app/src/main/res/layout/fragment_notifications.xml
deleted file mode 100644
index d41793572b..0000000000
--- a/app/src/main/res/layout/fragment_notifications.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_update_check.xml b/app/src/main/res/layout/fragment_update_check.xml
new file mode 100644
index 0000000000..1f9d81d330
--- /dev/null
+++ b/app/src/main/res/layout/fragment_update_check.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_vanced_changelog.xml b/app/src/main/res/layout/fragment_vanced_changelog.xml
new file mode 100644
index 0000000000..5e2f0e7bbe
--- /dev/null
+++ b/app/src/main/res/layout/fragment_vanced_changelog.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_vanced_language_selection.xml b/app/src/main/res/layout/fragment_vanced_language_selection.xml
new file mode 100644
index 0000000000..162b991163
--- /dev/null
+++ b/app/src/main/res/layout/fragment_vanced_language_selection.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_vanced_theme_selection.xml b/app/src/main/res/layout/fragment_vanced_theme_selection.xml
new file mode 100644
index 0000000000..e4bdf0a4cd
--- /dev/null
+++ b/app/src/main/res/layout/fragment_vanced_theme_selection.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_about_app_devs.xml b/app/src/main/res/layout/include_about_app_devs.xml
new file mode 100644
index 0000000000..abfac5c60d
--- /dev/null
+++ b/app/src/main/res/layout/include_about_app_devs.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_about_header.xml b/app/src/main/res/layout/include_about_header.xml
new file mode 100644
index 0000000000..73db7ddd88
--- /dev/null
+++ b/app/src/main/res/layout/include_about_header.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_about_sources.xml b/app/src/main/res/layout/include_about_sources.xml
new file mode 100644
index 0000000000..c316339569
--- /dev/null
+++ b/app/src/main/res/layout/include_about_sources.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/include_about_vanced_devs.xml b/app/src/main/res/layout/include_about_vanced_devs.xml
new file mode 100644
index 0000000000..acfc1c66ed
--- /dev/null
+++ b/app/src/main/res/layout/include_about_vanced_devs.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_changelogs.xml b/app/src/main/res/layout/include_changelogs.xml
new file mode 100644
index 0000000000..abe70c361a
--- /dev/null
+++ b/app/src/main/res/layout/include_changelogs.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/include_language_scrollview.xml b/app/src/main/res/layout/include_language_scrollview.xml
new file mode 100644
index 0000000000..d22d5207b8
--- /dev/null
+++ b/app/src/main/res/layout/include_language_scrollview.xml
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_microg.xml b/app/src/main/res/layout/include_microg.xml
new file mode 100644
index 0000000000..2d8db20c59
--- /dev/null
+++ b/app/src/main/res/layout/include_microg.xml
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/include_useful_links.xml b/app/src/main/res/layout/include_useful_links.xml
new file mode 100644
index 0000000000..6d4f96cee2
--- /dev/null
+++ b/app/src/main/res/layout/include_useful_links.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/include_vanced.xml b/app/src/main/res/layout/include_vanced.xml
new file mode 100644
index 0000000000..aab747aeef
--- /dev/null
+++ b/app/src/main/res/layout/include_vanced.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/include_vanced_medias.xml b/app/src/main/res/layout/include_vanced_medias.xml
new file mode 100644
index 0000000000..d2d6d75bd3
--- /dev/null
+++ b/app/src/main/res/layout/include_vanced_medias.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml
deleted file mode 100644
index 7461e53571..0000000000
--- a/app/src/main/res/menu/bottom_nav_menu.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/menu/dev_settings_menu.xml b/app/src/main/res/menu/dev_settings_menu.xml
new file mode 100644
index 0000000000..fd7e6f4555
--- /dev/null
+++ b/app/src/main/res/menu/dev_settings_menu.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/secret_settings_menu.xml b/app/src/main/res/menu/secret_settings_menu.xml
new file mode 100644
index 0000000000..fff8ad0cae
--- /dev/null
+++ b/app/src/main/res/menu/secret_settings_menu.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/toolbar_menu.xml b/app/src/main/res/menu/toolbar_menu.xml
new file mode 100644
index 0000000000..6e6e7a8b0e
--- /dev/null
+++ b/app/src/main/res/menu/toolbar_menu.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index eca70cfe52..7353dbd1fd 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index eca70cfe52..7353dbd1fd 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
index a571e60098..3ef1528b8f 100644
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
index 61da551c55..ea87585479 100644
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
index c41dd28531..6d05340258 100644
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
index db5080a752..1d31144aa8 100644
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
index 6dba46dab1..56bf62ec97 100644
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
index da31a871c8..ac94c10dc8 100644
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
index 15ac681720..2d04101b7e 100644
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
index b216f2d313..b705e4ebfc 100644
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index f25a419744..0fcb7c135a 100644
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
index e96783ccce..b56f24c903 100644
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml
index 679a381535..408e1f08a2 100644
--- a/app/src/main/res/navigation/mobile_navigation.xml
+++ b/app/src/main/res/navigation/mobile_navigation.xml
@@ -1,14 +1,116 @@
-
+ app:startDestination="@id/home_fragment">
+ tools:layout="@layout/fragment_home">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
new file mode 100755
index 0000000000..6d9b6cf565
--- /dev/null
+++ b/app/src/main/res/values-ar/strings.xml
@@ -0,0 +1,64 @@
+
+
+
+
+ اغلق
+ "عناصر ناأبة
+"
+ مرحبا
+اهلا
+
+
+ "معاومات
+"
+ بيت
+ تثبيت
+ اعادات
+
+
+ "معلومات التغير "
+ تثبيت
+ مثبتة
+ آخر:
+ جار التحميل…
+ اتصاا الشبكة غير متاح
+ تحديث
+ روابط المفيدة
+ Vanced على توصيل اجتماعي فانسد على توصيل اجتماعي
+ الموقع رسمي لفانسد
+ ادعمنا بتريق تنزيل بريف
+
+
+ الوان
+ اختر افضل لون
+ ازرق
+ اخضر
+ احمر
+ اصفر
+ تحقق من وجود تحديثات
+ واجهة استغدام
+ مدير
+ موضوع اللون
+ اتبع النظام
+ الموضوع الاسود
+ موضوع الابيض
+ اختر الموضوع المفضلة
+ تنبيات
+ تجيب اشعارات عند اصدار تحديث
+ اعادة التحقق
+ مركز التحديث
+
+
+ اختر اللغة المفضلة لفانسد
+ لاحظة: اذا قمت تثبيت بأي لغة غير الانجليزية، سيكون اللغة الانجليزية مثبتة بللغة اضافية
+ اختر موضوع اللون المفضلة لفانسد
+ نهاية
+ ابيض + اسود
+ ابيض + داكن
+ ثانية
+
+
+ مدير مطورين
+ مصادر
+ فريق فانسد
+
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
new file mode 100644
index 0000000000..dfc9e3933b
--- /dev/null
+++ b/app/src/main/res/values-fr/strings.xml
@@ -0,0 +1,62 @@
+
+
+
+
+ Fermer
+ Bienvenue
+
+
+ À propos
+ Accueil
+ Installer
+ Paramètres
+
+
+ Journal des modifications
+ Installer
+ Version installée:
+ Dernière version:
+ Chargement…
+ Connection réseau indisponible
+ Mettre à jour
+ Liens utiles
+ Vanced sur les Résaux Sociaux
+ Le site web officiel de Vanced
+ Supporte nous en téléchargeant Brave
+
+
+ Couleur d\'accentuation
+ Choisis ta couleur d\'accentuation préférée
+ Bleu
+ Vert
+ Rouge
+ Jaune
+ Vérifier les mises à jour
+ Interface
+ Gestion
+ Thème
+ Thème sombre
+ Thème clair
+ Choisis ton thème préféré
+ Notifications
+ Recevoir des notifications quand une nouvelle version est disponible
+ Revérifier
+ Centre de mise à jour
+
+
+ Choisir votre langue préférée pour Vanced
+ Note: si vous installer autre chose que l\'anglais, l\'anglais sera toujours installé en langue additionnelle
+ Choisis le thème de Vanced
+ Terminer
+ Clair + Sombre
+ Clair + Noir
+ Suivant
+
+
+ Dévéloppeurs du Manager
+ Sources
+ Équipe Vanced
+ Assurez-vous d\'avoir téléchargé l\'application sur vanced.app, le serveur Discord de Vanced ou sur le github officiel.
+ Suivre le paramètre système
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
new file mode 100644
index 0000000000..a276c93d24
--- /dev/null
+++ b/app/src/main/res/values-hi/strings.xml
@@ -0,0 +1,12 @@
+
+
+
+ बंद करे
+ कृपया सुनिश्चित करें कि आपने vanced.app, Vanced Discord सर्वर या GitHub से ऐप डाउनलोड किया है
+ स्वागत हे
+
+
+
+
+
+
diff --git a/app/src/main/res/values-ka/strings.xml b/app/src/main/res/values-ka/strings.xml
new file mode 100644
index 0000000000..e3160af94f
--- /dev/null
+++ b/app/src/main/res/values-ka/strings.xml
@@ -0,0 +1,64 @@
+
+
+
+
+ დახურვა
+ გთხოვთ დარწმუნდით რომ აპი გადმოწერეთ vanced.app-იდან, Vanced Discord სერვერიდან ან GitHub-იდან
+ მოგესალმებით
+
+
+ შესახებ
+ საწყისი
+ ინსტალაცია
+ პარამეტრები
+
+
+ ცვლილებები
+ ინსტალაცია
+ დაინსტალირებული:
+ დაინსტალირებულია
+ უახლესი:
+ იტვირთება…
+ კავშირი არ არის
+ ხელმიუწვდომელია
+ განახლება
+ საჭირო ლინკები
+ Vanced სოციალურ ქსელებზე
+ Vanced-ის ოფიციალური ვებსაიტი
+ დაგვიჭირეთ მხარი Brave-ის გადმოწერით
+
+
+ აქცენტის ფერი
+ აირჩიეთ სასურველი აქცენტის ფერი
+ ლურჯი
+ მწვანე
+ წითელი
+ ყვითელი
+ განახლებების შემოწმება
+ ინტერფეისი
+ მენეჯერი
+ თემა
+ სისტემაზე დაფუძნებული
+ მუქი თემა
+ ღია თემა
+ აირჩიეთ სასურველი თემა
+ შეტყობინებები
+ მიიღეთ შეტყობინება როდესაც განახლება გამოვა
+ გადამოწმება
+ განახლების ცენტრი
+
+
+ აირჩიეთ სასურველი ენა Vanced-ისთვის
+ შენიშვნა: თუ თქვენ აირჩევთ სხვა ენას გარდა ინგლისურისა, ინგლისური მაინც იქნება დაყენებული როგორც დამატებითი ენა
+ აირჩიეთ სასურველი თემა Vanced-ისთვის
+ დასრულება
+ ღია + შავი
+ ღია + მუქი
+ შემდეგი
+
+
+ Manager-ის დეველოპერები
+ წყაროები
+ Vanced-ის გუნდი
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml
new file mode 100755
index 0000000000..6d139c0bef
--- /dev/null
+++ b/app/src/main/res/values-pt-rPT/strings.xml
@@ -0,0 +1,61 @@
+
+
+
+
+ Fechar
+ Verifique se você baixou o aplicativo do vanced.app, Vanced Discord ou GitHub
+ Bem-Vindo
+
+
+ Sobre
+ Página Principal
+ Instalar
+ Configurações
+
+
+ Notas de Lançamento
+ Instalar
+ Instalado:
+ Mais Recente:
+ Carregando…
+ Conexão de rede indisponível
+ Atualizar
+ Links Importantes
+ Vanced nas Redes Sociais
+ Site oficial do Vanced
+
+
+
+ Cor de Destaque
+ Escolhe tua cor de destaque preferida
+ Azul
+ Verde
+ Vermelho
+ Amarelo
+ Verificar por Atualizações
+ Interface
+ Gerente
+ Tema
+ Seguir Sistema
+ Tema Escuro
+ Tema Claro
+ Escolhe o teu tema preferido
+ Notificações
+ Receber notificações quando uma actualização estiver disponível
+ Verificar Novamente
+ Centro de Actualizações
+
+
+ Escolhe tua língua preferida para o Vanced
+ Nota: Se você instalar algo diferente de Inglês, Inglês será instalado como um idioma adicional
+ Escolhe teu tema preferido para o Vanced
+ Terminar
+ Claro + Preto
+ Claro + Escuro
+ Próximo
+
+
+ Desenvolvedores Gerentes
+ Fontes
+ Equipa Vanced
+
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
new file mode 100755
index 0000000000..2c726862a0
--- /dev/null
+++ b/app/src/main/res/values-tr/strings.xml
@@ -0,0 +1,61 @@
+
+
+
+
+ Kapat
+ Lütfen, uygulamayı vanced.app\'den, Vanced Discord sunucu\'sundan veya GitHub\'dan indirdiğinize emin olun.
+ Hoşgeldin
+
+
+ Hakkında
+ Ana Sayfa
+ Yüklemek
+ Ayarlar
+
+
+ Değişim Kaydı
+ Yüklemek
+ Yüklendi:
+ En Son:
+ Yükleniyor…
+ Ağ bağlantısı yok
+ Güncellemek
+ Faydalı Bağlantılar
+ Sosyal Medyada Vanced
+ Vanced\'in resmi web sitesi
+ Brave Tarayıcısı\'nı indirerek bizi destekleyebilirsiniz
+
+
+ Tema Rengi
+ Tercih ettiğiniz tema rengini seçin
+ Mavi
+ Yeşil
+ Kırmızı
+ Sarı
+ Güncellemeri denetleyin
+ Arayüz
+ Manager
+ Tema
+ Takip Sistemi
+ Karanlık Tema
+ Aydınlık Tema
+ Tercih ettiğiniz temayı seçin
+ Anlık Bildirimler
+ Yeni güncelleme hazır olduğunda anlık bildirim alın
+ Yeniden kontrol et
+ Güncelleme Merkezi
+
+
+ Vanced için tercih ettiğiniz dili seçin
+ Uyarı: Eğer İngilizceden farklı bir dil yüklerseniz, İngilizce yine de ikinci dil olarak yüklü kalacaktır
+ Vanced için tercih ettiğiniz temayı seçin
+ Bitir
+ Aydınlık + Siyah
+ Aydınlık + Karanlık
+ Sonraki
+
+
+ Manager Yapımcıları
+ Kaynaklar
+ Vanced Ekibi
+
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
new file mode 100755
index 0000000000..f31cbc2e57
--- /dev/null
+++ b/app/src/main/res/values-uk/strings.xml
@@ -0,0 +1,62 @@
+
+
+
+
+ Закрити
+ Будь ласка, переконайтеся,що ви завантажили додаток з vanced.app,Vanced діскорд серверу або з GitHub
+ Ласкаво просимо
+
+
+ Про нас
+ Додому
+ Встановити
+ Налаштування
+
+
+ Список змін
+ Встановити
+ Встановлено:
+ Найновіші:
+ Завантаження…
+ Немає з\'єднання з мережею
+ Оновлення
+ Корисні сторінки
+ Vanced в соціальних мережах
+ Офіційний веб-сайт Vanced
+ Підтримай нас завантаживши браузер Brave
+
+
+ Головний Колір
+ Виберіть ваш улюблений головний колір
+ Синій
+ Зелений
+ Червоний
+ Жовтий
+ Перевірити на оновлення
+ Інтерфейс
+ Менеджер
+ Тема
+ Слідувати системі
+ Темна тема
+ Світла тема
+ Виберіть вашу улюблену тему
+ Спливаючі Сповіщення
+ Отримувати спливаючі сповіщення коли доступна нова версія додатку
+ Перевірити ще раз
+ Центр Оновлень
+
+
+ Виберіть вашу головну мову для Vanced
+ Примітка: Якщо ви встановите що-небудь, крім Англійської, Англійська мова все одно буде встановлена як додаткова мова
+ Виберіть вашу головну тему для Vanced
+ Завершити
+ Світла + Чорна
+ Світла + Темна
+ Наступна
+
+
+ Розробники Менеджера
+ Джерела
+ Команда Vanced
+
+
diff --git a/app/src/main/res/values-v23/themes.xml b/app/src/main/res/values-v23/themes.xml
new file mode 100644
index 0000000000..4659b6f4f1
--- /dev/null
+++ b/app/src/main/res/values-v23/themes.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
new file mode 100644
index 0000000000..12c1a69cfb
--- /dev/null
+++ b/app/src/main/res/values/arrays.xml
@@ -0,0 +1,47 @@
+
+
+
+
+ - @string/theme_light
+ - @string/theme_dark
+ - @string/theme_follow
+
+
+
+ - Light
+ - Dark
+ - Follow System
+
+
+
+ - @string/accent_blue
+ - @string/accent_red
+ - @string/accent_green
+ - @string/accent_yellow
+ - @string/accent_purple
+
+
+
+ - Blue
+ - Red
+ - Green
+ - Yellow
+ - Purple
+
+
+
+ - nonroot
+ - root
+
+
+
+ - SYKE
+
+
+
+ - Yo
+ - mama
+ - fat
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
new file mode 100644
index 0000000000..024c00c76b
--- /dev/null
+++ b/app/src/main/res/values/attrs.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 030098fe0f..97a9e1be2d 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,6 +1,15 @@
- #6200EE
- #3700B3
- #03DAC5
+ #673AB7
+ #FB542B
+ #7289DA
+ #1DA1F2
+ #0088cc
+ #FF4500
+ #17191A
+
+ #000000
+ #CC0047
+ #00CC7A
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 47c8224673..2f8f953f39 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,5 +1,8 @@
- 16dp
- 16dp
+
+ 8dp
+ 12dp
+ 16dp
+
diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000000..1c3e05ec12
--- /dev/null
+++ b/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ #0C0C0F
+
\ No newline at end of file
diff --git a/app/src/main/res/values/preloaded_fonts.xml b/app/src/main/res/values/preloaded_fonts.xml
index a07c430750..34770a131b 100644
--- a/app/src/main/res/values/preloaded_fonts.xml
+++ b/app/src/main/res/values/preloaded_fonts.xml
@@ -1,6 +1,9 @@
+ - @font/exo
+ - @font/exo_2
+ - @font/exo_2_bold
- @font/exo_semibold
diff --git a/app/src/main/res/values/resources.xml b/app/src/main/res/values/resources.xml
new file mode 100644
index 0000000000..d4cc7fff68
--- /dev/null
+++ b/app/src/main/res/values/resources.xml
@@ -0,0 +1,11 @@
+
+
+
+ Vanced Manager
+ Vanced
+ MicroG
+ root
+ nonroot
+ App Downloads
+
+
\ 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 6d8f8b6e13..4ad609dee7 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,25 +1,107 @@
+
- Vanced Manager
+
+
+ Close
+ Reset
+ Save
+ Cancel
+
+
+ About
Home
- Home
- Vanced
+ Install
+ Settings
+ Dismiss
+ Fine
+
+
+ Changelogs
+ Check
+ Downloading %1$s
+ Failed to uninstall package %1$s
+ Error Downloading %1$s
Install
- Latest\nInstalled
- N/A
- MicroG
- Settings
- GitHub links
- Vanced on Social Medias
- Website
- Discord
- Telegram
- Twitter
- Brave Browser
- Support us by downloading Brave
+ Installing %1$s
+ Operation failed because user aborted installation
+ Operation failed because user blocked installation
+ Operation failed because app conflicts with already installed app
+ Operation failed because it just failed idk
+ Operation failed because app is incompatible with your device
+ Operation failed because apk files are invalid
+ Unexpected error occurred while installing Vanced. Did you disable signature verification?
+ Unexpected error occurred while installing Vanced. Did you disable MiUI Optimisations?
+ Operation failed because there was an error with storage. Hold up how is that even possible?
+ Reinstall
+ Installed:
+ Latest:
+ Loading…
+ MicroG successfully installed
+ Successfully installed %1$s
+ Network connection unavailable
+ No Microg!
+ Unable to download %1$s
+ Unavailable
+ Update
Useful Links
- Reddit
- The official website of YouTube Vanced
- Manager
- Bot
- Website
-
+ Website
+ Support us!
+
+
+ Accent Color
+ Choose your preferred accent color
+ Blue
+ Green
+ Purple
+ Red
+ Yellow
+ Check for updates
+ Interface
+ Manager
+ Chosen Installation values
+ Language: %1$s
+ Theme: %1$s
+ Chosen Preferences
+ Theme
+ Follow System
+ Dark Theme
+ Light Theme
+ Choose your preferred theme
+ Update Channel URL
+ Push Notifications
+ Receive push notifications when update is released
+ Re-check
+ Update Center
+ Update found!
+ No new updates
+
+
+ Guide
+ Hold on!
+ Detected MiUI user!
+ Hey! Looks like you\'re a MiUI user. in order to properly use Vanced Manager, you will have to disable MiUI optimisations in developer settings\n However, if you are on 20.2.20 ROM that\'s based on xiaomi.eu, you can safely ignore this warning.
+ I\'m gonna stop you right there!
+ Looks like you did NOT disable MiUI optimisations. Please disable it. However, if you are on 20.2.20 ROM that\'s based on xiaomi.eu, you can safely ignore this warning.
+ Error
+ Please make sure you downloaded app from vanced.app, Vanced Discord server or GitHub
+ Success!
+ Vanced has been successfully installed, do you want to launch it now?
+ Launch
+ Welcome
+
+
+ Choose your preferred language for Vanced
+ Note: if you install anything other than English, English will still be installed as an additional language
+ Choose your preferred theme for Vanced
+ Root mode detected! In order for manager to install Vanced correctly, please make sure you disabled signature verification.
+ Finish
+ Light + Black
+ Light + Dark
+ Next
+
+
+ Manager Dev
+ Sources
+ Vanced Team
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index a91620f92f..0695f8dcea 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,214 +1,135 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes-dark.xml b/app/src/main/res/values/themes-dark.xml
new file mode 100644
index 0000000000..84204cafbe
--- /dev/null
+++ b/app/src/main/res/values/themes-dark.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000000..813275a80e
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml
new file mode 100644
index 0000000000..5315fd6ae4
--- /dev/null
+++ b/app/src/main/res/xml-v25/shortcuts.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/dev_settings.xml b/app/src/main/res/xml/dev_settings.xml
new file mode 100644
index 0000000000..bdaa29859c
--- /dev/null
+++ b/app/src/main/res/xml/dev_settings.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/file_provider.xml b/app/src/main/res/xml/file_provider.xml
new file mode 100644
index 0000000000..87913e3072
--- /dev/null
+++ b/app/src/main/res/xml/file_provider.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
new file mode 100644
index 0000000000..1e1563f0e5
--- /dev/null
+++ b/app/src/main/res/xml/preferences.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/vanced/manager/ExampleUnitTest.kt b/app/src/test/java/com/vanced/manager/ExampleUnitTest.kt
deleted file mode 100644
index 14c302cef1..0000000000
--- a/app/src/test/java/com/vanced/manager/ExampleUnitTest.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.vanced.manager
-
-import org.junit.Test
-
-import org.junit.Assert.*
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-class ExampleUnitTest {
- @Test
- fun addition_isCorrect() {
- assertEquals(4, 2 + 2)
- }
-}
diff --git a/build.gradle b/build.gradle
index eb87dbab35..cd281a7c8e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.3.61'
+ ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.6.1'
+ classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
@@ -20,7 +20,10 @@ allprojects {
repositories {
google()
jcenter()
-
+ maven {
+ url "https://jitpack.io"
+ }
+
}
}
diff --git a/gradle.properties b/gradle.properties
index 23339e0df6..6d7244f6e9 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,11 +6,11 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx8192m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
+org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
@@ -19,3 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
+
+org.gradle.configureondemand=true
+org.gradle.daemon=false