Skip to content

Commit aed9c3e

Browse files
committed
Added no-install option.
1 parent 1d8c175 commit aed9c3e

8 files changed

Lines changed: 53 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
targetSdkVersion 30
3333

3434
versionCode 38
35-
versionName "4.0.7"
35+
versionName "4.0.7.0-JW"
3636

3737
vectorDrawables.useSupportLibrary = true
3838
multiDexEnabled true

app/src/main/assets/installers.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@
2525
"subtitle": "Installer for background installations",
2626
"description": "Requires Aurora Services to be installed as system app."
2727
}
28+
{
29+
"id": "4",
30+
"title": "No automatic install",
31+
"subtitle": "Do not install the app after download",
32+
"description": "Usefull if you only want to grab he apk."
33+
}
2834
]

app/src/main/java/com/aurora/store/data/installer/AppInstaller.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ open class AppInstaller private constructor(var context: Context) {
7777
choiceAndInstaller[prefValue] = installer
7878
installer
7979
}
80+
// JW: added
81+
4 -> {
82+
val installer = NoInstaller(context)
83+
choiceAndInstaller[prefValue] = installer
84+
installer
85+
}
8086
else -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
8187
val installer = SessionInstaller(context)
8288
choiceAndInstaller[prefValue] = installer
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.aurora.store.data.installer
2+
3+
import android.content.Context
4+
import com.aurora.store.R
5+
import com.aurora.store.data.event.InstallerEvent
6+
import com.aurora.store.util.Log
7+
import org.greenrobot.eventbus.EventBus
8+
9+
class NoInstaller(context: Context) : InstallerBase(context) {
10+
11+
override fun install(packageName: String, files: List<Any>) {
12+
Log.i("$packageName no automatic install")
13+
postReady(packageName, context.getString(R.string.installer_status_ready))
14+
removeFromInstallQueue(packageName)
15+
}
16+
17+
open fun postReady(packageName: String, extra: String?) {
18+
val event = InstallerEvent.Success(packageName, extra)
19+
EventBus.getDefault().post(event)
20+
}
21+
22+
}

app/src/main/java/com/aurora/store/view/ui/onboarding/InstallerFragment.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.aurora.extensions.isMiuiOptimizationDisabled
2828
import com.aurora.extensions.showDialog
2929
import com.aurora.store.BuildConfig
3030
import com.aurora.store.R
31+
import com.aurora.store.data.installer.NoInstaller // JW: added
3132
import com.aurora.store.data.installer.ServiceInstaller
3233
import com.aurora.store.data.model.Installer
3334
import com.aurora.store.databinding.FragmentOnboardingInstallerBinding
@@ -130,6 +131,11 @@ class InstallerFragment : BaseFragment() {
130131
)
131132
}
132133
}
134+
// JW: added
135+
4 -> {
136+
this.installerId = installerId
137+
save(PREFERENCE_INSTALLER_ID, installerId)
138+
}
133139
else -> {
134140
this.installerId = installerId
135141
save(PREFERENCE_INSTALLER_ID, installerId)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="pref_install_mode_no">"Geen installatie"</string>
4+
<string name="installer_status_ready">"Klaar"</string>
5+
</resources>

app/src/main/res/values/arrays.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,15 @@
112112
<item>@string/pref_install_mode_native</item>
113113
<item>@string/pref_install_mode_root</item>
114114
<item>@string/pref_install_mode_services</item>
115+
<item>@string/pref_install_mode_no</item> <!-- JW: added -->
115116
</string-array>
116117

117118
<string-array name="pref_installation_method_values">
118119
<item>0</item>
119120
<item>1</item>
120121
<item>2</item>
121122
<item>3</item>
123+
<item>4</item> <!-- JW: added -->
122124
</string-array>
123125

124126
<string-array name="link_urls">
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="pref_install_mode_no">"No installer"</string>
4+
<string name="installer_status_ready">"Ready"</string>
5+
</resources>

0 commit comments

Comments
 (0)