Skip to content

Commit 4cd06b6

Browse files
committed
Update dependencies
1 parent 43de1af commit 4cd06b6

21 files changed

+89
-167
lines changed

app/build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ android {
5757
kotlinOptions {
5858
jvmTarget = JavaVersion.VERSION_1_8
5959
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
60+
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"
61+
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.FlowPreview"
6062
}
6163
}
6264

@@ -65,17 +67,17 @@ dependencies {
6567
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
6668
exclude group: 'com.android.support', module: 'support-annotations'
6769
})
68-
implementation 'androidx.appcompat:appcompat:1.2.0'
69-
implementation "androidx.fragment:fragment-ktx:1.3.3"
70+
implementation 'androidx.appcompat:appcompat:1.3.1'
71+
implementation "androidx.fragment:fragment-ktx:1.3.6"
7072
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
7173
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
72-
implementation 'com.google.android.material:material:1.3.0'
73-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
74+
implementation 'com.google.android.material:material:1.4.0'
75+
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
7476
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
7577
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
76-
implementation 'androidx.recyclerview:recyclerview:1.2.0'
78+
implementation 'androidx.recyclerview:recyclerview:1.2.1'
7779
implementation 'androidx.cardview:cardview:1.0.0'
78-
implementation 'androidx.preference:preference:1.1.1'
80+
implementation 'androidx.preference:preference-ktx:1.1.1'
7981
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
8082
implementation 'androidx.multidex:multidex:2.0.1'
8183
implementation 'androidx.palette:palette-ktx:1.0.0'
@@ -85,6 +87,7 @@ dependencies {
8587
implementation 'com.github.AppIntro:AppIntro:6.1.0'
8688
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
8789
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
90+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
8891
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${coroutinesVersion}"
8992

9093
implementation 'com.jakewharton.timber:timber:4.7.1'

app/src/main/java/sk/styk/martin/apkanalyzer/manager/appanalysis/AndroidManifestManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class AndroidManifestManager @Inject constructor(private val packageManager: Pac
125125

126126
while (eventType != XmlResourceParser.END_DOCUMENT) {
127127
if (eventType == XmlResourceParser.START_TAG) {
128-
if ("uses-sdk".equals(parser.name))
128+
if ("uses-sdk" == parser.name)
129129
return parser.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minSdkVersion", 0)
130130
}
131131
eventType = parser.next()

app/src/main/java/sk/styk/martin/apkanalyzer/manager/appanalysis/AppGeneralDataManager.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class AppGeneralDataManager @Inject constructor(
5858
fun computeApkSize(sourceDir: String): Long = File(sourceDir).length()
5959

6060
private fun getMinSdk(applicationInfo: ApplicationInfo, packageManager: PackageManager, analysisMode: AppDetailData.AnalysisMode): Int? =
61-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
62-
applicationInfo.minSdkVersion
63-
else if (analysisMode.toString() == AppDetailData.AnalysisMode.INSTALLED_PACKAGE.toString())
64-
AndroidManifestManager.getMinSdkVersion(applicationInfo, packageManager)
65-
else null
61+
when {
62+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> applicationInfo.minSdkVersion
63+
analysisMode.toString() == AppDetailData.AnalysisMode.INSTALLED_PACKAGE.toString() -> AndroidManifestManager.getMinSdkVersion(applicationInfo, packageManager)
64+
else -> null
65+
}
6666

6767
companion object {
6868
fun getAppSource(packageManager: PackageManager, packageName: String, isSystem: Boolean): AppSource {

app/src/main/java/sk/styk/martin/apkanalyzer/manager/appanalysis/DigestManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class DigestManager @Inject constructor(){
2626

2727
for (var6 in 0 until var5) {
2828
val aBArray = bArray[var6]
29-
val sTemp = Integer.toHexString(255 and aBArray.toChar().toInt())
29+
val sTemp = Integer.toHexString(255 and aBArray.toInt().toChar().code)
3030
if (sTemp.length < 2) {
3131
sb.append(0)
3232
}
3333

34-
sb.append(sTemp.toUpperCase(Locale.getDefault()))
34+
sb.append(sTemp.uppercase(Locale.getDefault()))
3535
}
3636

3737
return sb.toString()

app/src/main/java/sk/styk/martin/apkanalyzer/manager/appanalysis/FileDataManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class FileDataManager @Inject constructor() {
4545
fileName.startsWith("res/drawable") -> drawables.add(fileEntry)
4646
fileName.startsWith("res/layout") -> layouts.add(fileEntry)
4747
fileName.startsWith("res/menu") -> menus.add(fileEntry)
48-
"classes.dex".equals(fileName) -> dexHash = hash
49-
"resources.arsc".equals(fileName) -> arscHash = hash
50-
"AndroidManifest.xml".equals(fileName) -> manifestHash = hash
48+
"classes.dex" == fileName -> dexHash = hash
49+
"resources.arsc" == fileName -> arscHash = hash
50+
"AndroidManifest.xml" == fileName -> manifestHash = hash
5151
else -> others.add(fileEntry)
5252
}
5353

app/src/main/java/sk/styk/martin/apkanalyzer/manager/file/ApkSaveManager.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package sk.styk.martin.apkanalyzer.manager.file
33
import android.content.ContentResolver
44
import android.net.Uri
55
import androidx.annotation.IntRange
6-
import kotlinx.coroutines.FlowPreview
76
import kotlinx.coroutines.GlobalScope
87
import kotlinx.coroutines.flow.*
98
import kotlinx.coroutines.launch
@@ -18,7 +17,6 @@ import javax.inject.Inject
1817
import javax.inject.Singleton
1918

2019
@Singleton
21-
@OptIn(FlowPreview::class)
2220
class ApkSaveManager @Inject constructor(
2321
private val contentResolver: ContentResolver,
2422
private val notificationManager: NotificationManager,

app/src/main/java/sk/styk/martin/apkanalyzer/manager/navigationdrawer/NavigationDrawerModel.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package sk.styk.martin.apkanalyzer.manager.navigationdrawer
22

3-
import kotlinx.coroutines.ExperimentalCoroutinesApi
4-
import kotlinx.coroutines.FlowPreview
53
import kotlinx.coroutines.flow.MutableSharedFlow
64
import javax.inject.Inject
75
import javax.inject.Singleton
86

97
@Singleton
10-
@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class)
118
class NavigationDrawerModel @Inject constructor() {
129

1310
private val flow = MutableSharedFlow<Boolean>()

app/src/main/java/sk/styk/martin/apkanalyzer/manager/persistence/SettingsManager.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package sk.styk.martin.apkanalyzer.manager.persistence
22

33
import android.content.SharedPreferences
4-
import kotlinx.coroutines.ExperimentalCoroutinesApi
54
import sk.styk.martin.apkanalyzer.R
65
import sk.styk.martin.apkanalyzer.manager.resources.ResourcesManager
76
import javax.inject.Inject
87

9-
@OptIn(ExperimentalCoroutinesApi::class)
108
class SettingsManager @Inject constructor(
119
private val sharedPreferences: SharedPreferences,
1210
private val resourcesManager: ResourcesManager,

app/src/main/java/sk/styk/martin/apkanalyzer/ui/appdetail/AppActionsSpeedMenuAdapter.kt

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
package sk.styk.martin.apkanalyzer.ui.appdetail
22

3-
import kotlinx.coroutines.ExperimentalCoroutinesApi
4-
import kotlinx.coroutines.FlowPreview
5-
import kotlinx.coroutines.GlobalScope
3+
import kotlinx.coroutines.channels.BufferOverflow
64
import kotlinx.coroutines.flow.Flow
75
import kotlinx.coroutines.flow.MutableSharedFlow
8-
import kotlinx.coroutines.launch
96
import sk.styk.martin.apkanalyzer.R
107
import sk.styk.martin.apkanalyzer.views.SpeedDialMenuAdapter
118
import sk.styk.martin.apkanalyzer.views.SpeedDialMenuItem
129
import javax.inject.Inject
1310

14-
@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class)
1511
class AppActionsSpeedMenuAdapter @Inject constructor() : SpeedDialMenuAdapter() {
1612

1713
var menuItems: List<AppActions> = emptyList()
1814

19-
private val installAppFlow = MutableSharedFlow<Unit>()
15+
private val installAppFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
2016
val installApp: Flow<Unit> = installAppFlow
2117

22-
private val exportAppFlow = MutableSharedFlow<Unit>()
18+
private val exportAppFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
2319
val exportApp: Flow<Unit> = exportAppFlow
2420

25-
private val saveIconFlow = MutableSharedFlow<Unit>()
21+
private val saveIconFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
2622
val saveIcon: Flow<Unit> = saveIconFlow
2723

28-
private val showManifestFlow = MutableSharedFlow<Unit>()
24+
private val showManifestFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
2925
val showManifest: Flow<Unit> = showManifestFlow
3026

31-
private val openGooglePlayFlow = MutableSharedFlow<Unit>()
27+
private val openGooglePlayFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
3228
val openGooglePlay: Flow<Unit> = openGooglePlayFlow
3329

34-
private val openSystemInfoFlow = MutableSharedFlow<Unit>()
30+
private val openSystemInfoFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
3531
val openSystemInfo: Flow<Unit> = openSystemInfoFlow
3632

3733
enum class AppActions {
@@ -55,15 +51,13 @@ class AppActionsSpeedMenuAdapter @Inject constructor() : SpeedDialMenuAdapter()
5551
}
5652

5753
override fun onMenuItemClick(position: Int): Boolean {
58-
GlobalScope.launch {
59-
when (menuItems[position]) {
60-
AppActions.INSTALL -> installAppFlow.emit(Unit)
61-
AppActions.EXPORT_APK -> exportAppFlow.emit(Unit)
62-
AppActions.SAVE_ICON -> saveIconFlow.emit(Unit)
63-
AppActions.SHOW_MANIFEST -> showManifestFlow.emit(Unit)
64-
AppActions.OPEN_PLAY -> openGooglePlayFlow.emit(Unit)
65-
AppActions.BUILD_INFO -> openSystemInfoFlow.emit(Unit)
66-
}
54+
when (menuItems[position]) {
55+
AppActions.INSTALL -> installAppFlow.tryEmit(Unit)
56+
AppActions.EXPORT_APK -> exportAppFlow.tryEmit(Unit)
57+
AppActions.SAVE_ICON -> saveIconFlow.tryEmit(Unit)
58+
AppActions.SHOW_MANIFEST -> showManifestFlow.tryEmit(Unit)
59+
AppActions.OPEN_PLAY -> openGooglePlayFlow.tryEmit(Unit)
60+
AppActions.BUILD_INFO -> openSystemInfoFlow.tryEmit(Unit)
6761
}
6862
return true
6963
}

app/src/main/java/sk/styk/martin/apkanalyzer/ui/appdetail/AppDetailFragmentViewModel.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.google.android.material.snackbar.Snackbar
1616
import dagger.assisted.Assisted
1717
import dagger.assisted.AssistedFactory
1818
import dagger.assisted.AssistedInject
19-
import kotlinx.coroutines.ExperimentalCoroutinesApi
2019
import kotlinx.coroutines.flow.collect
2120
import kotlinx.coroutines.launch
2221
import kotlinx.coroutines.withContext
@@ -47,7 +46,6 @@ internal const val DATA_STATE = 2
4746

4847
private const val ANALYZED_APK_NAME = "analyzed.apk"
4948

50-
@OptIn(ExperimentalCoroutinesApi::class)
5149
class AppDetailFragmentViewModel @AssistedInject constructor(
5250
@Assisted val appDetailRequest: AppDetailRequest,
5351
private val dispatcherProvider: DispatcherProvider,

0 commit comments

Comments
 (0)