Loading app/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,8 @@ dependencies { def retrofit_version = "2.9.0" implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version" implementation "com.squareup.moshi:moshi-kotlin:1.13.0" // implementation "com.squareup.moshi:moshi-adapters:1.5.0" implementation "com.squareup.okhttp3:okhttp:4.9.2" // Navigation Components Loading app/src/main/java/foundation/e/apps/MainActivity.kt +13 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.NavOptions import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.setupWithNavController import com.aurora.gplayapi.exceptions.ApiException import com.google.android.material.snackbar.Snackbar import dagger.hilt.android.AndroidEntryPoint import foundation.e.apps.databinding.ActivityMainBinding import foundation.e.apps.manager.workmanager.InstallWorkManager Loading Loading @@ -167,11 +169,22 @@ class MainActivity : AppCompatActivity() { } } viewModel.errorMessage.observe(this) { when (it) { is ApiException.AppNotPurchased -> showSnackbarMessage(getString(R.string.message_app_available_later)) else -> showSnackbarMessage(it.localizedMessage ?: getString(R.string.unknown_error)) } } if (!CommonUtilsModule.isNetworkAvailable(this)) { showNoInternet() } } private fun showSnackbarMessage(message: String) { Snackbar.make(binding.root, message, Snackbar.LENGTH_SHORT).show() } private fun showNoInternet() { binding.noInternet.visibility = View.VISIBLE binding.fragment.visibility = View.GONE Loading app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +25 −16 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ class MainActivityViewModel @Inject constructor( // Downloads val downloadList = fusedManagerRepository.getDownloadLiveList() var installInProgress = false private val _errorMessage = MutableLiveData<Exception>() val errorMessage: LiveData<Exception> = _errorMessage /* * Authentication related functions */ Loading Loading @@ -120,10 +121,13 @@ class MainActivityViewModel @Inject constructor( fun getApplication(app: FusedApp, imageView: ImageView?) { viewModelScope.launch { val fusedDownload: FusedDownload try { val appIcon = imageView?.let { getImageBase64(it) } ?: "" val downloadList = getAppDownloadLink(app).toMutableList() val downloadList: List<String> downloadList = getAppDownloadLink(app).toMutableList() val fusedDownload = FusedDownload( fusedDownload = FusedDownload( app._id, app.origin, app.status, Loading @@ -135,6 +139,11 @@ class MainActivityViewModel @Inject constructor( app.type, appIcon ) } catch (e: Exception) { _errorMessage.value = e return@launch } if (fusedDownload.status == Status.INSTALLATION_ISSUE) { fusedManagerRepository.clearInstallationIssue(fusedDownload) } Loading app/src/main/java/foundation/e/apps/api/cleanapk/RetrofitModule.kt +14 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ package foundation.e.apps.api.cleanapk import android.os.Build import android.util.Log import com.squareup.moshi.Moshi import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import dagger.Module import dagger.Provides import dagger.hilt.InstallIn Loading Loading @@ -47,26 +49,34 @@ object RetrofitModule { */ @Singleton @Provides fun provideCleanAPKInterface(okHttpClient: OkHttpClient): CleanAPKInterface { fun provideCleanAPKInterface(okHttpClient: OkHttpClient, moshi: Moshi): CleanAPKInterface { return Retrofit.Builder() .baseUrl(CleanAPKInterface.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create()) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(CleanAPKInterface::class.java) } @Singleton @Provides fun provideExodusApi(okHttpClient: OkHttpClient): ExodusTrackerApi { fun provideExodusApi(okHttpClient: OkHttpClient, moshi: Moshi): ExodusTrackerApi { return Retrofit.Builder() .baseUrl(ExodusTrackerApi.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create()) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(ExodusTrackerApi::class.java) } @Singleton @Provides fun getMoshi(): Moshi { return Moshi.Builder() .add(KotlinJsonAdapterFactory()) .build() } @Singleton @Provides fun provideInterceptor(): Interceptor { Loading app/src/main/java/foundation/e/apps/api/exodus/ExodusTrackerApi.kt +2 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ interface ExodusTrackerApi { @GET("trackers?v=$VERSION") suspend fun getTrackerList(): Response<Trackers> @GET("search/{appHandle}") suspend fun getTrackerInfoOfApp(@Path("appHandle") appHandle: String): Response<Map<String, TrackerInfo>> @GET("search/{appHandle}/details?v=$VERSION") suspend fun getTrackerInfoOfApp(@Path("appHandle") appHandle: String): Response<List<Report>> } Loading
app/build.gradle +2 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,8 @@ dependencies { def retrofit_version = "2.9.0" implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version" implementation "com.squareup.moshi:moshi-kotlin:1.13.0" // implementation "com.squareup.moshi:moshi-adapters:1.5.0" implementation "com.squareup.okhttp3:okhttp:4.9.2" // Navigation Components Loading
app/src/main/java/foundation/e/apps/MainActivity.kt +13 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import androidx.lifecycle.lifecycleScope import androidx.navigation.NavOptions import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.setupWithNavController import com.aurora.gplayapi.exceptions.ApiException import com.google.android.material.snackbar.Snackbar import dagger.hilt.android.AndroidEntryPoint import foundation.e.apps.databinding.ActivityMainBinding import foundation.e.apps.manager.workmanager.InstallWorkManager Loading Loading @@ -167,11 +169,22 @@ class MainActivity : AppCompatActivity() { } } viewModel.errorMessage.observe(this) { when (it) { is ApiException.AppNotPurchased -> showSnackbarMessage(getString(R.string.message_app_available_later)) else -> showSnackbarMessage(it.localizedMessage ?: getString(R.string.unknown_error)) } } if (!CommonUtilsModule.isNetworkAvailable(this)) { showNoInternet() } } private fun showSnackbarMessage(message: String) { Snackbar.make(binding.root, message, Snackbar.LENGTH_SHORT).show() } private fun showNoInternet() { binding.noInternet.visibility = View.VISIBLE binding.fragment.visibility = View.GONE Loading
app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +25 −16 Original line number Diff line number Diff line Loading @@ -66,7 +66,8 @@ class MainActivityViewModel @Inject constructor( // Downloads val downloadList = fusedManagerRepository.getDownloadLiveList() var installInProgress = false private val _errorMessage = MutableLiveData<Exception>() val errorMessage: LiveData<Exception> = _errorMessage /* * Authentication related functions */ Loading Loading @@ -120,10 +121,13 @@ class MainActivityViewModel @Inject constructor( fun getApplication(app: FusedApp, imageView: ImageView?) { viewModelScope.launch { val fusedDownload: FusedDownload try { val appIcon = imageView?.let { getImageBase64(it) } ?: "" val downloadList = getAppDownloadLink(app).toMutableList() val downloadList: List<String> downloadList = getAppDownloadLink(app).toMutableList() val fusedDownload = FusedDownload( fusedDownload = FusedDownload( app._id, app.origin, app.status, Loading @@ -135,6 +139,11 @@ class MainActivityViewModel @Inject constructor( app.type, appIcon ) } catch (e: Exception) { _errorMessage.value = e return@launch } if (fusedDownload.status == Status.INSTALLATION_ISSUE) { fusedManagerRepository.clearInstallationIssue(fusedDownload) } Loading
app/src/main/java/foundation/e/apps/api/cleanapk/RetrofitModule.kt +14 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ package foundation.e.apps.api.cleanapk import android.os.Build import android.util.Log import com.squareup.moshi.Moshi import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import dagger.Module import dagger.Provides import dagger.hilt.InstallIn Loading Loading @@ -47,26 +49,34 @@ object RetrofitModule { */ @Singleton @Provides fun provideCleanAPKInterface(okHttpClient: OkHttpClient): CleanAPKInterface { fun provideCleanAPKInterface(okHttpClient: OkHttpClient, moshi: Moshi): CleanAPKInterface { return Retrofit.Builder() .baseUrl(CleanAPKInterface.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create()) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(CleanAPKInterface::class.java) } @Singleton @Provides fun provideExodusApi(okHttpClient: OkHttpClient): ExodusTrackerApi { fun provideExodusApi(okHttpClient: OkHttpClient, moshi: Moshi): ExodusTrackerApi { return Retrofit.Builder() .baseUrl(ExodusTrackerApi.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create()) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(ExodusTrackerApi::class.java) } @Singleton @Provides fun getMoshi(): Moshi { return Moshi.Builder() .add(KotlinJsonAdapterFactory()) .build() } @Singleton @Provides fun provideInterceptor(): Interceptor { Loading
app/src/main/java/foundation/e/apps/api/exodus/ExodusTrackerApi.kt +2 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ interface ExodusTrackerApi { @GET("trackers?v=$VERSION") suspend fun getTrackerList(): Response<Trackers> @GET("search/{appHandle}") suspend fun getTrackerInfoOfApp(@Path("appHandle") appHandle: String): Response<Map<String, TrackerInfo>> @GET("search/{appHandle}/details?v=$VERSION") suspend fun getTrackerInfoOfApp(@Path("appHandle") appHandle: String): Response<List<Report>> }