This commit is contained in:
X1nto 2020-07-22 20:43:03 +04:00
parent 90d8164f64
commit f89ad86cb0
4 changed files with 9 additions and 6 deletions

View File

@ -81,12 +81,12 @@ class MicrogDownloadService: Service() {
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
//prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
//cancelNotif(channel, this@MicrogDownloadService)
val bIntent = Intent(this@MicrogDownloadService, AppInstaller::class.java)
bIntent.putExtra("path", "${filesDir.path}/microg.apk")
bIntent.putExtra("pkg", "com.mgoogle.android.gms")
val mIntent = Intent(HomeFragment.MICROG_DOWNLOADED)
val mIntent = Intent()
mIntent.action = HomeFragment.MICROG_DOWNLOADED
LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(mIntent)
val bIntent = Intent(this@MicrogDownloadService, AppInstaller::class.java)
bIntent.putExtra("path", "${getExternalFilesDir("apk")}/microg.apk")
bIntent.putExtra("pkg", "com.mgoogle.android.gms")
startService(bIntent)
}
}

View File

@ -76,7 +76,7 @@ class DevSettingsFragment: PreferenceFragmentCompat() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
activity?.let {
val apk = File("${activity?.filesDir?.path}/manager.apk")
val apk = File("${activity?.getExternalFilesDir("apk")}/manager.apk")
val uri =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
FileProvider.getUriForFile(activity!!, "${activity?.packageName}.provider", apk)

View File

@ -50,7 +50,7 @@
style="@style/ButtonStyle"
android:text="@{viewModel.vancedInstallButtonTxt}"
android:textColor="@{viewModel.shouldBeDisabled ? @color/LightGray : @color/White}"
android:backgroundTint="@{viewModel.shouldBeDisabled ? @color/Gray : @color/Accent}"
android:backgroundTint="@{viewModel.shouldBeDisabled ? @drawable/Gray : @drawable/Accent}"
app:icon="@{viewModel.vancedInstallButtonIcon}"
android:clickable="@{!viewModel.shouldBeDisabled}"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -16,4 +16,7 @@
<color name="Accent">?attr/colorPrimary</color>
<drawable name="Accent">?attr/colorPrimary</drawable>
<drawable name="Gray">@color/Gray</drawable>
</resources>