mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-23 19:55:11 +00:00
adjustments
This commit is contained in:
parent
dc03af09ec
commit
fad94279a5
5 changed files with 11 additions and 5 deletions
|
@ -6,6 +6,7 @@ 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
|
||||
|
@ -13,6 +14,7 @@ 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
|
||||
|
@ -59,6 +61,9 @@ class MicrogDownloadService: Service() {
|
|||
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) {
|
||||
|
|
|
@ -65,7 +65,7 @@ open class Home : BaseFragment(), View.OnClickListener {
|
|||
when (v?.id) {
|
||||
R.id.vanced_installbtn -> {
|
||||
if (!isVancedDownloading!!) {
|
||||
if (MiuiHelper.isMiui()) {
|
||||
if (!MiuiHelper.isMiuiOptimisationsDisabled()) {
|
||||
activity?.let {
|
||||
secondMiuiDialog(it)
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ object DialogContainer {
|
|||
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()
|
||||
|
|
|
@ -7,9 +7,9 @@ import java.io.InputStreamReader
|
|||
|
||||
object MiuiHelper {
|
||||
|
||||
fun isMiui(): Boolean {
|
||||
return !TextUtils.isEmpty(getSystemProps("ro.miui.system.version.name"))
|
||||
}
|
||||
fun isMiui(): Boolean = !TextUtils.isEmpty(getSystemProps("ro.miui.ui.version.name"))
|
||||
|
||||
fun isMiuiOptimisationsDisabled(): Boolean = getSystemProps("persist.sys.miui_optimization") == "0"
|
||||
|
||||
private fun getSystemProps(propname: String): String? {
|
||||
val line: String
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<string name="miui_one_title">Detected MiUI user!</string>
|
||||
<string name="miui_one">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\nIf you can\'t find such setting, it means that you are using a new version of ROM which does not need fixing anything.</string>
|
||||
<string name="miui_two_title">I\'m gonna stop you right there!</string>
|
||||
<string name="miui_two">I am once again asking you to disable MiUI optimisations if you have not already. K thx bai</string>
|
||||
<string name="miui_two">Looks like you did NOT disable MiUI optimisations. Please disable it. K thx bai</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="security_context">Please make sure you downloaded app from vanced.app, Vanced Discord server or GitHub</string>
|
||||
<string name="success">Success!</string>
|
||||
|
|
Loading…
Reference in a new issue