This commit mostly includes debug stuff, also an adjusted launcher icon
Before Width: | Height: | Size: 35 KiB |
|
@ -74,8 +74,10 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (isInstallationRunning(this))
|
||||
if (isInstallationRunning(this)) {
|
||||
Log.d("VMService", "Installation is already running")
|
||||
return false
|
||||
}
|
||||
|
||||
when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
|
|
|
@ -8,6 +8,8 @@ import androidx.core.content.ContextCompat.startActivity
|
|||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.core.downloader.VancedDownloadService
|
||||
import com.vanced.manager.core.installer.SplitInstaller
|
||||
import com.vanced.manager.utils.InternetTools.openUrl
|
||||
import com.vanced.manager.utils.MiuiHelper
|
||||
|
||||
|
@ -50,6 +52,22 @@ object DialogContainer {
|
|||
.show()
|
||||
}
|
||||
|
||||
//TODO
|
||||
fun installOrDownload(context: Context) {
|
||||
MaterialAlertDialogBuilder(context).apply {
|
||||
setTitle("")
|
||||
setMessage("")
|
||||
setNegativeButton("") { dialog, _ ->
|
||||
context.startService(Intent(context, VancedDownloadService::class.java))
|
||||
dialog.dismiss()
|
||||
}
|
||||
setPositiveButton(context.getString(R.string.button_reinstall)) { dialog, _ ->
|
||||
context.startService(Intent(context, SplitInstaller::class.java))
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showRootDialog(activity: Activity) {
|
||||
MaterialAlertDialogBuilder(activity)
|
||||
.setTitle(activity.getString(R.string.hold_on))
|
||||
|
|
|
@ -4,21 +4,25 @@ import android.app.ActivityManager
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageInstaller
|
||||
import android.util.Log
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.core.downloader.*
|
||||
import com.vanced.manager.core.installer.*
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
|
||||
object AppUtils {
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun isInstallationRunning(context: Context): Boolean {
|
||||
val services = arrayOf("VancedDownloadService", "MicrogDownloadService", "AppInstaller", "SplitInstaller", "RootSplitInstallerService")
|
||||
val serviceClasses = listOf(VancedDownloadService::class.java, MicrogDownloadService::class.java, AppInstaller::class.java, AppInstallerService::class.java, SplitInstaller::class.java, SplitInstallerService::class.java, RootSplitInstallerService::class.java)
|
||||
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
val runningServices = activityManager.getRunningServices(Int.MAX_VALUE)
|
||||
|
||||
services.forEach { name ->
|
||||
serviceClasses.forEach { service ->
|
||||
runningServices.forEach { info ->
|
||||
if (info.service.className == name) {
|
||||
if (info.service.className == service.name) {
|
||||
Log.d("VMService", "${service.name} is already running")
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +36,7 @@ object AppUtils {
|
|||
LocalBroadcastManager.getInstance(context).sendBroadcast(mIntent)
|
||||
}
|
||||
|
||||
fun getErrorMessage(status: Int, context: Context): String {
|
||||
private fun getErrorMessage(status: Int, context: Context): String {
|
||||
return when (status) {
|
||||
PackageInstaller.STATUS_FAILURE_ABORTED -> context.getString(R.string.installation_aborted)
|
||||
PackageInstaller.STATUS_FAILURE_BLOCKED -> context.getString(R.string.installation_blocked)
|
||||
|
|
|
@ -2,44 +2,67 @@
|
|||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="3448.276"
|
||||
android:viewportHeight="3448.276">
|
||||
<group android:translateX="724.13794"
|
||||
android:translateY="724.13794">
|
||||
<path
|
||||
android:pathData="M1004.92,1881.1c-38.2,0.05 -76.47,-1.45 -114.57,0.42c-51.76,2.55 -81.84,-18.16 -90.74,-70.96c-7.49,-44.41 -13.2,-90.61 -30.51,-131.43c-15.34,-36.18 -40.29,-72.3 -70.22,-97.5c-83.85,-70.62 -178.04,-88.12 -279.91,-36c-16.76,8.57 -36.28,11.64 -54.35,17.76c-44.7,15.15 -76.87,1.99 -100.01,-39.68c-37.07,-66.74 -75.6,-132.69 -114.44,-198.43c-26.16,-44.27 -21.81,-81.72 19.36,-114.5c18.97,-15.11 34.6,-34.64 54.31,-48.55c72.54,-51.21 94,-120.05 91.6,-207.5c-2.02,-73.79 -23.93,-128.07 -79.03,-177.07c-131.04,-116.54 -130.5,-96.77 -38.4,-254.62c19.24,-32.97 38.08,-66.16 57.32,-99.13c41.41,-70.96 54.33,-75.72 134.39,-49.89c34.65,11.18 69.02,23.28 103.91,33.66c101.86,30.29 254.34,-57.92 278.42,-161.01c11.05,-47.28 20.7,-94.88 31.43,-142.24c8.42,-37.18 32.04,-56.47 70.31,-56.57c83.34,-0.23 166.68,0.02 250.01,-0.19c40.55,-0.11 65.26,19.16 73.99,58.78c10.44,47.42 14.73,97.39 33.08,141.51c15.63,37.56 42.09,74.68 73.09,100.99c82.04,69.63 174.55,87.18 274.79,35.85c18.26,-9.35 39.69,-12.3 59.29,-19.26c42.92,-15.23 73.52,-2.18 95.76,37.26c39.19,69.52 79.65,138.32 119.78,207.31c22.41,38.53 18.11,72.63 -15.69,102.47c-13.01,11.49 -24.36,25.49 -38.81,34.62c-105.9,66.87 -127.21,167.78 -109.49,281c5,31.96 22.73,65.36 43.68,90.58c29.68,35.74 67.12,65.23 102.43,96.04c33.98,29.66 40.49,63.13 18.36,101.95c-40.4,70.85 -81.55,141.28 -121.74,212.25c-21.43,37.85 -52.64,47.95 -92.63,35.44c-43.04,-13.47 -85.74,-28.06 -128.91,-41.12c-106.14,-32.11 -256.7,54.16 -281.98,161.54c-10.73,45.58 -20.37,91.42 -30.39,137.17c-8.68,39.59 -32.96,59.33 -73.71,59.05C1084.79,1880.83 1044.85,1881.04 1004.92,1881.1z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="76"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeLineCap="round">
|
||||
<aapt:attr name="android:strokeColor">
|
||||
<gradient
|
||||
android:startY="1642.6245"
|
||||
android:startX="322.9971"
|
||||
android:endY="287.2871"
|
||||
android:endX="1678.3345"
|
||||
android:type="linear">
|
||||
<item android:offset="1.065558E-7" android:color="#FF2E73FF"/>
|
||||
<item android:offset="1" android:color="#FFFF0032"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M1270.42,895.24L886.12,647.3c-16.68,-9.72 -38.08,-4.08 -47.8,12.59l-0.75,1.28c-9.72,16.67 -4.09,38.07 12.59,47.79l367.49,221.11c23.91,14.39 23.77,49.1 -0.25,63.29l-369.18,218.11c-16.76,9.58 -22.58,30.93 -13,47.69l0.73,1.29c9.58,16.76 30.93,22.57 47.69,12.99l386.24,-244.83C1318.69,997.67 1318.97,926.57 1270.42,895.24z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
<path
|
||||
android:pathData="M1074.21,926.45L884.98,819.87c-24.49,-13.8 -54.77,3.9 -54.77,32v213.18c0,28.11 30.28,45.8 54.77,32l189.22,-106.59C1099.15,976.41 1099.15,940.5 1074.21,926.45z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="1058.4124"
|
||||
android:startX="808.329"
|
||||
android:endY="858.5059"
|
||||
android:endX="1008.2355"
|
||||
android:type="linear">
|
||||
<item android:offset="0" android:color="#FF2E73FF"/>
|
||||
<item android:offset="1" android:color="#FFFF0032"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0.034267887"
|
||||
android:scaleY="0.034267887"
|
||||
android:translateX="21.822453"
|
||||
android:translateY="21">
|
||||
<group
|
||||
android:translateX="-61"
|
||||
android:translateY="-44.97">
|
||||
<path
|
||||
android:pathData="M1004.71 1916.4c-38.2 0 -76.47 -1.46 -114.57 0.42 -51.76 2.55 -81.85 -18.16 -90.74 -71 -7.49 -44.41 -13.2 -90.61 -30.51 -131.44 -15.34 -36.17 -40.29 -72.29 -70.22 -97.5 -83.85 -70.61 -178 -88.12 -279.91 -36 -16.75 8.57 -36.27 11.63 -54.34 17.76 -44.7 15.14 -76.87 2 -100 -39.69 -37.07 -66.74 -75.59 -132.69 -114.44 -198.43 -26.16 -44.26 -21.81 -81.71 19.36 -114.5 19 -15.1 34.6 -34.64 54.31 -48.55 72.54 -51.2 94 -120 91.6 -207.49 -2 -73.79 -23.93 -128.07 -79 -177.07 -131 -116.54 -130.49 -96.77 -38.39 -254.62 19.23 -33 38.07 -66.16 57.31 -99.12 41.42 -71 54.34 -75.73 134.4 -49.89 34.65 11.18 69 23.29 103.91 33.66 101.86 30.29 254.34 -57.92 278.42 -161 11 -47.28 20.71 -94.88 31.43 -142.24 8.43 -37.18 32.05 -56.46 70.31 -56.56 83.34 -0.23 166.68 0 250 -0.2 40.55 -0.1 65.27 19.16 74 58.78 10.44 47.42 14.73 97.39 33.08 141.51 15.63 37.56 42.09 74.68 73.1 101 82 69.63 174.55 87.18 274.79 35.85 18.26 -9.35 39.69 -12.3 59.29 -19.26 42.91 -15.23 73.51 -2.18 95.75 37.27 39.2 69.51 79.66 138.32 119.78 207.3C1875.8 684 1871.49 718 1837.7 747.88c-13 11.49 -24.36 25.5 -38.82 34.63 -105.89 66.87 -127.2 167.78 -109.49 281 5 32 22.74 65.36 43.69 90.58 29.68 35.74 67.12 65.23 102.42 96.05 34 29.65 40.5 63.13 18.36 101.94 -40.4 70.85 -81.55 141.28 -121.73 212.25 -21.43 37.85 -52.64 48 -92.63 35.44 -43 -13.47 -85.75 -28.06 -128.91 -41.12 -106.14 -32.11 -256.7 54.16 -282 161.54 -10.73 45.58 -20.36 91.42 -30.39 137.16 -8.68 39.6 -33 59.33 -73.71 59.05C1084.58 1916.13 1044.64 1916.34 1004.71 1916.4Z"
|
||||
android:strokeWidth="76"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round">
|
||||
<aapt:attr
|
||||
name="android:strokeColor">
|
||||
<gradient
|
||||
android:startX="322.79"
|
||||
android:startY="1677.92"
|
||||
android:endX="1678.13"
|
||||
android:endY="322.59"
|
||||
android:tileMode="clamp">
|
||||
<item
|
||||
android:color="#2E73FF"
|
||||
android:offset="0" />
|
||||
<item
|
||||
android:color="#FF0032"
|
||||
android:offset="1" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</group>
|
||||
<group
|
||||
android:translateX="-61"
|
||||
android:translateY="-44.97">
|
||||
<path
|
||||
android:pathData="M1270.21 935L885.92 687a35 35 0 0 0 -47.81 12.59l-0.74 1.28A34.94 34.94 0 0 0 850 748.67l367.49 221.11c23.91 14.38 23.77 49.09 -0.26 63.29L848 1251.18a34.94 34.94 0 0 0 -13 47.68l0.74 1.29a35 35 0 0 0 47.69 13l386.24 -244.82C1318.48 1037.38 1318.76 966.28 1270.21 935Z"
|
||||
android:fillColor="#FFFFFF" />
|
||||
</group>
|
||||
<group
|
||||
android:translateX="-61"
|
||||
android:translateY="-44.97">
|
||||
<path
|
||||
android:pathData="M1074 968L884.77 861.41c-24.49 -13.8 -54.77 3.89 -54.77 32v213.18c0 28.11 30.28 45.8 54.77 32L1074 1032C1098.94 1018 1098.94 982 1074 968Z">
|
||||
<aapt:attr
|
||||
name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="808.12"
|
||||
android:startY="1099.95"
|
||||
android:endX="1008.03"
|
||||
android:endY="900.05"
|
||||
android:tileMode="clamp">
|
||||
<item
|
||||
android:color="#2E73FF"
|
||||
android:offset="0" />
|
||||
<item
|
||||
android:color="#FF0032"
|
||||
android:offset="1" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
</vector>
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#0C0C0F</color>
|
||||
<color name="ic_launcher_background">#000000</color>
|
||||
</resources>
|