Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5408810 authored by Hasib Prince's avatar Hasib Prince
Browse files

resolved conflict: merging main into epic59

parents 1bdf0ff3 baf08fd6
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -138,7 +138,10 @@ ktlintRelease:
pushToPrebuilt:
  stage: publish
  needs: ["buildRelease"]
  rules:
    - if: '$CI_COMMIT_TAG !~ "/^$/"'
      when: manual
    - when: never
  variables:
    NEW_APK_PATH: "app/build/outputs/apk/release/"
  before_script:
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ App Lounge is an open-source application that allows you to install Android apps
App Lounge use the _Packaging by Features_ approach for packaging the code. A really good explanation for this approach can be found on Philip Hauer's [Package by Feature](https://web.archive.org/web/20211025104408/https://phauer.com/2020/package-by-feature/) blog post.

```
.
./root
├── api
│   ├── cleanapk
│   │   ├── blockedApps
+22 −20
Original line number Diff line number Diff line
@@ -5,13 +5,13 @@ plugins {
    id 'kotlin-kapt'
    id 'org.jlleitschuh.gradle.ktlint' version '10.2.0'
    id 'androidx.navigation.safeargs.kotlin'
    id 'dagger.hilt.android.plugin'
    id 'com.google.dagger.hilt.android'
    id 'kotlin-allopen'
}

def versionMajor = 2
def versionMinor = 4
def versionPatch = 7
def versionMinor = 5
def versionPatch = 1

def getGitHash = { ->
    def stdOut = new ByteArrayOutputStream()
@@ -42,7 +42,7 @@ def getSentryDsn = { ->
}

android {
    compileSdk 31
    compileSdk 33

    defaultConfig {
        applicationId "foundation.e.apps"
@@ -91,6 +91,7 @@ android {
    buildTypes {
        debug {
            versionNameSuffix ".debug"
            applicationIdSuffix ".debug"
            signingConfig signingConfigs.debugConfig
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
@@ -149,11 +150,12 @@ dependencies {
    // TODO: Add splitinstall-lib to a repo https://gitlab.e.foundation/e/os/backlog/-/issues/628
    api files('libs/splitinstall-lib.jar')

    implementation 'foundation.e.lib:telemetry:0.0.4-alpha'
    implementation 'foundation.e.lib:telemetry:0.0.7-alpha'

    implementation 'foundation.e:gplayapi:3.0.1'
    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.fragment:fragment-ktx:1.5.6'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
@@ -164,16 +166,16 @@ dependencies {
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
    testImplementation "com.google.truth:truth:1.1.3"
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    // Optional -- Robolectric environment
    testImplementation "androidx.test:core:1.4.0"
    testImplementation "androidx.test:core:1.5.0"
    // Optional -- Mockito framework
    testImplementation "org.mockito:mockito-core:4.6.1"
    testImplementation "org.mockito:mockito-core:5.0.0"
    // Optional -- mockito-kotlin
    testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
    testImplementation 'org.mockito:mockito-inline:2.13.0'
    testImplementation "androidx.arch.core:core-testing:2.1.0"
    testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0"
    testImplementation 'org.mockito:mockito-inline:5.0.0'
    testImplementation "androidx.arch.core:core-testing:2.2.0"

    testImplementation "io.mockk:mockk:1.12.3"

@@ -182,8 +184,8 @@ dependencies {
    implementation 'com.github.Baseflow:PhotoView:2.3.0'

    //Protobuf and Gson
    implementation 'com.google.code.gson:gson:2.8.9'
    implementation "com.google.protobuf:protobuf-java:3.14.0"
    implementation 'com.google.code.gson:gson:2.9.0'
    implementation "com.google.protobuf:protobuf-java:3.17.2"

    // ViewPager2 and RecyclerView
    implementation "androidx.viewpager2:viewpager2:1.0.0"
@@ -211,19 +213,19 @@ dependencies {
    implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2"

    // Navigation Components
    def navigation_version = "2.3.5"
    def navigation_version = "2.5.3"
    implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
    implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"

    // Hilt
    def hilt_version = '2.40.5'
    kapt "com.google.dagger:hilt-compiler:$hilt_version"
    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-compiler:2.44.2"
    implementation "com.google.dagger:hilt-android:2.44.2"
    implementation 'androidx.hilt:hilt-work:1.0.0'
    kapt 'androidx.hilt:hilt-compiler:1.0.0'

    // Lifecycle Components
    def lifecycle_version = "2.4.0"
    def lifecycle_version = "2.6.1"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
    implementation "android.arch.lifecycle:extensions:1.1.1"
+12 −3
Original line number Diff line number Diff line
@@ -22,12 +22,15 @@ import android.app.Application
import android.util.Log
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import androidx.work.ExistingPeriodicWorkPolicy
import dagger.hilt.android.HiltAndroidApp
import foundation.e.apps.manager.pkg.PkgManagerBR
import foundation.e.apps.manager.pkg.PkgManagerModule
import foundation.e.apps.manager.workmanager.InstallWorkManager
import foundation.e.apps.setup.tos.TOS_VERSION
import foundation.e.apps.updates.manager.UpdatesWorkManager
import foundation.e.apps.utils.modules.DataStoreModule
import foundation.e.apps.utils.modules.PreferenceManagerModule
import foundation.e.lib.telemetry.Telemetry
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.MainScope
@@ -50,6 +53,9 @@ class AppLoungeApplication : Application(), Configuration.Provider {
    @Inject
    lateinit var dataStoreModule: DataStoreModule

    @Inject
    lateinit var preferenceManagerModule: PreferenceManagerModule

    override fun onCreate() {
        super.onCreate()

@@ -75,13 +81,16 @@ class AppLoungeApplication : Application(), Configuration.Provider {
                    if (priority < Log.WARN) {
                        return
                    }
                    if (priority == Log.ERROR) {
                        Telemetry.reportMessage("$tag: $message")
                    }
                    Log.println(priority, tag, message)
                }
            })
        }

        UpdatesWorkManager.enqueueWork(
            this,
            preferenceManagerModule.getUpdateInterval(),
            ExistingPeriodicWorkPolicy.KEEP
        )
    }

    override fun getWorkManagerConfiguration() =
+20 −2
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ import foundation.e.apps.utils.eventBus.AppEvent
import foundation.e.apps.utils.eventBus.EventBus
import foundation.e.apps.utils.exceptions.GPlayValidationException
import foundation.e.apps.utils.modules.CommonUtilsFunctions
import foundation.e.apps.utils.modules.CommonUtilsModule
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.launch
import timber.log.Timber
@@ -131,7 +131,10 @@ class MainActivity : AppCompatActivity() {
                    viewModel.gPlayAuthData = data as AuthData
                } else if (exception is GPlayValidationException) {
                    val email = otherPayload.toString()
                    viewModel.uploadFaultyTokenToEcloud(email, CommonUtilsFunctions.getAppBuildInfo())
                    viewModel.uploadFaultyTokenToEcloud(
                        email,
                        CommonUtilsFunctions.getAppBuildInfo()
                    )
                }
            }
        }
@@ -214,6 +217,8 @@ class MainActivity : AppCompatActivity() {
        viewModel.updateAppWarningList()

        lifecycleScope.launchWhenResumed {
            observeInvalidAuth()

            EventBus.events.filter { appEvent ->
                appEvent is AppEvent.SignatureMissMatchError
            }.collectLatest {
@@ -227,6 +232,19 @@ class MainActivity : AppCompatActivity() {
        }
    }

    private suspend fun observeInvalidAuth() {
        EventBus.events.filter { appEvent ->
            appEvent is AppEvent.InvalidAuthEvent
        }.distinctUntilChanged { old, new ->
            ((old.data is String) && (new.data is String) && old.data == new.data)
        }.collectLatest {
            val data = it.data as String
            if (data.isNotBlank()) {
                loginViewModel.markInvalidAuthObject(data)
            }
        }
    }

    private fun setupBottomNavItemSelectedListener(
        bottomNavigationView: BottomNavigationView,
        navHostFragment: NavHostFragment,
Loading