Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 7f6d0b3

Browse files
authored
Merge pull request #406 from YTVanced/dev
Manager v2.4.0 release
2 parents 0c72ca8 + e5a0050 commit 7f6d0b3

File tree

98 files changed

+1198
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1198
-510
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Pull requests should be made to the Dev branch as that is the working branch, ma
33
For anyone who wants to provide translations please submit them to https://crowdin.com/project/vanced-manager as we also use it for YouTube Vanced. Any issues with translations should be posted there too.
44
======
55
Vanced FAQ (from the faq branch) now available on the playstore! https://play.google.com/store/apps/details?id=com.vanced.faq
6-
## The FAQ app has just been suspended due to "Impersonating Vanced", an appeal has been filed, reporting other apps which impersonate Vanced on the play store is appreciated.
76

87
[![Github All Releases](https://img.shields.io/github/downloads/YTVanced/VancedManager/total.svg)](https://github.com/YTVanced/VancedManager/releases/latest) [![Github All Releases](https://img.shields.io/github/release/YTVanced/VancedManager.svg)](https://github.com/YTVanced/VancedManager/releases/latest)
98
# Vanced Manager

READMEME.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,3 @@ Vanced Manager sucks 100% of your CPU to mine Bitcoins, this is a new technique
4848
![Zanezam](https://i.imgur.com/QVcXA6q.png)
4949
- Laura Almeida
5050
![Laura Almeida](https://i.imgur.com/ovVD939.png)
51-
52-
###### If someone is reading this pls help me, KevinX8 is bullying me and forces me to develop manager. please send bobs and veganas and call 911
53-

app/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66
id("com.google.firebase.crashlytics")
77
id("com.google.firebase.firebase-perf")
88
id("androidx.navigation.safeargs.kotlin")
9+
id("kotlin-android")
910
}
1011

1112
android {
@@ -15,8 +16,8 @@ android {
1516
applicationId = "com.vanced.manager"
1617
minSdkVersion(21)
1718
targetSdkVersion(30)
18-
versionCode = 230
19-
versionName = "2.3.0 (MicroShitMoment)"
19+
versionCode = 240
20+
versionName = "2.4.0 (java.lang.TrashManagerException)"
2021

2122
vectorDrawables.useSupportLibrary = true
2223

@@ -43,7 +44,6 @@ android {
4344
}
4445

4546
buildFeatures {
46-
dataBinding = true // ObservableField migrate to flow or liveData
4747
viewBinding = true
4848
}
4949

@@ -103,8 +103,8 @@ dependencies {
103103
implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0")
104104
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
105105
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.0.0")
106-
implementation("androidx.navigation:navigation-fragment-ktx:2.3.2")
107-
implementation("androidx.navigation:navigation-ui-ktx:2.3.2")
106+
implementation("androidx.navigation:navigation-fragment-ktx:2.3.3")
107+
implementation("androidx.navigation:navigation-ui-ktx:2.3.3")
108108
implementation("androidx.preference:preference-ktx:1.1.1")
109109
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
110110

@@ -125,7 +125,7 @@ dependencies {
125125
implementation("com.github.kittinunf.fuel:fuel:2.3.0")
126126
implementation("com.github.kittinunf.fuel:fuel-coroutines:2.2.3")
127127
implementation("com.github.kittinunf.fuel:fuel-json:2.2.3")
128-
implementation("com.squareup.okhttp3:logging-interceptor:4.9.0")
128+
implementation("com.squareup.okhttp3:logging-interceptor:4.9.1")
129129

130130
// Root permissions
131131
implementation("com.github.topjohnwu.libsu:core:3.0.2")
@@ -135,8 +135,8 @@ dependencies {
135135
implementation("com.google.android:flexbox:2.0.1")
136136

137137
// Firebase
138-
implementation("com.google.firebase:firebase-analytics-ktx:18.0.1")
139-
implementation("com.google.firebase:firebase-crashlytics:17.3.0")
138+
implementation("com.google.firebase:firebase-analytics-ktx:18.0.2")
139+
implementation("com.google.firebase:firebase-crashlytics:17.3.1")
140140
implementation("com.google.firebase:firebase-messaging:21.0.1")
141141
implementation("com.google.firebase:firebase-perf:19.1.0")
142142
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<package android:name="com.vanced.android.apps.youtube.music" />
2222
<package android:name="com.google.android.apps.youtube.music" />
2323
<package android:name="com.mgoogle.android.gms" />
24+
<package android:name="com.vanced.faq" />
2425
<package android:name="com.android.vending" />
2526
</queries>
2627

app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ import com.vanced.manager.model.DataModel
1414
import com.vanced.manager.model.RootDataModel
1515
import com.vanced.manager.ui.dialogs.AppInfoDialog
1616
import com.vanced.manager.ui.viewmodels.HomeViewModel
17-
import com.vanced.manager.utils.enableMusic
18-
import com.vanced.manager.utils.enableVanced
19-
import com.vanced.manager.utils.managerVariant
17+
import com.vanced.manager.utils.*
2018

2119
class AppListAdapter(
2220
private val context: FragmentActivity,
@@ -25,11 +23,10 @@ class AppListAdapter(
2523
private val tooltip: ViewTooltip
2624
) : RecyclerView.Adapter<AppListAdapter.ListViewHolder>() {
2725

28-
val apps = mutableListOf<String>()
26+
private val apps = mutableListOf<String>()
2927
private val dataModels = mutableListOf<DataModel?>()
3028
private val rootDataModels = mutableListOf<RootDataModel?>()
3129
private val prefs = getDefaultSharedPreferences(context)
32-
private var itemCount = 0
3330

3431
private val isRoot = prefs.managerVariant == "root"
3532

@@ -43,18 +40,18 @@ class AppListAdapter(
4340
appInstallButton.text = it
4441
}
4542
appInstallButton.setOnClickListener {
46-
viewModel.openInstallDialog(it, apps[position])
43+
if (vanced.value != null) {
44+
viewModel.openInstallDialog(it, apps[position])
45+
} else {
46+
return@setOnClickListener
47+
}
4748
}
4849
appUninstall.setOnClickListener {
4950
dataModel?.appPkg?.let { it1 -> viewModel.uninstallPackage(it1) }
5051
}
5152
appLaunch.setOnClickListener {
5253
viewModel.launchApp(apps[position], isRoot)
5354
}
54-
with(dataModel?.isAppInstalled?.value) {
55-
appUninstall.isVisible = this == true
56-
appLaunch.isVisible = this == true
57-
}
5855
dataModel?.isAppInstalled?.observe(lifecycleOwner) {
5956
appUninstall.isVisible = it
6057
appLaunch.isVisible = it
@@ -87,7 +84,7 @@ class AppListAdapter(
8784
}
8885
}
8986

90-
override fun getItemCount(): Int = itemCount
87+
override fun getItemCount(): Int = apps.size
9188

9289
init {
9390

@@ -98,7 +95,6 @@ class AppListAdapter(
9895
dataModels.add(viewModel.vancedModel.value)
9996
}
10097
apps.add(context.getString(R.string.vanced))
101-
itemCount++
10298
}
10399

104100
if (prefs.enableMusic) {
@@ -108,13 +104,11 @@ class AppListAdapter(
108104
dataModels.add(viewModel.musicModel.value)
109105
}
110106
apps.add(context.getString(R.string.music))
111-
itemCount++
112107
}
113108

114109
if (!isRoot) {
115110
dataModels.add(viewModel.microgModel.value)
116111
apps.add(context.getString(R.string.microg))
117-
itemCount++
118112
}
119113

120114
}

app/src/main/java/com/vanced/manager/adapter/GetNotifAdapter.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import com.google.firebase.messaging.FirebaseMessaging
88
import com.vanced.manager.R
99
import com.vanced.manager.databinding.ViewNotificationSettingBinding
1010
import com.vanced.manager.model.NotifModel
11+
import com.vanced.manager.utils.defPrefs
1112

12-
class GetNotifAdapter(private val context: Context) :
13-
RecyclerView.Adapter<GetNotifAdapter.GetNotifViewHolder>() {
13+
class GetNotifAdapter(private val context: Context) : RecyclerView.Adapter<GetNotifAdapter.GetNotifViewHolder>() {
14+
15+
private val prefs = context.defPrefs
1416

1517
private val vanced = NotifModel(
1618
"Vanced-Update",
@@ -35,20 +37,22 @@ class GetNotifAdapter(private val context: Context) :
3537

3638
inner class GetNotifViewHolder(val binding: ViewNotificationSettingBinding) : RecyclerView.ViewHolder(binding.root) {
3739
val switch = binding.notifSwitch
38-
3940
fun bind(position: Int) {
41+
val app = apps[position]
4042
with(binding.notifSwitch) {
41-
setKey(apps[position].key)
42-
setSummary(apps[position].switchSummary)
43-
setTitle(apps[position].switchTitle)
43+
setKey(app.key)
44+
setSummary(app.switchSummary)
45+
setTitle(app.switchTitle)
4446
setDefaultValue(true)
47+
with (prefs) {
48+
setChecked(getBoolean( "enable_" + app.key.substringBefore("_"), true) && getBoolean(app.key, true))
49+
}
4550
}
4651
}
4752
}
4853

4954
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GetNotifViewHolder {
50-
val view =
51-
ViewNotificationSettingBinding.inflate(LayoutInflater.from(context), parent, false)
55+
val view = ViewNotificationSettingBinding.inflate(LayoutInflater.from(context), parent, false)
5256
return GetNotifViewHolder(view)
5357
}
5458

app/src/main/java/com/vanced/manager/core/App.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package com.vanced.manager.core
22

33
import android.app.Application
44
import android.content.res.Configuration
5-
import android.util.Log
65
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
76
import com.crowdin.platform.Crowdin
87
import com.crowdin.platform.CrowdinConfig
98
import com.crowdin.platform.data.model.AuthConfig
109
import com.crowdin.platform.data.remote.NetworkType
1110
import com.vanced.manager.BuildConfig.*
11+
import com.vanced.manager.utils.AppUtils.log
1212
import com.vanced.manager.utils.loadJson
1313
import kotlinx.coroutines.CoroutineScope
1414
import kotlinx.coroutines.Dispatchers
@@ -35,7 +35,7 @@ open class App: Application() {
3535
withSourceLanguage("en")
3636
withAuthConfig(AuthConfig(CROWDIN_CLIENT_ID, CROWDIN_CLIENT_SECRET, null))
3737
withScreenshotEnabled()
38-
Log.d("test", "crowdin credentials")
38+
log("test", "crowdin credentials")
3939
}
4040
}.build()
4141
)

app/src/main/java/com/vanced/manager/core/downloader/MusicDownloader.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ import com.vanced.manager.utils.PackageHelper.installMusicRoot
1414
object MusicDownloader {
1515

1616
private var variant: String? = null
17-
private var version: String? = null
17+
private var musicVersion: String? = null
1818
private var versionCode: Int? = null
1919
private var baseurl = ""
2020
private var folderName: String? = null
2121
private var downloadPath: String? = null
2222
private var hashUrl: String? = null
2323

24-
fun downloadMusic(context: Context) {
24+
fun downloadMusic(context: Context, version: String? = null) {
2525
val prefs = context.defPrefs
26-
version = prefs.musicVersion?.getLatestAppVersion(musicVersions.value?.value ?: listOf(""))
26+
musicVersion = version ?: prefs.musicVersion?.getLatestAppVersion(musicVersions.value?.value ?: listOf(""))
2727
versionCode = music.value?.int("versionCode")
2828
variant = prefs.managerVariant
29-
baseurl = "$baseInstallUrl/music/v$version"
29+
baseurl = "$baseInstallUrl/music/v$musicVersion"
3030
folderName = "music/$variant"
3131
downloadPath = context.getExternalFilesDir(folderName)?.path
3232
hashUrl = "$baseurl/hash.json"

app/src/main/java/com/vanced/manager/core/downloader/VancedDownloader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package com.vanced.manager.core.downloader
22

33
import android.content.Context
44
import android.content.SharedPreferences
5-
import android.util.Log
65
import com.google.firebase.analytics.FirebaseAnalytics
76
import com.google.firebase.analytics.ktx.logEvent
87
import com.vanced.manager.R
98
import com.vanced.manager.utils.*
9+
import com.vanced.manager.utils.AppUtils.log
1010
import com.vanced.manager.utils.AppUtils.validateTheme
1111
import com.vanced.manager.utils.AppUtils.vancedRootPkg
1212
import com.vanced.manager.utils.DownloadHelper.download
@@ -58,7 +58,7 @@ object VancedDownloader {
5858
try {
5959
downloadSplits(context)
6060
} catch (e: Exception) {
61-
Log.d("VMDownloader", e.stackTraceToString())
61+
log("VMDownloader", e.stackTraceToString())
6262
downloadProgress.value?.downloadingFile?.postValue(context.getString(R.string.error_downloading, "Vanced"))
6363
}
6464

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package com.vanced.manager.core.firebase
22

3-
import android.util.Log
43
import com.google.firebase.messaging.FirebaseMessagingService
4+
import com.vanced.manager.utils.AppUtils.log
55

66
class CloudMessaging : FirebaseMessagingService() {
77

88
override fun onNewToken(p0: String) {
9-
super.onNewToken(p0)
10-
Log.d("VMC", "Generated new token: $p0")
9+
log("VMC", "Generated new token: $p0")
1110
}
1211

1312
}

0 commit comments

Comments
 (0)