mirror of
https://github.com/YTVanced/VancedManager
synced 2024-10-31 16:22:38 +00:00
Fixes
This commit is contained in:
parent
14a964c9d9
commit
cbc31a64ad
8 changed files with 55 additions and 15 deletions
4
.github/workflows/debug.yml
vendored
4
.github/workflows/debug.yml
vendored
|
@ -27,8 +27,8 @@ jobs:
|
|||
- name: Build Debug APK with Gradle
|
||||
run: ./gradlew assembleDebug
|
||||
|
||||
- name: Upload to GitHub
|
||||
- name: Upload Debug
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: 'Vanced-Manager'
|
||||
name: 'Manager'
|
||||
path: app/build/outputs/apk/debug/app-debug.apk
|
|
@ -130,7 +130,7 @@ class VancedDownloadService: Service() {
|
|||
*/
|
||||
|
||||
private fun prepareInstall(variant: String) {
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(Intent(HomeFragment.VANCED_DOWNLOADED))
|
||||
//LocalBroadcastManager.getInstance(this).sendBroadcast(Intent(HomeFragment.VANCED_DOWNLOADED))
|
||||
if (variant == "root")
|
||||
startService(Intent(this, RootSplitInstallerService::class.java))
|
||||
else
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.vanced.manager.core.installer
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.AsyncTask
|
||||
import android.os.Build
|
||||
|
@ -13,7 +12,7 @@ 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.AppUtils
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
import com.vanced.manager.utils.FileInfo
|
||||
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
||||
import java.io.File
|
||||
|
@ -43,6 +42,7 @@ class RootSplitInstallerService: Service() {
|
|||
|
||||
@WorkerThread
|
||||
private fun installSplitApkFiles(apkFiles: ArrayList<FileInfo>) {
|
||||
val broadcast = LocalBroadcastManager.getInstance(this)
|
||||
var sessionId: Int?
|
||||
val notifId = 666
|
||||
Log.d("AppLog", "installing split apk files:$apkFiles")
|
||||
|
@ -77,16 +77,14 @@ class RootSplitInstallerService: Service() {
|
|||
}
|
||||
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) {
|
||||
AppUtils.sendRefreshHome(this)
|
||||
broadcast.sendBroadcast(Intent(HomeFragment.REFRESH_HOME))
|
||||
broadcast.sendBroadcast(Intent(MainActivity.INSTALL_COMPLETED).putExtra("pkg", "vanced"))
|
||||
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)
|
||||
broadcast.sendBroadcast(mIntent)
|
||||
createBasicNotif(getString(R.string.installation_signature), notifId, this)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.util.Log
|
|||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.ui.MainActivity
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
import com.vanced.manager.utils.AppUtils.getErrorMessage
|
||||
import com.vanced.manager.utils.AppUtils.sendRefreshHome
|
||||
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
||||
|
@ -30,8 +31,7 @@ class SplitInstallerService: Service() {
|
|||
}
|
||||
PackageInstaller.STATUS_SUCCESS -> {
|
||||
Log.d(TAG, "Installation succeed")
|
||||
getSharedPreferences("installPrefs", Context.MODE_PRIVATE).edit().putBoolean("isInstalling", false).apply()
|
||||
sendRefreshHome(this)
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(Intent(HomeFragment.REFRESH_HOME))
|
||||
createBasicNotif(
|
||||
getString(R.string.successfully_installed, "Vanced"),
|
||||
notifId,
|
||||
|
@ -53,7 +53,6 @@ class SplitInstallerService: Service() {
|
|||
|
||||
private fun sendFailure(status: Int) {
|
||||
val mIntent = Intent(MainActivity.INSTALL_FAILED)
|
||||
mIntent.action = MainActivity.INSTALL_FAILED
|
||||
mIntent.putExtra("errorMsg", getErrorMessage(status, this))
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(mIntent)
|
||||
}
|
||||
|
|
|
@ -202,8 +202,8 @@ class HomeFragment : Fragment(), View.OnClickListener {
|
|||
|
||||
private fun registerReceivers() {
|
||||
val intentFilter = IntentFilter()
|
||||
intentFilter.addAction(VANCED_DOWNLOADED)
|
||||
intentFilter.addAction(MICROG_DOWNLOADED)
|
||||
//intentFilter.addAction(VANCED_DOWNLOADED)
|
||||
//intentFilter.addAction(MICROG_DOWNLOADED)
|
||||
intentFilter.addAction(REFRESH_HOME)
|
||||
localBroadcastManager.registerReceiver(broadcastReceiver, intentFilter)
|
||||
}
|
||||
|
|
36
app/src/main/res/values-v23/themes.xml
Normal file
36
app/src/main/res/values-v23/themes.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
|
||||
<style name="LightTheme.Blue" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
|
||||
<item name="colorPrimary">#1490D7</item>
|
||||
<item name="colorPrimaryVariant">#2C7EB9</item>
|
||||
<item name="colorSecondary">#3E78AF</item>
|
||||
<item name="colorSecondaryVariant">#803E78AF</item>
|
||||
<item name="colorSurface">#ffffff</item>
|
||||
<item name="colorSurfaceVariant">#F3F3F3</item>
|
||||
<item name="colorSurfaceSurfaceVariant">?colorSurface</item>
|
||||
<item name="colorOnPrimary">#F9F9F9</item>
|
||||
<item name="colorOnPrimaryVariant">#e8e8e8</item>
|
||||
<item name="colorOnSecondary">#F9F9F9</item>
|
||||
<item name="colorOnBackground">?colorOnSurface</item>
|
||||
<item name="colorError">#CC0047</item>
|
||||
<item name="colorOnError">#F9F9F9</item>
|
||||
<item name="colorOnSurface">#444444</item>
|
||||
<item name="colorOnSurfaceVariant">#C3131313</item>
|
||||
<item name="colorDisabled">@color/Gray</item>
|
||||
<item name="colorDisabledVariant">#000000</item>
|
||||
<item name="iconColor">?colorPrimaryVariant</item>
|
||||
<item name="toolbarIconColor">#111111</item>
|
||||
<item name="DialogBG">#ffffff</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:windowBackground">?colorSurface</item>
|
||||
<item name="android:statusBarColor">#ffffff</item>
|
||||
<item name="materialAlertDialogTheme">@style/DialogStyle</item>
|
||||
<item name="snackbarStyle">@style/SnackBar</item>
|
||||
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -142,4 +142,9 @@
|
|||
<item name="tint">@color/Red</item>
|
||||
</style>
|
||||
|
||||
<style name="SnackBar" parent="Widget.MaterialComponents.Snackbar">
|
||||
<item name="android:backgroundTint">?colorSurface</item>
|
||||
<item name="android:textColor">?colorOnSurfaceVariant</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -29,6 +29,7 @@
|
|||
<item name="android:windowBackground">?colorSurface</item>
|
||||
<item name="android:statusBarColor">#787777</item>
|
||||
<item name="materialAlertDialogTheme">@style/DialogStyle</item>
|
||||
<item name="snackbarStyle">@style/SnackBar</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
@ -97,6 +98,7 @@
|
|||
<item name="android:statusBarColor">?colorSurface</item>
|
||||
<item name="android:navigationBarColor">#000000</item>
|
||||
<item name="materialAlertDialogTheme">@style/DialogStyle</item>
|
||||
<item name="snackbarStyle">@style/SnackBar</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in a new issue