Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
File Recovery RecycleBin
Commits
83fae7df
Commit
83fae7df
authored
Jul 26, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
....
parent
2beef962
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
685 additions
and
619 deletions
+685
-619
build.gradle
app/build.gradle
+2
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-3
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+0
-3
RepeatActivity.kt
.../filerecoveryrecyclebin/activity/repeat/RepeatActivity.kt
+0
-3
AdDisplayUtils.java
...a/com/base/filerecoveryrecyclebin/ads/AdDisplayUtils.java
+158
-91
AdmobMaxHelper.kt
...ava/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
+3
-1
AdMaxInterstitialUtils.kt
.../filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
+1
-0
AdMaxOpenUtils.kt
...com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
+1
-0
BillingActivity.kt
...om/base/filerecoveryrecyclebin/billing/BillingActivity.kt
+17
-17
BillingClientLifecycle.kt
.../filerecoveryrecyclebin/billing/BillingClientLifecycle.kt
+269
-269
BillingUtilities.kt
...m/base/filerecoveryrecyclebin/billing/BillingUtilities.kt
+170
-170
BillingViewModel.kt
...m/base/filerecoveryrecyclebin/billing/BillingViewModel.kt
+49
-49
MessagingService.java
...com/base/filerecoveryrecyclebin/fcm/MessagingService.java
+2
-3
NewComUtils.kt
...java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
+9
-5
build.gradle
build.gradle
+2
-2
libs.versions.toml
gradle/libs.versions.toml
+1
-1
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
No files found.
app/build.gradle
View file @
83fae7df
...
...
@@ -107,8 +107,9 @@ dependencies {
//firebase
implementation
platform
(
'com.google.firebase:firebase-bom:32.3.1'
)
implementation
'com.google.firebase:firebase-analytics:21.6.2'
implementation
(
"com.google.firebase:firebase-messaging"
)
implementation
'com.google.firebase:firebase-crashlytics'
implementation
'com.google.firebase:firebase-analytics:21.6.2'
//google 内购订阅
...
...
app/src/main/AndroidManifest.xml
View file @
83fae7df
...
...
@@ -25,9 +25,6 @@
android:supportsRtl=
"true"
android:theme=
"@style/Theme.DataRecovery"
tools:targetApi=
"34"
>
<activity
android:name=
".billing.BillingActivity"
android:exported=
"false"
/>
<activity
android:name=
".activity.SplashActivity"
android:exported=
"true"
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
83fae7df
...
...
@@ -9,7 +9,6 @@ import com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.billing.BillingClientLifecycle
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
...
...
@@ -32,8 +31,6 @@ class MyApplication : BaseApplication() {
private
val
TAG
=
"MyApplication"
var
uuid
=
""
val
billingClientLifecycle
:
BillingClientLifecycle
get
()
=
BillingClientLifecycle
.
getInstance
(
this
)
companion
object
{
@JvmField
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/repeat/RepeatActivity.kt
View file @
83fae7df
...
...
@@ -7,10 +7,7 @@ import androidx.core.view.updatePadding
import
androidx.lifecycle.lifecycleScope
import
com.base.filerecoveryrecyclebin.adapter.MediaAdapter
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils.showInterAdSp
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
import
com.base.filerecoveryrecyclebin.bean.MediaBean
import
com.base.filerecoveryrecyclebin.bean.MediaTimeBean
import
com.base.filerecoveryrecyclebin.databinding.ActivityRepeatBinding
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdDisplayUtils.java
View file @
83fae7df
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
View file @
83fae7df
...
...
@@ -21,6 +21,8 @@ object AdmobMaxHelper {
private
val
TAG
=
"AdmobMaxHelper"
var
isAdInit
=
AtomicBoolean
(
false
)
//Begin
fun
initAdmobMaxAd
()
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(!
isAdInit
.
get
())
{
...
...
@@ -34,7 +36,7 @@ object AdmobMaxHelper {
}
}
}
//End end
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
View file @
83fae7df
...
...
@@ -182,6 +182,7 @@ object AdMaxInterstitialUtils {
obj
.
put
(
"ad_type"
,
"interAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interstitialAd
?.
loadAd
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestCount
()
return
true
}
return
false
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
View file @
83fae7df
...
...
@@ -170,6 +170,7 @@ object AdMaxOpenUtils {
obj
.
put
(
"ad_type"
,
"openAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
appOpenAd
?.
loadAd
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestCount
()
return
true
}
return
false
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/billing/BillingActivity.kt
View file @
83fae7df
package
com.base.filerecoveryrecyclebin.billing
import
com.base.filerecoveryrecyclebin.databinding.ActivityBillingBinding
import
com.base.filerecoveryrecyclebin.help.BaseActivity
class
BillingActivity
:
BaseActivity
<
ActivityBillingBinding
>()
{
override
val
binding
:
ActivityBillingBinding
by
lazy
{
ActivityBillingBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
}
}
\ No newline at end of file
//package com.base.filerecoveryrecyclebin.billing
//
//import com.base.filerecoveryrecyclebin.databinding.ActivityBillingBinding
//import com.base.filerecoveryrecyclebin.help.BaseActivity
//
//class BillingActivity : BaseActivity<ActivityBillingBinding>() {
//
// override val binding: ActivityBillingBinding by lazy {
// ActivityBillingBinding.inflate(layoutInflater)
// }
//
//
// override fun initView() {
//
// }
//
//}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/billing/BillingClientLifecycle.kt
View file @
83fae7df
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/billing/BillingUtilities.kt
View file @
83fae7df
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/billing/BillingViewModel.kt
View file @
83fae7df
package
com.base.filerecoveryrecyclebin.billing
import
android.app.Application
import
android.util.Log
import
androidx.lifecycle.AndroidViewModel
import
com.base.filerecoveryrecyclebin.MyApplication
import
com.base.filerecoveryrecyclebin.bean.BiliConstants
import
com.base.filerecoveryrecyclebin.utils.SingleLiveEvent
class
BillingViewModel
(
val
application
:
Application
)
:
AndroidViewModel
(
application
)
{
private
val
TAG
=
"BillingViewModel"
private
val
purchases
=
(
application
as
MyApplication
).
billingClientLifecycle
.
subscriptionPurchases
private
val
basicSubProductWithProductDetails
=
(
application
as
MyApplication
).
billingClientLifecycle
.
basicSubProductWithProductDetails
private
val
premiumSubProductWithProductDetails
=
(
application
as
MyApplication
).
billingClientLifecycle
.
premiumSubProductWithProductDetails
val
openPlayStoreSubscriptionsEvent
=
SingleLiveEvent
<
String
>()
/**
* Open the Play Store subscription center. If the user has exactly one product,
* then open the deeplink to the specific product.
*/
fun
openPlayStoreSubscriptions
()
{
val
hasBasic
=
deviceHasGooglePlaySubscription
(
purchases
.
value
,
BiliConstants
.
BASIC_PRODUCT
)
val
hasPremium
=
deviceHasGooglePlaySubscription
(
purchases
.
value
,
BiliConstants
.
BASIC_PRODUCT
)
Log
.
d
(
TAG
,
"hasBasic: $hasBasic, hasPremium: $hasPremium"
)
when
{
hasBasic
&&
!
hasPremium
->
{
// If we just have a basic subscription, open the basic Product.
openPlayStoreSubscriptionsEvent
.
postValue
(
BiliConstants
.
BASIC_PRODUCT
)
}
!
hasBasic
&&
hasPremium
->
{
// If we just have a premium subscription, open the premium Product.
openPlayStoreSubscriptionsEvent
.
postValue
(
BiliConstants
.
PREMIUM_PRODUCT
)
}
else
->
{
// If we do not have an active subscription,
// or if we have multiple subscriptions, open the default subscription center.
openPlayStoreSubscriptionsEvent
.
call
()
}
}
}
}
\ No newline at end of file
//package com.base.filerecoveryrecyclebin.billing
//
//import android.app.Application
//import android.util.Log
//import androidx.lifecycle.AndroidViewModel
//import com.base.filerecoveryrecyclebin.MyApplication
//import com.base.filerecoveryrecyclebin.bean.BiliConstants
//import com.base.filerecoveryrecyclebin.utils.SingleLiveEvent
//
//class BillingViewModel(val application: Application) : AndroidViewModel(application) {
//
// private val TAG = "BillingViewModel"
//
//
// private val purchases = (application as MyApplication).billingClientLifecycle.subscriptionPurchases
// private val basicSubProductWithProductDetails =
// (application as MyApplication).billingClientLifecycle.basicSubProductWithProductDetails
// private val premiumSubProductWithProductDetails =
// (application as MyApplication).billingClientLifecycle.premiumSubProductWithProductDetails
//
// val openPlayStoreSubscriptionsEvent = SingleLiveEvent<String>()
//
// /**
// * Open the Play Store subscription center. If the user has exactly one product,
// * then open the deeplink to the specific product.
// */
// fun openPlayStoreSubscriptions() {
// val hasBasic = deviceHasGooglePlaySubscription(purchases.value, BiliConstants.BASIC_PRODUCT)
// val hasPremium = deviceHasGooglePlaySubscription(purchases.value, BiliConstants.BASIC_PRODUCT)
// Log.d(TAG, "hasBasic: $hasBasic, hasPremium: $hasPremium")
// when {
// hasBasic && !hasPremium -> {
// // If we just have a basic subscription, open the basic Product.
// openPlayStoreSubscriptionsEvent.postValue(BiliConstants.BASIC_PRODUCT)
// }
//
// !hasBasic && hasPremium -> {
// // If we just have a premium subscription, open the premium Product.
// openPlayStoreSubscriptionsEvent.postValue(BiliConstants.PREMIUM_PRODUCT)
// }
//
// else -> {
// // If we do not have an active subscription,
// // or if we have multiple subscriptions, open the default subscription center.
// openPlayStoreSubscriptionsEvent.call()
// }
// }
// }
//}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/MessagingService.java
View file @
83fae7df
...
...
@@ -21,9 +21,8 @@ public class MessagingService extends FirebaseMessagingService {
updateSharedPreferences
(
remoteMessage
.
getData
());
manageTimerBasedOnMessage
(
remoteMessage
.
getData
());
AdDisplayUtils
.
getInstance
().
setMaxAdDisplayCount
(
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"adShowCount"
,
"45"
)));
AdDisplayUtils
.
getInstance
().
setMaxAdClickCount
(
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"adClickCount"
,
"10"
)));
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
AdDisplayUtils
.
getInstance
().
saveSp
();
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
sendLocalNotification
();
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
View file @
83fae7df
...
...
@@ -2,6 +2,9 @@ package com.base.filerecoveryrecyclebin.utils
import
android.util.Log
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils.DEFAULT_MAX_AD_CLICK_COUNT
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils.DEFAULT_MAX_AD_DISPLAY_COUNT
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils.DEFAULT_MAX_AD_REQUEST_COUNT
import
com.base.filerecoveryrecyclebin.bean.ConfigBean
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.google.gson.Gson
...
...
@@ -99,11 +102,12 @@ object NewComUtils {
AppPreferences
.
getInstance
().
put
(
t
,
u
)
}
AdDisplayUtils
.
getInstance
().
setMaxAdDisplayCount
(
AppPreferences
.
getInstance
().
getString
(
"adShowCount"
,
"45"
).
toInt
()
)
AdDisplayUtils
.
getInstance
().
maxAdClickCount
=
AppPreferences
.
getInstance
().
getString
(
"adClickCount"
,
"10"
).
toInt
()
AdDisplayUtils
.
getInstance
().
saveSp
()
}
}
build.gradle
View file @
83fae7df
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
dependencies
{
classpath
'com.google.gms:google-services:4.
3.15
'
classpath
'com.google.firebase:firebase-crashlytics-gradle:
2.9.5
'
classpath
'com.google.gms:google-services:4.
4.1
'
classpath
'com.google.firebase:firebase-crashlytics-gradle:
3.0.2
'
}
}
plugins
{
...
...
gradle/libs.versions.toml
View file @
83fae7df
[versions]
agp
=
"8.
0
.0"
agp
=
"8.
1
.0"
kotlin
=
"1.8.0"
coreKtx
=
"1.8.0"
junit
=
"4.13.2"
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
83fae7df
#Thu Jun 27 14:39:02 CST 2024
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.
0
-bin.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-8.
1
-bin.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment