Adapt to new API changes related to helpers

This commit is contained in:
Rahul Kumar Patel
2021-02-19 00:59:35 +05:30
parent 0bbbde655e
commit 87a5bb3994
18 changed files with 22 additions and 36 deletions

View File

@@ -172,7 +172,7 @@ dependencies {
implementation "com.github.topjohnwu.libsu:core:${versions.libsu}" implementation "com.github.topjohnwu.libsu:core:${versions.libsu}"
//Love <3 //Love <3
api("com.gitlab.AuroraOSS:gplayapi:514f061739") api("com.gitlab.AuroraOSS:gplayapi:82843a04ce")
} }
Properties props = new Properties() Properties props = new Properties()

View File

@@ -227,7 +227,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
private fun fetchCompleteApp() { private fun fetchCompleteApp() {
task { task {
val authData = AuthProvider.with(this).getAuthData() val authData = AuthProvider.with(this).getAuthData()
return@task AppDetailsHelper.with(authData) return@task AppDetailsHelper(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
.getAppByPackageName(app.packageName) .getAppByPackageName(app.packageName)
} successUi { } successUi {
@@ -324,8 +324,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
.with(this) .with(this)
.getAuthData() .getAuthData()
PurchaseHelper PurchaseHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
.purchase(app.packageName, app.versionCode, app.offerType) .purchase(app.packageName, app.versionCode, app.offerType)
} successUi { } successUi {

View File

@@ -262,8 +262,7 @@ abstract class BaseDetailsActivity : BaseActivity() {
) { ) {
task { task {
val authData = AuthProvider.with(this).getAuthData() val authData = AuthProvider.with(this).getAuthData()
ReviewsHelper ReviewsHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
.addOrEditReview( .addOrEditReview(
app.packageName, app.packageName,
@@ -286,8 +285,7 @@ abstract class BaseDetailsActivity : BaseActivity() {
val authData = AuthProvider val authData = AuthProvider
.with(this) .with(this)
.getAuthData() .getAuthData()
val reviewsHelper = ReviewsHelper val reviewsHelper = ReviewsHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
return reviewsHelper.getReviews(app.packageName, Review.Filter.CRITICAL) return reviewsHelper.getReviews(app.packageName, Review.Filter.CRITICAL)
} }

View File

@@ -143,8 +143,7 @@ class DetailsMoreActivity : BaseActivity() {
.with(this) .with(this)
.getAuthData() .getAuthData()
task { task {
AppDetailsHelper AppDetailsHelper(authData)
.with(authData)
.getAppByPackageName(app.dependencies.dependentPackages) .getAppByPackageName(app.dependencies.dependentPackages)
} successUi { } successUi {
B.recyclerDependency.withModels { B.recyclerDependency.withModels {

View File

@@ -81,7 +81,7 @@ class UpdatesFragment : BaseFragment() {
VM = ViewModelProvider(requireActivity()).get(UpdatesViewModel::class.java) VM = ViewModelProvider(requireActivity()).get(UpdatesViewModel::class.java)
authData = AuthProvider.with(requireContext()).getAuthData() authData = AuthProvider.with(requireContext()).getAuthData()
purchaseHelper = PurchaseHelper.with(authData) purchaseHelper = PurchaseHelper(authData)
fetch = DownloadManager.with(requireContext()).fetch fetch = DownloadManager.with(requireContext()).fetch
fetchListener = object : AbstractFetchGroupListener() { fetchListener = object : AbstractFetchGroupListener() {

View File

@@ -34,14 +34,12 @@ import java.util.*
abstract class BaseAppsViewModel(application: Application) : BaseAndroidViewModel(application) { abstract class BaseAppsViewModel(application: Application) : BaseAndroidViewModel(application) {
val authData = AuthProvider private val authData = AuthProvider
.with(application) .with(application)
.getAuthData() .getAuthData()
val appDetailsHelper = private val appDetailsHelper = AppDetailsHelper(authData)
AppDetailsHelper .using(HttpClient.getPreferredClient())
.with(authData)
.using(HttpClient.getPreferredClient())
var blacklistProvider = BlacklistProvider var blacklistProvider = BlacklistProvider
.with(application) .with(application)

View File

@@ -37,7 +37,7 @@ class LibraryAppsViewModel(application: Application) : BaseAndroidViewModel(appl
private val authData: AuthData = AuthProvider.with(application).getAuthData() private val authData: AuthData = AuthProvider.with(application).getAuthData()
private val clusterHelper: ClusterHelper = private val clusterHelper: ClusterHelper =
ClusterHelper.with(authData).using(HttpClient.getPreferredClient()) ClusterHelper(authData).using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<StreamCluster> = MutableLiveData() val liveData: MutableLiveData<StreamCluster> = MutableLiveData()
var streamCluster: StreamCluster = StreamCluster() var streamCluster: StreamCluster = StreamCluster()

View File

@@ -169,7 +169,7 @@ class AuthViewModel(application: Application) : BaseAndroidViewModel(application
private fun isValid(authData: AuthData): Boolean { private fun isValid(authData: AuthData): Boolean {
return try { return try {
AuthValidator.with(authData) AuthValidator(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
.isValid() .isValid()
} catch (e: Exception) { } catch (e: Exception) {

View File

@@ -37,8 +37,7 @@ import kotlinx.coroutines.supervisorScope
class StreamBrowseViewModel(application: Application) : BaseAndroidViewModel(application) { class StreamBrowseViewModel(application: Application) : BaseAndroidViewModel(application) {
private val authData: AuthData = AuthProvider.with(application).getAuthData() private val authData: AuthData = AuthProvider.with(application).getAuthData()
private val streamHelper: StreamHelper = StreamHelper private val streamHelper: StreamHelper = StreamHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<StreamCluster> = MutableLiveData() val liveData: MutableLiveData<StreamCluster> = MutableLiveData()

View File

@@ -38,8 +38,7 @@ abstract class BaseCategoryViewModel(application: Application) : BaseAndroidView
.with(application) .with(application)
.getAuthData() .getAuthData()
private val streamHelper: CategoryHelper = CategoryHelper private val streamHelper: CategoryHelper = CategoryHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<List<Category>> = MutableLiveData() val liveData: MutableLiveData<List<Category>> = MutableLiveData()

View File

@@ -39,8 +39,7 @@ open class BaseEditorChoiceViewModel(application: Application) : BaseAndroidView
.with(application) .with(application)
.getAuthData() .getAuthData()
private val streamHelper: StreamHelper = StreamHelper private val streamHelper: StreamHelper = StreamHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
lateinit var category: StreamHelper.Category lateinit var category: StreamHelper.Category

View File

@@ -39,8 +39,7 @@ import kotlinx.coroutines.supervisorScope
abstract class BaseClusterViewModel(application: Application) : BaseAndroidViewModel(application) { abstract class BaseClusterViewModel(application: Application) : BaseAndroidViewModel(application) {
var authData: AuthData = AuthProvider.with(application).getAuthData() var authData: AuthData = AuthProvider.with(application).getAuthData()
var streamHelper: StreamHelper = StreamHelper var streamHelper: StreamHelper = StreamHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<ViewState> = MutableLiveData() val liveData: MutableLiveData<ViewState> = MutableLiveData()

View File

@@ -40,8 +40,7 @@ class ReviewViewModel(application: Application) : BaseAndroidViewModel(applicati
.with(application) .with(application)
.getAuthData() .getAuthData()
var reviewsHelper: ReviewsHelper = ReviewsHelper var reviewsHelper: ReviewsHelper = ReviewsHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<ViewState> = MutableLiveData() val liveData: MutableLiveData<ViewState> = MutableLiveData()

View File

@@ -35,7 +35,7 @@ class AppSalesViewModel(application: Application) : AndroidViewModel(application
private val authData: AuthData = AuthProvider.with(application).getAuthData() private val authData: AuthData = AuthProvider.with(application).getAuthData()
private val appSalesHelper: AppSalesHelper = private val appSalesHelper: AppSalesHelper =
AppSalesHelper.with(authData).using(HttpClient.getPreferredClient()) AppSalesHelper(authData).using(HttpClient.getPreferredClient())
val liveAppList: MutableLiveData<List<App>> = MutableLiveData() val liveAppList: MutableLiveData<List<App>> = MutableLiveData()

View File

@@ -39,8 +39,7 @@ class SearchResultViewModel(application: Application) : AndroidViewModel(applica
.with(application) .with(application)
.getAuthData() .getAuthData()
private val searchHelper: SearchHelper = SearchHelper private val searchHelper: SearchHelper = SearchHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<SearchBundle> = MutableLiveData() val liveData: MutableLiveData<SearchBundle> = MutableLiveData()

View File

@@ -37,8 +37,7 @@ class SearchSuggestionViewModel(application: Application) : AndroidViewModel(app
.with(application) .with(application)
.getAuthData() .getAuthData()
private val searchHelper: SearchHelper = SearchHelper private val searchHelper: SearchHelper = SearchHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveSearchSuggestions: MutableLiveData<List<SearchSuggestEntry>> = MutableLiveData() val liveSearchSuggestions: MutableLiveData<List<SearchSuggestEntry>> = MutableLiveData()

View File

@@ -39,8 +39,7 @@ import kotlinx.coroutines.supervisorScope
class SubCategoryClusterViewModel(application: Application) : BaseAndroidViewModel(application) { class SubCategoryClusterViewModel(application: Application) : BaseAndroidViewModel(application) {
var authData: AuthData = AuthProvider.with(application).getAuthData() var authData: AuthData = AuthProvider.with(application).getAuthData()
var categoryHelper: CategoryHelper = CategoryHelper var categoryHelper: CategoryHelper = CategoryHelper(authData)
.with(authData)
.using(HttpClient.getPreferredClient()) .using(HttpClient.getPreferredClient())
val liveData: MutableLiveData<ViewState> = MutableLiveData() val liveData: MutableLiveData<ViewState> = MutableLiveData()

View File

@@ -37,7 +37,7 @@ abstract class BaseChartViewModel(application: Application) : BaseAndroidViewMod
private val authData: AuthData = AuthProvider.with(application).getAuthData() private val authData: AuthData = AuthProvider.with(application).getAuthData()
private val topChartsHelper: TopChartsHelper = private val topChartsHelper: TopChartsHelper =
TopChartsHelper.with(authData).using(HttpClient.getPreferredClient()) TopChartsHelper(authData).using(HttpClient.getPreferredClient())
lateinit var type: TopChartsHelper.Type lateinit var type: TopChartsHelper.Type
lateinit var chart: TopChartsHelper.Chart lateinit var chart: TopChartsHelper.Chart