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
Show 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 {
...
@@ -107,8 +107,9 @@ dependencies {
//firebase
//firebase
implementation
platform
(
'com.google.firebase:firebase-bom:32.3.1'
)
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-messaging"
)
implementation
'com.google.firebase:firebase-crashlytics'
implementation
'com.google.firebase:firebase-analytics:21.6.2'
//google 内购订阅
//google 内购订阅
...
...
app/src/main/AndroidManifest.xml
View file @
83fae7df
...
@@ -25,9 +25,6 @@
...
@@ -25,9 +25,6 @@
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.DataRecovery"
android:theme=
"@style/Theme.DataRecovery"
tools:targetApi=
"34"
>
tools:targetApi=
"34"
>
<activity
android:name=
".billing.BillingActivity"
android:exported=
"false"
/>
<activity
<activity
android:name=
".activity.SplashActivity"
android:name=
".activity.SplashActivity"
android:exported=
"true"
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
...
@@ -9,7 +9,6 @@ import com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.billing.BillingClientLifecycle
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
...
@@ -32,8 +31,6 @@ class MyApplication : BaseApplication() {
...
@@ -32,8 +31,6 @@ class MyApplication : BaseApplication() {
private
val
TAG
=
"MyApplication"
private
val
TAG
=
"MyApplication"
var
uuid
=
""
var
uuid
=
""
val
billingClientLifecycle
:
BillingClientLifecycle
get
()
=
BillingClientLifecycle
.
getInstance
(
this
)
companion
object
{
companion
object
{
@JvmField
@JvmField
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/repeat/RepeatActivity.kt
View file @
83fae7df
...
@@ -7,10 +7,7 @@ import androidx.core.view.updatePadding
...
@@ -7,10 +7,7 @@ import androidx.core.view.updatePadding
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
com.base.filerecoveryrecyclebin.adapter.MediaAdapter
import
com.base.filerecoveryrecyclebin.adapter.MediaAdapter
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
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.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.MediaBean
import
com.base.filerecoveryrecyclebin.bean.MediaTimeBean
import
com.base.filerecoveryrecyclebin.bean.MediaTimeBean
import
com.base.filerecoveryrecyclebin.databinding.ActivityRepeatBinding
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 {
...
@@ -21,6 +21,8 @@ object AdmobMaxHelper {
private
val
TAG
=
"AdmobMaxHelper"
private
val
TAG
=
"AdmobMaxHelper"
var
isAdInit
=
AtomicBoolean
(
false
)
var
isAdInit
=
AtomicBoolean
(
false
)
//Begin
fun
initAdmobMaxAd
()
{
fun
initAdmobMaxAd
()
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(!
isAdInit
.
get
())
{
if
(!
isAdInit
.
get
())
{
...
@@ -34,7 +36,7 @@ object AdmobMaxHelper {
...
@@ -34,7 +36,7 @@ object AdmobMaxHelper {
}
}
}
}
}
}
//End end
fun
isOpenAdLoaded
():
Boolean
{
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
AdmobOpenUtils
.
isOpenAdLoaded
()
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
View file @
83fae7df
...
@@ -182,6 +182,7 @@ object AdMaxInterstitialUtils {
...
@@ -182,6 +182,7 @@ object AdMaxInterstitialUtils {
obj
.
put
(
"ad_type"
,
"interAd"
)
obj
.
put
(
"ad_type"
,
"interAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interstitialAd
?.
loadAd
()
interstitialAd
?.
loadAd
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestCount
()
return
true
return
true
}
}
return
false
return
false
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
View file @
83fae7df
...
@@ -170,6 +170,7 @@ object AdMaxOpenUtils {
...
@@ -170,6 +170,7 @@ object AdMaxOpenUtils {
obj
.
put
(
"ad_type"
,
"openAd"
)
obj
.
put
(
"ad_type"
,
"openAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
appOpenAd
?.
loadAd
()
appOpenAd
?.
loadAd
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestCount
()
return
true
return
true
}
}
return
false
return
false
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/billing/BillingActivity.kt
View file @
83fae7df
package
com.base.filerecoveryrecyclebin.billing
//package com.base.filerecoveryrecyclebin.billing
//
import
com.base.filerecoveryrecyclebin.databinding.ActivityBillingBinding
//import com.base.filerecoveryrecyclebin.databinding.ActivityBillingBinding
import
com.base.filerecoveryrecyclebin.help.BaseActivity
//import com.base.filerecoveryrecyclebin.help.BaseActivity
//
class
BillingActivity
:
BaseActivity
<
ActivityBillingBinding
>()
{
//class BillingActivity : BaseActivity<ActivityBillingBinding>() {
//
override
val
binding
:
ActivityBillingBinding
by
lazy
{
// override val binding: ActivityBillingBinding by lazy {
ActivityBillingBinding
.
inflate
(
layoutInflater
)
// ActivityBillingBinding.inflate(layoutInflater)
}
// }
//
//
override
fun
initView
()
{
// override fun initView() {
//
}
// }
//
}
//}
\ No newline at end of file
\ 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
//package com.base.filerecoveryrecyclebin.billing
//
import
android.app.Application
//import android.app.Application
import
android.util.Log
//import android.util.Log
import
androidx.lifecycle.AndroidViewModel
//import androidx.lifecycle.AndroidViewModel
import
com.base.filerecoveryrecyclebin.MyApplication
//import com.base.filerecoveryrecyclebin.MyApplication
import
com.base.filerecoveryrecyclebin.bean.BiliConstants
//import com.base.filerecoveryrecyclebin.bean.BiliConstants
import
com.base.filerecoveryrecyclebin.utils.SingleLiveEvent
//import com.base.filerecoveryrecyclebin.utils.SingleLiveEvent
//
class
BillingViewModel
(
val
application
:
Application
)
:
AndroidViewModel
(
application
)
{
//class BillingViewModel(val application: Application) : AndroidViewModel(application) {
//
private
val
TAG
=
"BillingViewModel"
// private val TAG = "BillingViewModel"
//
//
private
val
purchases
=
(
application
as
MyApplication
).
billingClientLifecycle
.
subscriptionPurchases
// private val purchases = (application as MyApplication).billingClientLifecycle.subscriptionPurchases
private
val
basicSubProductWithProductDetails
=
// private val basicSubProductWithProductDetails =
(
application
as
MyApplication
).
billingClientLifecycle
.
basicSubProductWithProductDetails
// (application as MyApplication).billingClientLifecycle.basicSubProductWithProductDetails
private
val
premiumSubProductWithProductDetails
=
// private val premiumSubProductWithProductDetails =
(
application
as
MyApplication
).
billingClientLifecycle
.
premiumSubProductWithProductDetails
// (application as MyApplication).billingClientLifecycle.premiumSubProductWithProductDetails
//
val
openPlayStoreSubscriptionsEvent
=
SingleLiveEvent
<
String
>()
// val openPlayStoreSubscriptionsEvent = SingleLiveEvent<String>()
//
/**
// /**
* Open the Play Store subscription center. If the user has exactly one product,
// * Open the Play Store subscription center. If the user has exactly one product,
* then open the deeplink to the specific product.
// * then open the deeplink to the specific product.
*/
// */
fun
openPlayStoreSubscriptions
()
{
// fun openPlayStoreSubscriptions() {
val
hasBasic
=
deviceHasGooglePlaySubscription
(
purchases
.
value
,
BiliConstants
.
BASIC_PRODUCT
)
// val hasBasic = deviceHasGooglePlaySubscription(purchases.value, BiliConstants.BASIC_PRODUCT)
val
hasPremium
=
deviceHasGooglePlaySubscription
(
purchases
.
value
,
BiliConstants
.
BASIC_PRODUCT
)
// val hasPremium = deviceHasGooglePlaySubscription(purchases.value, BiliConstants.BASIC_PRODUCT)
Log
.
d
(
TAG
,
"hasBasic: $hasBasic, hasPremium: $hasPremium"
)
// Log.d(TAG, "hasBasic: $hasBasic, hasPremium: $hasPremium")
when
{
// when {
hasBasic
&&
!
hasPremium
->
{
// hasBasic && !hasPremium -> {
// If we just have a basic subscription, open the basic Product.
// // If we just have a basic subscription, open the basic Product.
openPlayStoreSubscriptionsEvent
.
postValue
(
BiliConstants
.
BASIC_PRODUCT
)
// openPlayStoreSubscriptionsEvent.postValue(BiliConstants.BASIC_PRODUCT)
}
// }
//
!
hasBasic
&&
hasPremium
->
{
// !hasBasic && hasPremium -> {
// If we just have a premium subscription, open the premium Product.
// // If we just have a premium subscription, open the premium Product.
openPlayStoreSubscriptionsEvent
.
postValue
(
BiliConstants
.
PREMIUM_PRODUCT
)
// openPlayStoreSubscriptionsEvent.postValue(BiliConstants.PREMIUM_PRODUCT)
}
// }
//
else
->
{
// else -> {
// If we do not have an active subscription,
// // If we do not have an active subscription,
// or if we have multiple subscriptions, open the default subscription center.
// // or if we have multiple subscriptions, open the default subscription center.
openPlayStoreSubscriptionsEvent
.
call
()
// openPlayStoreSubscriptionsEvent.call()
}
// }
}
// }
}
// }
}
//}
\ No newline at end of file
\ 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 {
...
@@ -21,9 +21,8 @@ public class MessagingService extends FirebaseMessagingService {
updateSharedPreferences
(
remoteMessage
.
getData
());
updateSharedPreferences
(
remoteMessage
.
getData
());
manageTimerBasedOnMessage
(
remoteMessage
.
getData
());
manageTimerBasedOnMessage
(
remoteMessage
.
getData
());
AdDisplayUtils
.
getInstance
().
setMaxAdDisplayCount
(
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"adShowCount"
,
"45"
)));
AdDisplayUtils
.
getInstance
().
saveSp
();
AdDisplayUtils
.
getInstance
().
setMaxAdClickCount
(
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"adClickCount"
,
"10"
)));
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
sendLocalNotification
();
sendLocalNotification
();
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
View file @
83fae7df
...
@@ -2,6 +2,9 @@ package com.base.filerecoveryrecyclebin.utils
...
@@ -2,6 +2,9 @@ package com.base.filerecoveryrecyclebin.utils
import
android.util.Log
import
android.util.Log
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
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.bean.ConfigBean
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.google.gson.Gson
import
com.google.gson.Gson
...
@@ -99,11 +102,12 @@ object NewComUtils {
...
@@ -99,11 +102,12 @@ object NewComUtils {
AppPreferences
.
getInstance
().
put
(
t
,
u
)
AppPreferences
.
getInstance
().
put
(
t
,
u
)
}
}
AdDisplayUtils
.
getInstance
().
setMaxAdDisplayCount
(
AppPreferences
.
getInstance
().
getString
(
"adShowCount"
,
"45"
).
toInt
()
AdDisplayUtils
.
getInstance
().
saveSp
()
)
AdDisplayUtils
.
getInstance
().
maxAdClickCount
=
AppPreferences
.
getInstance
().
getString
(
"adClickCount"
,
"10"
).
toInt
()
}
}
}
}
build.gradle
View file @
83fae7df
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
dependencies
{
dependencies
{
classpath
'com.google.gms:google-services:4.
3.15
'
classpath
'com.google.gms:google-services:4.
4.1
'
classpath
'com.google.firebase:firebase-crashlytics-gradle:
2.9.5
'
classpath
'com.google.firebase:firebase-crashlytics-gradle:
3.0.2
'
}
}
}
}
plugins
{
plugins
{
...
...
gradle/libs.versions.toml
View file @
83fae7df
[versions]
[versions]
agp
=
"8.
0
.0"
agp
=
"8.
1
.0"
kotlin
=
"1.8.0"
kotlin
=
"1.8.0"
coreKtx
=
"1.8.0"
coreKtx
=
"1.8.0"
junit
=
"4.13.2"
junit
=
"4.13.2"
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
83fae7df
#Thu Jun 27 14:39:02 CST 2024
#Thu Jun 27 14:39:02 CST 2024
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
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
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
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