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

Commit 3d146ea1 authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch 'permission_list_#4489' into epic_176-all-refactorAndGplay

parents cdda2a9b a10c1a54
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+14 −4
Original line number Diff line number Diff line
@@ -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
@@ -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 {
+2 −2
Original line number Diff line number Diff line
@@ -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>>
}
+8 −6
Original line number Diff line number Diff line
package foundation.e.apps.api.exodus

import com.squareup.moshi.Json

data class TrackerInfo(
    val name: String,
    val creator: String,
@@ -7,10 +9,10 @@ data class TrackerInfo(
)

data class Report(
    val id: Long,
    val creationDate: String,
    val updatedAt: String,
    val version: String,
    val versionCode: String,
    val trackers: List<Long>
    val id: Long = System.currentTimeMillis(),
    @Json(name = "updated") val updatedAt: String,
    @Json(name = "version_name") val version: String,
    @Json(name = "version_code") val versionCode: String,
    val trackers: List<Long>,
    val permissions: List<String> = listOf()
)
+3 −0
Original line number Diff line number Diff line
package foundation.e.apps.api.exodus.models

data class AppPrivacyInfo(val trackerList: List<String> = listOf(), val permissionList: List<String> = listOf())
Loading