mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-12 01:38:35 -04:00
Adapt to new API changes related to helpers
This commit is contained in:
@@ -172,7 +172,7 @@ dependencies {
|
||||
implementation "com.github.topjohnwu.libsu:core:${versions.libsu}"
|
||||
|
||||
//Love <3
|
||||
api("com.gitlab.AuroraOSS:gplayapi:514f061739")
|
||||
api("com.gitlab.AuroraOSS:gplayapi:82843a04ce")
|
||||
}
|
||||
|
||||
Properties props = new Properties()
|
||||
|
||||
@@ -227,7 +227,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
|
||||
private fun fetchCompleteApp() {
|
||||
task {
|
||||
val authData = AuthProvider.with(this).getAuthData()
|
||||
return@task AppDetailsHelper.with(authData)
|
||||
return@task AppDetailsHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
.getAppByPackageName(app.packageName)
|
||||
} successUi {
|
||||
@@ -324,8 +324,7 @@ class AppDetailsActivity : BaseDetailsActivity() {
|
||||
.with(this)
|
||||
.getAuthData()
|
||||
|
||||
PurchaseHelper
|
||||
.with(authData)
|
||||
PurchaseHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
.purchase(app.packageName, app.versionCode, app.offerType)
|
||||
} successUi {
|
||||
|
||||
@@ -262,8 +262,7 @@ abstract class BaseDetailsActivity : BaseActivity() {
|
||||
) {
|
||||
task {
|
||||
val authData = AuthProvider.with(this).getAuthData()
|
||||
ReviewsHelper
|
||||
.with(authData)
|
||||
ReviewsHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
.addOrEditReview(
|
||||
app.packageName,
|
||||
@@ -286,8 +285,7 @@ abstract class BaseDetailsActivity : BaseActivity() {
|
||||
val authData = AuthProvider
|
||||
.with(this)
|
||||
.getAuthData()
|
||||
val reviewsHelper = ReviewsHelper
|
||||
.with(authData)
|
||||
val reviewsHelper = ReviewsHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
return reviewsHelper.getReviews(app.packageName, Review.Filter.CRITICAL)
|
||||
}
|
||||
|
||||
@@ -143,8 +143,7 @@ class DetailsMoreActivity : BaseActivity() {
|
||||
.with(this)
|
||||
.getAuthData()
|
||||
task {
|
||||
AppDetailsHelper
|
||||
.with(authData)
|
||||
AppDetailsHelper(authData)
|
||||
.getAppByPackageName(app.dependencies.dependentPackages)
|
||||
} successUi {
|
||||
B.recyclerDependency.withModels {
|
||||
|
||||
@@ -81,7 +81,7 @@ class UpdatesFragment : BaseFragment() {
|
||||
VM = ViewModelProvider(requireActivity()).get(UpdatesViewModel::class.java)
|
||||
|
||||
authData = AuthProvider.with(requireContext()).getAuthData()
|
||||
purchaseHelper = PurchaseHelper.with(authData)
|
||||
purchaseHelper = PurchaseHelper(authData)
|
||||
|
||||
fetch = DownloadManager.with(requireContext()).fetch
|
||||
fetchListener = object : AbstractFetchGroupListener() {
|
||||
|
||||
@@ -34,14 +34,12 @@ import java.util.*
|
||||
|
||||
abstract class BaseAppsViewModel(application: Application) : BaseAndroidViewModel(application) {
|
||||
|
||||
val authData = AuthProvider
|
||||
private val authData = AuthProvider
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
val appDetailsHelper =
|
||||
AppDetailsHelper
|
||||
.with(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
private val appDetailsHelper = AppDetailsHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
var blacklistProvider = BlacklistProvider
|
||||
.with(application)
|
||||
|
||||
@@ -37,7 +37,7 @@ class LibraryAppsViewModel(application: Application) : BaseAndroidViewModel(appl
|
||||
|
||||
private val authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
private val clusterHelper: ClusterHelper =
|
||||
ClusterHelper.with(authData).using(HttpClient.getPreferredClient())
|
||||
ClusterHelper(authData).using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<StreamCluster> = MutableLiveData()
|
||||
var streamCluster: StreamCluster = StreamCluster()
|
||||
|
||||
@@ -169,7 +169,7 @@ class AuthViewModel(application: Application) : BaseAndroidViewModel(application
|
||||
|
||||
private fun isValid(authData: AuthData): Boolean {
|
||||
return try {
|
||||
AuthValidator.with(authData)
|
||||
AuthValidator(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
.isValid()
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -37,8 +37,7 @@ import kotlinx.coroutines.supervisorScope
|
||||
class StreamBrowseViewModel(application: Application) : BaseAndroidViewModel(application) {
|
||||
|
||||
private val authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
private val streamHelper: StreamHelper = StreamHelper
|
||||
.with(authData)
|
||||
private val streamHelper: StreamHelper = StreamHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<StreamCluster> = MutableLiveData()
|
||||
|
||||
@@ -38,8 +38,7 @@ abstract class BaseCategoryViewModel(application: Application) : BaseAndroidView
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
private val streamHelper: CategoryHelper = CategoryHelper
|
||||
.with(authData)
|
||||
private val streamHelper: CategoryHelper = CategoryHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<List<Category>> = MutableLiveData()
|
||||
|
||||
@@ -39,8 +39,7 @@ open class BaseEditorChoiceViewModel(application: Application) : BaseAndroidView
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
private val streamHelper: StreamHelper = StreamHelper
|
||||
.with(authData)
|
||||
private val streamHelper: StreamHelper = StreamHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
lateinit var category: StreamHelper.Category
|
||||
|
||||
@@ -39,8 +39,7 @@ import kotlinx.coroutines.supervisorScope
|
||||
abstract class BaseClusterViewModel(application: Application) : BaseAndroidViewModel(application) {
|
||||
|
||||
var authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
var streamHelper: StreamHelper = StreamHelper
|
||||
.with(authData)
|
||||
var streamHelper: StreamHelper = StreamHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<ViewState> = MutableLiveData()
|
||||
|
||||
@@ -40,8 +40,7 @@ class ReviewViewModel(application: Application) : BaseAndroidViewModel(applicati
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
var reviewsHelper: ReviewsHelper = ReviewsHelper
|
||||
.with(authData)
|
||||
var reviewsHelper: ReviewsHelper = ReviewsHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<ViewState> = MutableLiveData()
|
||||
|
||||
@@ -35,7 +35,7 @@ class AppSalesViewModel(application: Application) : AndroidViewModel(application
|
||||
|
||||
private val authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
private val appSalesHelper: AppSalesHelper =
|
||||
AppSalesHelper.with(authData).using(HttpClient.getPreferredClient())
|
||||
AppSalesHelper(authData).using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveAppList: MutableLiveData<List<App>> = MutableLiveData()
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ class SearchResultViewModel(application: Application) : AndroidViewModel(applica
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
private val searchHelper: SearchHelper = SearchHelper
|
||||
.with(authData)
|
||||
private val searchHelper: SearchHelper = SearchHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<SearchBundle> = MutableLiveData()
|
||||
|
||||
@@ -37,8 +37,7 @@ class SearchSuggestionViewModel(application: Application) : AndroidViewModel(app
|
||||
.with(application)
|
||||
.getAuthData()
|
||||
|
||||
private val searchHelper: SearchHelper = SearchHelper
|
||||
.with(authData)
|
||||
private val searchHelper: SearchHelper = SearchHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveSearchSuggestions: MutableLiveData<List<SearchSuggestEntry>> = MutableLiveData()
|
||||
|
||||
@@ -39,8 +39,7 @@ import kotlinx.coroutines.supervisorScope
|
||||
class SubCategoryClusterViewModel(application: Application) : BaseAndroidViewModel(application) {
|
||||
|
||||
var authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
var categoryHelper: CategoryHelper = CategoryHelper
|
||||
.with(authData)
|
||||
var categoryHelper: CategoryHelper = CategoryHelper(authData)
|
||||
.using(HttpClient.getPreferredClient())
|
||||
|
||||
val liveData: MutableLiveData<ViewState> = MutableLiveData()
|
||||
|
||||
@@ -37,7 +37,7 @@ abstract class BaseChartViewModel(application: Application) : BaseAndroidViewMod
|
||||
|
||||
private val authData: AuthData = AuthProvider.with(application).getAuthData()
|
||||
private val topChartsHelper: TopChartsHelper =
|
||||
TopChartsHelper.with(authData).using(HttpClient.getPreferredClient())
|
||||
TopChartsHelper(authData).using(HttpClient.getPreferredClient())
|
||||
|
||||
lateinit var type: TopChartsHelper.Type
|
||||
lateinit var chart: TopChartsHelper.Chart
|
||||
|
||||
Reference in New Issue
Block a user