0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-23 11:45:11 +00:00

fixed microg installation

This commit is contained in:
X1nto 2020-06-19 19:55:37 +04:00
parent ad39dfbb0c
commit 0ae2f57078
3 changed files with 4 additions and 11 deletions

View file

@ -7,6 +7,7 @@ import android.os.IBinder
import android.widget.Toast
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.dezlum.codelabs.getjson.GetJson
import com.vanced.manager.core.installer.MicrogInstaller.installMicrog
import com.vanced.manager.ui.fragments.HomeFragment
import io.reactivex.disposables.Disposable
import io.reactivex.rxkotlin.subscribeBy
@ -54,6 +55,7 @@ class MicrogDownloadService: Service() {
},
onComplete = {
prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
installMicrog(this)
},
onError = { throwable ->
Toast.makeText(this, throwable.toString(), Toast.LENGTH_SHORT)

View file

@ -35,7 +35,8 @@ open class About : BaseFragment() {
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()
} else
Toast.makeText(requireContext(), "Dev options already unlocked", Toast.LENGTH_SHORT).show()
}
return@setOnTouchListener true

View file

@ -261,9 +261,6 @@ class HomeFragment : Home() {
progressbar?.visibility = View.VISIBLE
progressbar?.progress = progress
}
MICROG_DOWNLOADED -> {
activity?.let { installMicrog(it) }
}
}
}
}
@ -286,12 +283,6 @@ class HomeFragment : Home() {
)
)
}
activity?.let {
LocalBroadcastManager.getInstance(it).registerReceiver(broadcastReceiver, IntentFilter(
MICROG_DOWNLOADED
)
)
}
activity?.let {
LocalBroadcastManager.getInstance(it).registerReceiver(broadcastReceiver, IntentFilter(
MICROG_DOWNLOADING
@ -353,7 +344,6 @@ class HomeFragment : Home() {
const val SIGNATURE_DISABLED = "Signature verification disabled"
const val SIGNATURE_ENABLED = "Signature verification enabled"
const val VANCED_DOWNLOADING = "Vanced downloading"
const val MICROG_DOWNLOADED = "MicroG downloaded"
const val MICROG_DOWNLOADING = "MicroG downloading"
}