Commit 0d8210af authored by wanglei's avatar wanglei

...手动混淆...

parent bac5e685
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:value="document_ui" /> android:value="document_ui" />
<application <application
android:name=".helper.MyApplication" android:name=".helper.AAication"
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
tools:targetApi="34"> tools:targetApi="34">
<activity <activity
android:name=".ui.splash.SplashActivity" android:name=".ui.splash.Spctivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -52,31 +52,31 @@ ...@@ -52,31 +52,31 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.appprocess.AppProcessActivity" android:name=".ui.appprocess.SDSDAssActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.appprocess.AppProcessLoadingActivity" android:name=".ui.appprocess.AppPSALoadingActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.cleanjunk.CleaningActivity" android:name=".ui.cleanjunk.CleSADADActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.permission.PermissionActivity" android:name=".ui.permission.PermisSAASsionActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.result.ResultActivity" android:name=".ui.result.ResuASAltActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -88,14 +88,14 @@ ...@@ -88,14 +88,14 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.set.SetLanguageActivity" android:name=".ui.set.SetageActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.pdf.PdfActivity" android:name=".ui.pdf.PdfAWEWQEctivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -103,75 +103,75 @@ ...@@ -103,75 +103,75 @@
</activity> </activity>
<activity <activity
android:name=".ui.pdf.PdfLoadingActivity" android:name=".ui.pdf.QWEoadingActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.pdf.PdfSelectActivity" android:name=".ui.pdf.SSASSelctivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.pdf.PdfSplitActivity" android:name=".ui.pdf.PdActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.pdf.PdfMergeActivity" android:name=".ui.pdf.PdfMEQWEergeActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.ppt.PptActivity" android:name=".ui.ppt.PptAASActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.document.word.WordActivity" android:name=".ui.document.word.Wctivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.document.excel.ExcelActivity" android:name=".ui.document.excel.ExcelDSDActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.set.SetActivity" android:name=".ui.set.DSADSSetActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.weather.WeatherInterface" android:name=".ui.weather.WeatASerface"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.set.FeedbackActivity" android:name=".ui.set.dbFAFackActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<service <service
android:name=".service.StayNotificationService" android:name=".service.ySADSDficationService"
android:foregroundServiceType="dataSync" /> android:foregroundServiceType="dataSync" />
<service <service
android:name=".fcm.MessagingService" android:name=".fcm.MessagingSSDADervice"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
</service> </service>
<receiver <receiver
android:name=".fcm.FcmReceiver" android:name=".fcm.FcmRSADeiver"
android:exported="true" android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND"> android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter> <intent-filter>
......
...@@ -10,7 +10,7 @@ import com.base.pdfreader2.R ...@@ -10,7 +10,7 @@ import com.base.pdfreader2.R
import com.base.pdfreader2.databinding.DialogAdPreparingBinding import com.base.pdfreader2.databinding.DialogAdPreparingBinding
object AdDialog { object Aalog {
fun Context.showAdPreparingDialog(): AlertDialog { fun Context.showAdPreparingDialog(): AlertDialog {
val binding = DialogAdPreparingBinding.inflate(LayoutInflater.from(this)) val binding = DialogAdPreparingBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).create() val dialog = AlertDialog.Builder(this).create()
......
package com.base.pdfreader2.ads package com.base.pdfreader2.ads
import android.app.Activity import android.app.Activity
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.ads.admob.AdmobNativeUtils import com.base.pdfreader2.ads.admob.AveUtils
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.google.android.gms.ads.MobileAds import com.google.android.gms.ads.MobileAds
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
object AdmobHelper { object Aer {
//开屏限制 //开屏限制
const val open_limit_request = "open_limit_request" const val open_limit_request = "open_limit_request"
...@@ -32,22 +32,22 @@ object AdmobHelper { ...@@ -32,22 +32,22 @@ object AdmobHelper {
var isAdInit = AtomicBoolean(false) var isAdInit = AtomicBoolean(false)
fun initAdmobAd(activity: Activity) { fun initAdmobAd(activity: Activity) {
MobileAds.initialize(MyApplication.context) { initializationStatus -> MobileAds.initialize(AAication.context) { initializationStatus ->
isAdInit.set(true) isAdInit.set(true)
EventUtils.event("AdmobInit", "AdmobInit") EvenWQEWQEtUtils.event("AdmobInit", "AdmobInit")
AdmobNativeUtils.loadNativeAd() AveUtils.loadNativeAd()
AdmobInterstitialUtils.loadInterstitialAd(activity) AdmoalUtils.loadInterstitialAd(activity)
} }
} }
//上次展示广告时间关闭赋值,通用开屏和插页 //上次展示广告时间关闭赋值,通用开屏和插页
var lastShowedOnHiddenTime = 0L var lastShowedOnHiddenTime = 0L
get() { get() {
return AppPreferences.getInstance().getLong("lastShowedOnHiddenTime", field) return AppPrASDAD.getInstance().getLong("lastShowedOnHiddenTime", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("lastShowedOnHiddenTime", value, true) AppPrASDAD.getInstance().put("lastShowedOnHiddenTime", value, true)
} }
...@@ -55,7 +55,7 @@ object AdmobHelper { ...@@ -55,7 +55,7 @@ object AdmobHelper {
* 通用广告条件判断 * 通用广告条件判断
*/ */
fun canCommonShowAd(): Boolean { fun canCommonShowAd(): Boolean {
val interval = AppPreferences.getInstance().getString("ad_interval", "10").toInt() val interval = AppPrASDAD.getInstance().getString("ad_interval", "10").toInt()
if (System.currentTimeMillis() - lastShowedOnHiddenTime < interval * 1000L) { if (System.currentTimeMillis() - lastShowedOnHiddenTime < interval * 1000L) {
return false return false
} }
...@@ -65,62 +65,62 @@ object AdmobHelper { ...@@ -65,62 +65,62 @@ object AdmobHelper {
//上次scan展示ad时间 //上次scan展示ad时间
var lastScanShowAd = 0L var lastScanShowAd = 0L
get() { get() {
return AppPreferences.getInstance().getLong("lastScanShowAd", field) return AppPrASDAD.getInstance().getLong("lastScanShowAd", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("lastScanShowAd", value, true) AppPrASDAD.getInstance().put("lastScanShowAd", value, true)
} }
//是否显示扫描功能ad //是否显示扫描功能ad
fun isShowScanInter(): Boolean { fun isShowScanInter(): Boolean {
val interval = AppPreferences.getInstance().getString("scan_ad_interval", "10").toInt() val interval = AppPrASDAD.getInstance().getString("scan_ad_interval", "10").toInt()
return System.currentTimeMillis() - lastScanShowAd > interval * 1000L return System.currentTimeMillis() - lastScanShowAd > interval * 1000L
} }
//上次打开文档展示ad时间 //上次打开文档展示ad时间
var lastOpenDocumentShowAd = 0L var lastOpenDocumentShowAd = 0L
get() { get() {
return AppPreferences.getInstance().getLong("lastOpenDocumentShowAd", field) return AppPrASDAD.getInstance().getLong("lastOpenDocumentShowAd", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("lastOpenDocumentShowAd", value, true) AppPrASDAD.getInstance().put("lastOpenDocumentShowAd", value, true)
} }
//打开文档是否展示广告 //打开文档是否展示广告
fun isShowOpenDocumentInter(): Boolean { fun isShowOpenDocumentInter(): Boolean {
val interval = AppPreferences.getInstance().getString("open_document_ad_interval", "10").toInt() val interval = AppPrASDAD.getInstance().getString("open_document_ad_interval", "10").toInt()
val openStatus = AppPreferences.getInstance().getString("open_document_ad_status", "1").toInt() val openStatus = AppPrASDAD.getInstance().getString("open_document_ad_status", "1").toInt()
return openStatus == 1 && System.currentTimeMillis() - lastOpenDocumentShowAd > interval * 1000L return openStatus == 1 && System.currentTimeMillis() - lastOpenDocumentShowAd > interval * 1000L
} }
var lastCloseDocumentShowAd = 0L var lastCloseDocumentShowAd = 0L
get() { get() {
return AppPreferences.getInstance().getLong("lastCloseDocumentShowAd", field) return AppPrASDAD.getInstance().getLong("lastCloseDocumentShowAd", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("lastCloseDocumentShowAd", value, true) AppPrASDAD.getInstance().put("lastCloseDocumentShowAd", value, true)
} }
fun isShowCloseDocumentInter(): Boolean { fun isShowCloseDocumentInter(): Boolean {
val interval = AppPreferences.getInstance().getString("close_document_ad_interval", "10").toInt() val interval = AppPrASDAD.getInstance().getString("close_document_ad_interval", "10").toInt()
return System.currentTimeMillis() - lastCloseDocumentShowAd > interval * 1000L return System.currentTimeMillis() - lastCloseDocumentShowAd > interval * 1000L
} }
fun isShowCloseDocument(): Boolean { fun isShowCloseDocument(): Boolean {
val status = AppPreferences.getInstance().getString("close_document_ad_show", "0").toInt() val status = AppPrASDAD.getInstance().getString("close_document_ad_show", "0").toInt()
return status == 1 return status == 1
} }
fun isShowRvNativeAd(): Boolean { fun isShowRvNativeAd(): Boolean {
val status = AppPreferences.getInstance().getString("rv_native_ad_show", "0").toInt() val status = AppPrASDAD.getInstance().getString("rv_native_ad_show", "0").toInt()
return status == 1 return status == 1
} }
fun isBackShowAd(): Boolean { fun isBackShowAd(): Boolean {
val status = AppPreferences.getInstance().getString("is_back_show_ad", "0").toInt() val status = AppPrASDAD.getInstance().getString("is_back_show_ad", "0").toInt()
return status == 1 return status == 1
} }
......
//package com.base.pdfviewerscannerwhite.ads
//
//import com.base.pdfviewerscannerwhite.utils.AppPreferences
//import com.base.pdfviewerscannerwhite.utils.LogEx
//import com.google.firebase.database.DataSnapshot
//import com.google.firebase.database.DatabaseError
//import com.google.firebase.database.ValueEventListener
//import com.google.firebase.database.ktx.database
//import com.google.firebase.ktx.Firebase
//
////Realtime Database
//object FirebaseDatabase {
//
// private val TAG = "FirebaseDatabase"
//
// // Write a message to the database
// val database = Firebase.database
// var rootRef = database.reference
//
//
//
// fun saveDatabase2Sp() {
//// add(open_limit_request, "15")
//// add(open_limit_show, "10")
//// add(open_limit_click, "1")
////
////
//// add(inter_limit_request, "15")
//// add(inter_limit_show, "10")
//// add(inter_limit_click, "1")
////
//// add(native_limit_request, "15")
//// add(native_limit_show, "10")
//// add(native_limit_click, "1")
////
//// add(popup_count, "0")
//// add(popup_status, "1")
////
//// add(popup_style1_start, "7")
//// add(popup_style1_end, "11")
//// add(popup_style1_count, "0")
//// add(popup_style1_status, "1")
//// add(popup_style1_interval, "120")
////
//// add(popup_style2_start, "12")
//// add(popup_style2_end, "17")
//// add(popup_style2_count, "0")
//// add(popup_style2_status, "1")
//// add(popup_style2_interval, "120")
////
//// add(popup_style3_start, "18")
//// add(popup_style3_end, "24")
//// add(popup_style3_count, "0")
//// add(popup_style3_status, "1")
//// add(popup_style3_interval, "120")
////
//// add(showLanPage, "1")
////
//// add(open_ad_loading, "8000")
//// add(create_pdf_loading, "8000")
//// add(delete_loading, "8000")
//// add(open_file_loading, "8000")
//// add(merge_loading, "8000")
//// add(split_loading, "8000")
////
//// add(ad_request_period, "1")
//// add(ad_period_max_request, "10")
//// add(ad_request_period_interval, "60")
//
//
// rootRef.addListenerForSingleValueEvent(object : ValueEventListener {
// override fun onDataChange(dataSnapshot: DataSnapshot) {
// var i = 0
// for (snapshot in dataSnapshot.getChildren()) {
// val key1 = snapshot.key
// val value1 = snapshot.value
// i++
// LogEx.logDebug("Database", "Key: $key1, Value: $value1 $i")
// AppPreferences.getInstance().put(key1, value1)
// }
// }
//
// override fun onCancelled(databaseError: DatabaseError) {
// LogEx.logDebug("Database", "onCancelled")
// }
// })
//
// }
//
// fun add(ref: String, value: String) {
// database.getReference(ref).setValue(value)
// }
//
//
//}
\ No newline at end of file
//package com.base.pdfviewerscannerwhite.ads
//
//import com.base.pdfviewerscannerwhite.R
//import com.base.pdfviewerscannerwhite.utils.LogEx
//import com.google.firebase.ktx.Firebase
//import com.google.firebase.remoteconfig.ConfigUpdate
//import com.google.firebase.remoteconfig.ConfigUpdateListener
//import com.google.firebase.remoteconfig.FirebaseRemoteConfig
//import com.google.firebase.remoteconfig.FirebaseRemoteConfigException
//import com.google.firebase.remoteconfig.ktx.get
//import com.google.firebase.remoteconfig.ktx.remoteConfig
//import com.google.firebase.remoteconfig.ktx.remoteConfigSettings
//
//
//object RemoteConfigHelper {
// private val TAG = "RemoteConfigHelper"
// fun test() {
// val remoteConfig: FirebaseRemoteConfig = Firebase.remoteConfig
// val configSettings = remoteConfigSettings {
// minimumFetchIntervalInSeconds = 3600
// }
// remoteConfig.setConfigSettingsAsync(configSettings)
//
// remoteConfig.setDefaultsAsync(R.xml.remote_config_defaults)
//
// //提取并激活值
// remoteConfig.fetchAndActivate().addOnCompleteListener { task ->
// if (task.isSuccessful) {
// val aa = remoteConfig["a"].asString()
// LogEx.logDebug(TAG, "fetchAndActivate aa=$aa")
// }
// }
//
// //监听跟新值
// remoteConfig.addOnConfigUpdateListener(object : ConfigUpdateListener {
// override fun onUpdate(configUpdate: ConfigUpdate) {
// remoteConfig.activate().addOnCompleteListener {
// val aa2 = remoteConfig["a"].asString()
// LogEx.logDebug(TAG, "onUpdate aa=$aa2")
// }
// }
//
// override fun onError(error: FirebaseRemoteConfigException) {
// }
//
// })
// }
//
//}
\ No newline at end of file
...@@ -5,9 +5,9 @@ import android.os.Bundle ...@@ -5,9 +5,9 @@ import android.os.Bundle
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.helper.ConfigHelper import com.base.pdfreader2.helper.SDAHelper
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.google.ads.mediation.admob.AdMobAdapter import com.google.ads.mediation.admob.AdMobAdapter
import com.google.android.gms.ads.AdListener import com.google.android.gms.ads.AdListener
import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdRequest
...@@ -22,7 +22,7 @@ object AdmobBannerUtils { ...@@ -22,7 +22,7 @@ object AdmobBannerUtils {
private var listener: ViewTreeObserver.OnGlobalLayoutListener? = null private var listener: ViewTreeObserver.OnGlobalLayoutListener? = null
fun showCollapsibleBannerAd(context: Context, parent: ViewGroup, adClose: (() -> Unit)? = null) { fun showCollapsibleBannerAd(context: Context, parent: ViewGroup, adClose: (() -> Unit)? = null) {
val isShowBanner = AppPreferences.getInstance().getString("isShowBanner", "0").toInt() val isShowBanner = AppPrASDAD.getInstance().getString("isShowBanner", "0").toInt()
if (isShowBanner == 0) { if (isShowBanner == 0) {
return return
} }
...@@ -42,7 +42,7 @@ object AdmobBannerUtils { ...@@ -42,7 +42,7 @@ object AdmobBannerUtils {
val screenPixelDensity = context.resources.displayMetrics.density val screenPixelDensity = context.resources.displayMetrics.density
val adWidth = (parent.width / screenPixelDensity).toInt() val adWidth = (parent.width / screenPixelDensity).toInt()
val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, adWidth) val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, adWidth)
adView?.adUnitId = if (BuildConfig.DEBUG) ConfigHelper.bannerAdmobIdTest else ConfigHelper.bannerAdmobId adView?.adUnitId = if (BuildConfig.DEBUG) SDAHelper.bannerAdmobIdTest else SDAHelper.bannerAdmobId
adView?.setAdSize(adSize) adView?.setAdSize(adSize)
loadCollapsibleBanner(adClose) loadCollapsibleBanner(adClose)
parent.viewTreeObserver.removeOnGlobalLayoutListener(listener) parent.viewTreeObserver.removeOnGlobalLayoutListener(listener)
...@@ -60,16 +60,16 @@ object AdmobBannerUtils { ...@@ -60,16 +60,16 @@ object AdmobBannerUtils {
adView?.adListener = adView?.adListener =
object : AdListener() { object : AdListener() {
override fun onAdLoaded() { override fun onAdLoaded() {
LogEx.logDebug(TAG, "onAdLoaded") LEEEx.logDebug(TAG, "onAdLoaded")
} }
override fun onAdOpened() { override fun onAdOpened() {
LogEx.logDebug(TAG, "onAdOpened") LEEEx.logDebug(TAG, "onAdOpened")
} }
override fun onAdClosed() { override fun onAdClosed() {
super.onAdClosed() super.onAdClosed()
LogEx.logDebug(TAG, "onAdClosed") LEEEx.logDebug(TAG, "onAdClosed")
adClose?.invoke() adClose?.invoke()
} }
} }
......
...@@ -2,9 +2,9 @@ package com.base.pdfreader2.ads.admob ...@@ -2,9 +2,9 @@ package com.base.pdfreader2.ads.admob
import android.app.Activity import android.app.Activity
import android.os.Bundle import android.os.Bundle
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.facebook.appevents.AppEventsConstants import com.facebook.appevents.AppEventsConstants
import com.facebook.appevents.AppEventsLogger import com.facebook.appevents.AppEventsLogger
import com.google.android.gms.ads.AdValue import com.google.android.gms.ads.AdValue
...@@ -19,7 +19,7 @@ import com.google.firebase.analytics.ktx.analytics ...@@ -19,7 +19,7 @@ import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase import com.google.firebase.ktx.Firebase
import org.json.JSONObject import org.json.JSONObject
object AdmobEvent { object AE {
private val TAG = "AdmobEvent" private val TAG = "AdmobEvent"
fun pullAd( fun pullAd(
responseInfo: ResponseInfo?, responseInfo: ResponseInfo?,
...@@ -51,12 +51,12 @@ object AdmobEvent { ...@@ -51,12 +51,12 @@ object AdmobEvent {
obj.put("errMsg", error) obj.put("errMsg", error)
obj.put("status", "2") obj.put("status", "2")
} }
LogEx.logDebug(TAG, "obj=$obj") LEEEx.logDebug(TAG, "obj=$obj")
EventUtils.event("ad_pull", ext = obj) EvenWQEWQEtUtils.event("ad_pull", ext = obj)
} }
private val taichiPref by lazy { private val taichiPref by lazy {
MyApplication.context.getSharedPreferences("TaichiTroasCache", 0) AAication.context.getSharedPreferences("TaichiTroasCache", 0)
} }
private val taichiSharedPreferencesEditor by lazy { private val taichiSharedPreferencesEditor by lazy {
...@@ -104,7 +104,7 @@ object AdmobEvent { ...@@ -104,7 +104,7 @@ object AdmobEvent {
Firebase.analytics.logEvent("Total_Ads_Revenue_001", roasbundle) Firebase.analytics.logEvent("Total_Ads_Revenue_001", roasbundle)
taichiSharedPreferencesEditor.putFloat("TaichiTroasCache", 0f)//重新清零,开始计算 taichiSharedPreferencesEditor.putFloat("TaichiTroasCache", 0f)//重新清零,开始计算
val logger = AppEventsLogger.newLogger(MyApplication.context) val logger = AppEventsLogger.newLogger(AAication.context)
val parameters = Bundle() val parameters = Bundle()
parameters.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, "USD") parameters.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, "USD")
logger.logEvent("ad_value", currentTaichiTroasCache.toDouble(), parameters) logger.logEvent("ad_value", currentTaichiTroasCache.toDouble(), parameters)
...@@ -207,7 +207,7 @@ object AdmobEvent { ...@@ -207,7 +207,7 @@ object AdmobEvent {
obj.put("session_id", sessionId) obj.put("session_id", sessionId)
} }
} }
EventUtils.event(key, ext = obj) EvenWQEWQEtUtils.event(key, ext = obj)
} }
} }
...@@ -227,9 +227,9 @@ object AdmobEvent { ...@@ -227,9 +227,9 @@ object AdmobEvent {
obj.put("session_id", responseInfo?.responseId) obj.put("session_id", responseInfo?.responseId)
obj.put("networkname", responseInfo?.mediationAdapterClassName) obj.put("networkname", responseInfo?.mediationAdapterClassName)
if (adUnit != "nativeAd") { if (adUnit != "nativeAd") {
EventUtils.event("ad_click", ext = obj) EvenWQEWQEtUtils.event("ad_click", ext = obj)
} else { } else {
EventUtils.event("bigimage_ad_click", ext = obj) EvenWQEWQEtUtils.event("bigimage_ad_click", ext = obj)
} }
} }
...@@ -248,9 +248,9 @@ object AdmobEvent { ...@@ -248,9 +248,9 @@ object AdmobEvent {
obj.put("session_id", responseInfo?.responseId) obj.put("session_id", responseInfo?.responseId)
obj.put("from", activity?.javaClass?.simpleName) obj.put("from", activity?.javaClass?.simpleName)
if (adUnit != "nativeAd") { if (adUnit != "nativeAd") {
EventUtils.event("ad_show", ext = obj) EvenWQEWQEtUtils.event("ad_show", ext = obj)
} else { } else {
EventUtils.event("bigimage_ad_show", ext = obj) EvenWQEWQEtUtils.event("bigimage_ad_show", ext = obj)
} }
} }
} }
\ No newline at end of file
...@@ -2,15 +2,15 @@ package com.base.pdfreader2.ads.admob ...@@ -2,15 +2,15 @@ package com.base.pdfreader2.ads.admob
import android.app.Activity import android.app.Activity
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.ads.AdDisplayUtils import com.base.pdfreader2.ads.AdDis
import com.base.pdfreader2.ads.AdmobHelper.lastShowedOnHiddenTime import com.base.pdfreader2.ads.Aer.lastShowedOnHiddenTime
import com.base.pdfreader2.ads.admob.AdmobEvent.clickAd import com.base.pdfreader2.ads.admob.AE.clickAd
import com.base.pdfreader2.ads.admob.AdmobEvent.pullAd import com.base.pdfreader2.ads.admob.AE.pullAd
import com.base.pdfreader2.ads.admob.AdmobEvent.showAd import com.base.pdfreader2.ads.admob.AE.showAd
import com.base.pdfreader2.helper.ConfigHelper import com.base.pdfreader2.helper.SDAHelper
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.google.android.gms.ads.AdError import com.google.android.gms.ads.AdError
import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.FullScreenContentCallback import com.google.android.gms.ads.FullScreenContentCallback
...@@ -19,7 +19,7 @@ import com.google.android.gms.ads.appopen.AppOpenAd ...@@ -19,7 +19,7 @@ import com.google.android.gms.ads.appopen.AppOpenAd
import org.json.JSONObject import org.json.JSONObject
import java.util.UUID import java.util.UUID
object AdmobOpenUtils { object Adls {
private const val TAG = "AdmobOpenUtils" private const val TAG = "AdmobOpenUtils"
private val mRequest = AdRequest.Builder().build() private val mRequest = AdRequest.Builder().build()
...@@ -41,7 +41,7 @@ object AdmobOpenUtils { ...@@ -41,7 +41,7 @@ object AdmobOpenUtils {
onLoad?.invoke(true) onLoad?.invoke(true)
return return
} }
if (!AdDisplayUtils.shouldShowOpenAd()) { if (!AdDis.shouldShowOpenAd()) {
onLoad?.invoke(false) onLoad?.invoke(false)
return return
} }
...@@ -49,24 +49,24 @@ object AdmobOpenUtils { ...@@ -49,24 +49,24 @@ object AdmobOpenUtils {
val obj = JSONObject() val obj = JSONObject()
obj.put("req_id", reqId) obj.put("req_id", reqId)
obj.put("ad_type", "openAd") obj.put("ad_type", "openAd")
EventUtils.event("ad_pull_start", ext = obj) EvenWQEWQEtUtils.event("ad_pull_start", ext = obj)
AppOpenAd.load( AppOpenAd.load(
MyApplication.context, AAication.context,
if (BuildConfig.DEBUG) ConfigHelper.openAdmobIdTest else ConfigHelper.openAdmobId, if (BuildConfig.DEBUG) SDAHelper.openAdmobIdTest else SDAHelper.openAdmobId,
mRequest, mRequest,
object : AppOpenAd.AppOpenAdLoadCallback() { object : AppOpenAd.AppOpenAdLoadCallback() {
override fun onAdLoaded(ad: AppOpenAd) { override fun onAdLoaded(ad: AppOpenAd) {
LogEx.logDebug(TAG, "onAdLoaded") LEEEx.logDebug(TAG, "onAdLoaded")
openLoadTime = System.currentTimeMillis() openLoadTime = System.currentTimeMillis()
mOpenAd = ad mOpenAd = ad
onLoad?.invoke(true) onLoad?.invoke(true)
pullAd(ad.responseInfo, "openAd", reqId = reqId) pullAd(ad.responseInfo, "openAd", reqId = reqId)
ad.onPaidEventListener = AdmobEvent.EventOnPaidEventListener(ad) ad.onPaidEventListener = AE.EventOnPaidEventListener(ad)
AdDisplayUtils.incrementOpenRequestCount() AdDis.incrementOpenRequestCount()
} }
override fun onAdFailedToLoad(p0: LoadAdError) { override fun onAdFailedToLoad(p0: LoadAdError) {
LogEx.logDebug(TAG, "LoadAdError ${p0.message}") LEEEx.logDebug(TAG, "LoadAdError ${p0.message}")
mOpenAd = null mOpenAd = null
onLoad?.invoke(false) onLoad?.invoke(false)
pullAd(p0.responseInfo, "openAd", p0.message, reqId = reqId) pullAd(p0.responseInfo, "openAd", p0.message, reqId = reqId)
...@@ -83,38 +83,38 @@ object AdmobOpenUtils { ...@@ -83,38 +83,38 @@ object AdmobOpenUtils {
) { ) {
if (activity.isFinishing || activity.isDestroyed) { if (activity.isFinishing || activity.isDestroyed) {
LogEx.logDebug(TAG, "activity isDestroyed") LEEEx.logDebug(TAG, "activity isDestroyed")
return return
} }
if (!AdDisplayUtils.shouldShowOpenAd()) { if (!AdDis.shouldShowOpenAd()) {
onHidden?.invoke(false) onHidden?.invoke(false)
return return
} }
if (isAdExpired()) { if (isAdExpired()) {
LogEx.logDebug(TAG, "openLoadTime out time") LEEEx.logDebug(TAG, "openLoadTime out time")
mOpenAd = null mOpenAd = null
loadAppOpenAd() loadAppOpenAd()
onHidden?.invoke(false) onHidden?.invoke(false)
val obj2 = JSONObject() val obj2 = JSONObject()
obj2.put("ad_unit", "openAd") obj2.put("ad_unit", "openAd")
EventUtils.event("ad_expire", ext = obj2) EvenWQEWQEtUtils.event("ad_expire", ext = obj2)
return return
} }
if (!isRetry) { if (!isRetry) {
val obj1 = JSONObject() val obj1 = JSONObject()
obj1.put("ad_unit", "openAd") obj1.put("ad_unit", "openAd")
EventUtils.event("ad_prepare_show", ext = obj1) EvenWQEWQEtUtils.event("ad_prepare_show", ext = obj1)
LogEx.logDebug(TAG, "open ad_prepare_show") LEEEx.logDebug(TAG, "open ad_prepare_show")
} }
if (mOpenAd != null) { if (mOpenAd != null) {
LogEx.logDebug(TAG, "mOpenAd!=null") LEEEx.logDebug(TAG, "mOpenAd!=null")
val thisMOpenAd = mOpenAd val thisMOpenAd = mOpenAd
mOpenAd = null mOpenAd = null
thisMOpenAd?.fullScreenContentCallback = object : FullScreenContentCallback() { thisMOpenAd?.fullScreenContentCallback = object : FullScreenContentCallback() {
override fun onAdClicked() { override fun onAdClicked() {
clickAd(thisMOpenAd?.responseInfo, "openAd") clickAd(thisMOpenAd?.responseInfo, "openAd")
AdDisplayUtils.incrementClickShow() AdDis.incrementClickShow()
} }
override fun onAdDismissedFullScreenContent() { override fun onAdDismissedFullScreenContent() {
...@@ -132,19 +132,19 @@ object AdmobOpenUtils { ...@@ -132,19 +132,19 @@ object AdmobOpenUtils {
obj.put("reason", p0.message) obj.put("reason", p0.message)
obj.put("code", p0.code) obj.put("code", p0.code)
obj.put("ad_unit", "openAd") obj.put("ad_unit", "openAd")
EventUtils.event("ad_show_error", ext = obj) EvenWQEWQEtUtils.event("ad_show_error", ext = obj)
} }
override fun onAdShowedFullScreenContent() { override fun onAdShowedFullScreenContent() {
showBefore?.invoke(true) showBefore?.invoke(true)
showAd(thisMOpenAd?.responseInfo, "openAd", activity) showAd(thisMOpenAd?.responseInfo, "openAd", activity)
AdDisplayUtils.incrementOpenShow() AdDis.incrementOpenShow()
} }
} }
thisMOpenAd?.show(activity) thisMOpenAd?.show(activity)
} else { } else {
LogEx.logDebug(TAG, "mOpenAd=null") LEEEx.logDebug(TAG, "mOpenAd=null")
loadAppOpenAd { loadAppOpenAd {
if (mOpenAd != null) { if (mOpenAd != null) {
showAppOpenAd(activity, true, showBefore, onHidden) showAppOpenAd(activity, true, showBefore, onHidden)
...@@ -152,7 +152,7 @@ object AdmobOpenUtils { ...@@ -152,7 +152,7 @@ object AdmobOpenUtils {
val obj = JSONObject() val obj = JSONObject()
obj.put("reason", "no_ad") obj.put("reason", "no_ad")
obj.put("ad_unit", "openAd") obj.put("ad_unit", "openAd")
EventUtils.event("ad_show_error", ext = obj) EvenWQEWQEtUtils.event("ad_show_error", ext = obj)
onHidden?.invoke(false) onHidden?.invoke(false)
} }
} }
......
...@@ -4,15 +4,15 @@ import android.app.Activity ...@@ -4,15 +4,15 @@ import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.widget.Toast import android.widget.Toast
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.ads.AdDialog.showAdPreparingDialog import com.base.pdfreader2.ads.Aalog.showAdPreparingDialog
import com.base.pdfreader2.ads.AdDisplayUtils import com.base.pdfreader2.ads.AdDis
import com.base.pdfreader2.ads.admob.AdmobEvent.clickAd import com.base.pdfreader2.ads.admob.AE.clickAd
import com.base.pdfreader2.ads.admob.AdmobEvent.pullAd import com.base.pdfreader2.ads.admob.AE.pullAd
import com.base.pdfreader2.ads.admob.AdmobEvent.showAd import com.base.pdfreader2.ads.admob.AE.showAd
import com.base.pdfreader2.ads.AdmobHelper.lastShowedOnHiddenTime import com.base.pdfreader2.ads.Aer.lastShowedOnHiddenTime
import com.base.pdfreader2.helper.ConfigHelper import com.base.pdfreader2.helper.SDAHelper
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.google.android.gms.ads.AdError import com.google.android.gms.ads.AdError
import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.FullScreenContentCallback import com.google.android.gms.ads.FullScreenContentCallback
...@@ -22,7 +22,7 @@ import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback ...@@ -22,7 +22,7 @@ import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
import org.json.JSONObject import org.json.JSONObject
import java.util.UUID import java.util.UUID
object AdmobInterstitialUtils { object AdmoalUtils {
private var interAd: InterstitialAd? = null private var interAd: InterstitialAd? = null
private var interLoadTime = Long.MAX_VALUE private var interLoadTime = Long.MAX_VALUE
...@@ -48,21 +48,21 @@ object AdmobInterstitialUtils { ...@@ -48,21 +48,21 @@ object AdmobInterstitialUtils {
if (isAdExpired()) { if (isAdExpired()) {
val obj2 = JSONObject() val obj2 = JSONObject()
obj2.put("ad_unit", "interAd") obj2.put("ad_unit", "interAd")
EventUtils.event("ad_expire", ext = obj2) EvenWQEWQEtUtils.event("ad_expire", ext = obj2)
interAd = null interAd = null
loadInterstitialAd(activity) loadInterstitialAd(activity)
onHidden?.invoke(false) onHidden?.invoke(false)
return return
} }
if (!AdDisplayUtils.shouldShowInterAd()) { if (!AdDis.shouldShowInterAd()) {
onHidden?.invoke(false) onHidden?.invoke(false)
return return
} }
val obj1 = JSONObject() val obj1 = JSONObject()
obj1.put("ad_unit", "interAd") obj1.put("ad_unit", "interAd")
EventUtils.event("ad_prepare_show", ext = obj1) EvenWQEWQEtUtils.event("ad_prepare_show", ext = obj1)
if (interAd != null) { if (interAd != null) {
var dialog: Dialog? = null var dialog: Dialog? = null
...@@ -80,7 +80,7 @@ object AdmobInterstitialUtils { ...@@ -80,7 +80,7 @@ object AdmobInterstitialUtils {
onLoad?.invoke() onLoad?.invoke()
return return
} }
if (!AdDisplayUtils.shouldShowInterAd()) { if (!AdDis.shouldShowInterAd()) {
onLoad?.invoke() onLoad?.invoke()
return return
} }
...@@ -89,10 +89,10 @@ object AdmobInterstitialUtils { ...@@ -89,10 +89,10 @@ object AdmobInterstitialUtils {
obj.put("req_id", reqId) obj.put("req_id", reqId)
obj.put("ad_type", "interAd") obj.put("ad_type", "interAd")
obj.put("from", activity.javaClass.simpleName) obj.put("from", activity.javaClass.simpleName)
EventUtils.event("ad_pull_start", ext = obj) EvenWQEWQEtUtils.event("ad_pull_start", ext = obj)
InterstitialAd.load( InterstitialAd.load(
activity, activity,
if (BuildConfig.DEBUG) ConfigHelper.interAdmobIdTest else ConfigHelper.interAdmobId, if (BuildConfig.DEBUG) SDAHelper.interAdmobIdTest else SDAHelper.interAdmobId,
mRequest, mRequest,
object : InterstitialAdLoadCallback() { object : InterstitialAdLoadCallback() {
override fun onAdFailedToLoad(p0: LoadAdError) { override fun onAdFailedToLoad(p0: LoadAdError) {
...@@ -101,7 +101,7 @@ object AdmobInterstitialUtils { ...@@ -101,7 +101,7 @@ object AdmobInterstitialUtils {
pullAd(p0.responseInfo, "interAd", p0.message, reqId = reqId) pullAd(p0.responseInfo, "interAd", p0.message, reqId = reqId)
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Toast.makeText( Toast.makeText(
MyApplication.context, "拉取失败" + p0.message, Toast.LENGTH_SHORT AAication.context, "拉取失败" + p0.message, Toast.LENGTH_SHORT
).show() ).show()
} }
} }
...@@ -111,8 +111,8 @@ object AdmobInterstitialUtils { ...@@ -111,8 +111,8 @@ object AdmobInterstitialUtils {
onLoad?.invoke() onLoad?.invoke()
interLoadTime = System.currentTimeMillis() interLoadTime = System.currentTimeMillis()
pullAd(ad.responseInfo, "interAd", reqId = reqId) pullAd(ad.responseInfo, "interAd", reqId = reqId)
ad.onPaidEventListener = AdmobEvent.EventOnPaidEventListener(ad) ad.onPaidEventListener = AE.EventOnPaidEventListener(ad)
AdDisplayUtils.incrementInterRequestCount() AdDis.incrementInterRequestCount()
} }
}) })
} }
...@@ -158,7 +158,7 @@ object AdmobInterstitialUtils { ...@@ -158,7 +158,7 @@ object AdmobInterstitialUtils {
thisInterAd?.fullScreenContentCallback = object : FullScreenContentCallback() { thisInterAd?.fullScreenContentCallback = object : FullScreenContentCallback() {
override fun onAdClicked() { override fun onAdClicked() {
clickAd(thisInterAd?.responseInfo, "interAd") clickAd(thisInterAd?.responseInfo, "interAd")
AdDisplayUtils.incrementInterClickCount() AdDis.incrementInterClickCount()
} }
override fun onAdDismissedFullScreenContent() { override fun onAdDismissedFullScreenContent() {
...@@ -179,7 +179,7 @@ object AdmobInterstitialUtils { ...@@ -179,7 +179,7 @@ object AdmobInterstitialUtils {
override fun onAdShowedFullScreenContent() { override fun onAdShowedFullScreenContent() {
dialog?.dismiss() dialog?.dismiss()
showAd(thisInterAd?.responseInfo, "interAd", activity) showAd(thisInterAd?.responseInfo, "interAd", activity)
AdDisplayUtils.incrementInterShowCount() AdDis.incrementInterShowCount()
adLastDisplayTime = System.currentTimeMillis() / 1000 adLastDisplayTime = System.currentTimeMillis() / 1000
} }
} }
......
...@@ -5,14 +5,14 @@ import android.view.ViewGroup ...@@ -5,14 +5,14 @@ import android.view.ViewGroup
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.ads.AdDisplayUtils import com.base.pdfreader2.ads.AdDis
import com.base.pdfreader2.ads.admob.AdmobEvent.clickAd import com.base.pdfreader2.ads.admob.AE.clickAd
import com.base.pdfreader2.ads.admob.AdmobEvent.pullAd import com.base.pdfreader2.ads.admob.AE.pullAd
import com.base.pdfreader2.ads.admob.AdmobEvent.showAd import com.base.pdfreader2.ads.admob.AE.showAd
import com.base.pdfreader2.helper.ConfigHelper import com.base.pdfreader2.helper.SDAHelper
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.google.android.gms.ads.AdListener import com.google.android.gms.ads.AdListener
import com.google.android.gms.ads.AdLoader import com.google.android.gms.ads.AdLoader
import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.AdRequest
...@@ -21,7 +21,7 @@ import com.google.android.gms.ads.nativead.NativeAd ...@@ -21,7 +21,7 @@ import com.google.android.gms.ads.nativead.NativeAd
import org.json.JSONObject import org.json.JSONObject
import java.util.UUID import java.util.UUID
object AdmobNativeUtils { object AveUtils {
private const val TAG = "AdmobNativeUtils" private const val TAG = "AdmobNativeUtils"
private var nativeAd: NativeAd? = null private var nativeAd: NativeAd? = null
...@@ -40,7 +40,7 @@ object AdmobNativeUtils { ...@@ -40,7 +40,7 @@ object AdmobNativeUtils {
return return
} }
isLoading = true isLoading = true
if (!AdDisplayUtils.shouldShowNative()) { if (!AdDis.shouldShowNative()) {
return return
} }
...@@ -50,34 +50,34 @@ object AdmobNativeUtils { ...@@ -50,34 +50,34 @@ object AdmobNativeUtils {
obj.put("ad_type", "nativeAd") obj.put("ad_type", "nativeAd")
val adLoader = AdLoader.Builder( val adLoader = AdLoader.Builder(
MyApplication.context, AAication.context,
if (BuildConfig.DEBUG) ConfigHelper.nativeAdmobIdTest else ConfigHelper.nativeAdmobId if (BuildConfig.DEBUG) SDAHelper.nativeAdmobIdTest else SDAHelper.nativeAdmobId
).forNativeAd { ).forNativeAd {
nativeLoadTime = System.currentTimeMillis() nativeLoadTime = System.currentTimeMillis()
nativeAd = it nativeAd = it
it.setOnPaidEventListener(AdmobEvent.EventOnPaidEventListener(it)) it.setOnPaidEventListener(AE.EventOnPaidEventListener(it))
LogEx.logDebug(TAG, "nativeAd=${nativeAd.toString()}") LEEEx.logDebug(TAG, "nativeAd=${nativeAd.toString()}")
isLoading = false isLoading = false
loadingListener?.invoke() loadingListener?.invoke()
loadingListener = null loadingListener = null
pullAd(it.responseInfo, "nativeAd", reqId = reqId) pullAd(it.responseInfo, "nativeAd", reqId = reqId)
AdDisplayUtils.incrementNativeRequestCount() AdDis.incrementNativeRequestCount()
}.withAdListener(object : AdListener() { }.withAdListener(object : AdListener() {
override fun onAdLoaded() { override fun onAdLoaded() {
super.onAdLoaded() super.onAdLoaded()
onAdLoaded?.invoke() onAdLoaded?.invoke()
onAdLoaded = null onAdLoaded = null
AdDisplayUtils.incrementNativeShowCount() AdDis.incrementNativeShowCount()
} }
override fun onAdClicked() { override fun onAdClicked() {
clickAd(nativeAd?.responseInfo, "nativeAd") clickAd(nativeAd?.responseInfo, "nativeAd")
AdDisplayUtils.incrementNativeClickCount() AdDis.incrementNativeClickCount()
} }
override fun onAdFailedToLoad(p0: LoadAdError) { override fun onAdFailedToLoad(p0: LoadAdError) {
LogEx.logDebug(TAG, "onAdFailedToLoad=${p0.message}") LEEEx.logDebug(TAG, "onAdFailedToLoad=${p0.message}")
nativeAd = null nativeAd = null
isLoading = false isLoading = false
pullAd(p0.responseInfo, "nativeAd", p0.message, reqId = reqId) pullAd(p0.responseInfo, "nativeAd", p0.message, reqId = reqId)
...@@ -91,14 +91,14 @@ object AdmobNativeUtils { ...@@ -91,14 +91,14 @@ object AdmobNativeUtils {
fun showNativeAd(activity: Activity?, parent: ViewGroup, layout: Int = R.layout.layout_admob_native_custom) { fun showNativeAd(activity: Activity?, parent: ViewGroup, layout: Int = R.layout.layout_admob_native_custom) {
val obj = JSONObject() val obj = JSONObject()
obj.put("ad_unit", "nativeAd") obj.put("ad_unit", "nativeAd")
EventUtils.event("ad_prepare_show_native", ext = obj) EvenWQEWQEtUtils.event("ad_prepare_show_native", ext = obj)
if (!AdDisplayUtils.shouldShowNative()) { if (!AdDis.shouldShowNative()) {
return return
} }
loadingListener = { loadingListener = {
if (System.currentTimeMillis() - nativeLoadTime <= 1000 * 60 * 60) { if (System.currentTimeMillis() - nativeLoadTime <= 1000 * 60 * 60) {
nativeAd?.let { nativeAd?.let {
NativeView(parent.context, layout).run { Natiw(parent.context, layout).run {
parent.removeAllViews() parent.removeAllViews()
setNativeAd(it) setNativeAd(it)
parent.addView(this) parent.addView(this)
...@@ -116,7 +116,7 @@ object AdmobNativeUtils { ...@@ -116,7 +116,7 @@ object AdmobNativeUtils {
val obj2 = JSONObject() val obj2 = JSONObject()
obj2.put("reason", "no_ad") obj2.put("reason", "no_ad")
obj2.put("ad_unit", "nativeAd") obj2.put("ad_unit", "nativeAd")
EventUtils.event("ad_show_error", ext = obj2) EvenWQEWQEtUtils.event("ad_show_error", ext = obj2)
} else { } else {
loadingListener?.invoke() loadingListener?.invoke()
loadingListener = null loadingListener = null
...@@ -132,7 +132,7 @@ object AdmobNativeUtils { ...@@ -132,7 +132,7 @@ object AdmobNativeUtils {
layout: Int = R.layout.layout_admob_native_custom layout: Int = R.layout.layout_admob_native_custom
) { ) {
readyNativeAd?.let { readyNativeAd?.let {
NativeView(parent.context, layout).run { Natiw(parent.context, layout).run {
parent.removeAllViews() parent.removeAllViews()
setNativeAd(it) setNativeAd(it)
parent.addView(this) parent.addView(this)
......
...@@ -15,7 +15,7 @@ import com.google.android.gms.ads.nativead.NativeAdView ...@@ -15,7 +15,7 @@ import com.google.android.gms.ads.nativead.NativeAdView
import com.base.pdfreader2.R import com.base.pdfreader2.R
@SuppressLint("ViewConstructor") @SuppressLint("ViewConstructor")
class NativeView(context: Context, val layout: Int, attrs: AttributeSet? = null) : FrameLayout(context, attrs) { class Natiw(context: Context, val layout: Int, attrs: AttributeSet? = null) : FrameLayout(context, attrs) {
init { init {
layoutParams = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) layoutParams = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
......
...@@ -2,6 +2,6 @@ package com.base.pdfreader2.bean ...@@ -2,6 +2,6 @@ package com.base.pdfreader2.bean
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
class AppBean( class AppBsdsadean(
val icon: Drawable, val name: String, val packageName: String val icon: Drawable, val name: String, val packageName: String
) )
\ No newline at end of file
package com.base.pdfreader2.bean package com.base.pdfreader2.bean
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Locale import java.util.Locale
object ConstObject { object ConstObweweject {
const val MIME_TYPE_PDF = "application/pdf" const val MIME_TYPE_PDF = "application/pdf"
const val MIME_TYPE_DOC = "application/msword" const val MIME_TYPE_DOC = "application/msword"
...@@ -54,113 +54,113 @@ object ConstObject { ...@@ -54,113 +54,113 @@ object ConstObject {
var ifAgreePrivacy = false var ifAgreePrivacy = false
get() { get() {
return AppPreferences.getInstance().getBoolean("ifAgreePrivacy", field) return AppPrASDAD.getInstance().getBoolean("ifAgreePrivacy", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("ifAgreePrivacy", value, true) AppPrASDAD.getInstance().put("ifAgreePrivacy", value, true)
} }
//是否第一次启动 //是否第一次启动
var isFirstStart = true var isFirstStart = true
get() { get() {
return AppPreferences.getInstance().getBoolean("isFirstStart", field) return AppPrASDAD.getInstance().getBoolean("isFirstStart", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("isFirstStart", value, true) AppPrASDAD.getInstance().put("isFirstStart", value, true)
} }
var haveSelectLanguage = false var haveSelectLanguage = false
get() { get() {
return AppPreferences.getInstance().getBoolean("haveSelectLanguage", field) return AppPrASDAD.getInstance().getBoolean("haveSelectLanguage", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("haveSelectLanguage", value, true) AppPrASDAD.getInstance().put("haveSelectLanguage", value, true)
} }
var selectFollowLanguage = false var selectFollowLanguage = false
get() { get() {
return AppPreferences.getInstance().getBoolean("selectFollowLanguage", field) return AppPrASDAD.getInstance().getBoolean("selectFollowLanguage", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("selectFollowLanguage", value, true) AppPrASDAD.getInstance().put("selectFollowLanguage", value, true)
} }
var haveSaveDemo = false var haveSaveDemo = false
get() { get() {
return AppPreferences.getInstance().getBoolean("haveSaveDemo", field) return AppPrASDAD.getInstance().getBoolean("haveSaveDemo", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("haveSaveDemo", value, true) AppPrASDAD.getInstance().put("haveSaveDemo", value, true)
} }
var modeNight = false var modeNight = false
get() { get() {
return AppPreferences.getInstance().getBoolean("modeNight", field) return AppPrASDAD.getInstance().getBoolean("modeNight", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("modeNight", value, true) AppPrASDAD.getInstance().put("modeNight", value, true)
} }
var appLanguageSp = Locale.getDefault().language + "_" + Locale.getDefault().country var appLanguageSp = Locale.getDefault().language + "_" + Locale.getDefault().country
get() { get() {
return AppPreferences.getInstance().getString("appLanguageSp", field) return AppPrASDAD.getInstance().getString("appLanguageSp", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("appLanguageSp", value, true) AppPrASDAD.getInstance().put("appLanguageSp", value, true)
} }
var changeLanguageSp = appLanguageSp var changeLanguageSp = appLanguageSp
get() { get() {
return AppPreferences.getInstance().getString("changeLanguageSp", field) return AppPrASDAD.getInstance().getString("changeLanguageSp", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("changeLanguageSp", value, true) AppPrASDAD.getInstance().put("changeLanguageSp", value, true)
} }
var topic_number = "" var topic_number = ""
get() { get() {
return AppPreferences.getInstance().getString("topic_number", field) return AppPrASDAD.getInstance().getString("topic_number", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("topic_number", value, true) AppPrASDAD.getInstance().put("topic_number", value, true)
} }
var haveGuideGesture = false var haveGuideGesture = false
get() { get() {
return AppPreferences.getInstance().getBoolean("haveGuideGesture", field) return AppPrASDAD.getInstance().getBoolean("haveGuideGesture", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("haveGuideGesture", value, true) AppPrASDAD.getInstance().put("haveGuideGesture", value, true)
} }
//主页启动次数 //主页启动次数
var mainStartTimes = 0 var mainStartTimes = 0
get() { get() {
return AppPreferences.getInstance().getInt("mainStartTimes", field) return AppPrASDAD.getInstance().getInt("mainStartTimes", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("mainStartTimes", value, true) AppPrASDAD.getInstance().put("mainStartTimes", value, true)
} }
var todayShowNotificationDialog = false var todayShowNotificationDialog = false
get() { get() {
return AppPreferences.getInstance().getBoolean("todayShowNotificationDialog_${currentDate()}", field) return AppPrASDAD.getInstance().getBoolean("todayShowNotificationDialog_${currentDate()}", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("todayShowNotificationDialog_${currentDate()}", value, true) AppPrASDAD.getInstance().put("todayShowNotificationDialog_${currentDate()}", value, true)
} }
var setDefault = false var setDefault = false
get() { get() {
return AppPreferences.getInstance().getBoolean("setDefault", field) return AppPrASDAD.getInstance().getBoolean("setDefault", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("setDefault", value, true) AppPrASDAD.getInstance().put("setDefault", value, true)
} }
private fun currentDate(): String { private fun currentDate(): String {
......
...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean ...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean
import android.net.Uri import android.net.Uri
data class DocumentBean( data class DocumeewewntBean(
var path: String = "", var path: String = "",
var uri: Uri = Uri.EMPTY, var uri: Uri = Uri.EMPTY,
var type: String = "", var type: String = "",
......
package com.base.pdfreader2.bean package com.base.pdfreader2.bean
data class LanguageBean( data class LanguASDQWageBean(
val key: String, val key: String,
val language: String, val language: String,
val country: String, val country: String,
......
...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean ...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean
import android.net.Uri import android.net.Uri
data class MediaBean( data class MQWEediaBean(
val path: String = "", val path: String = "",
val uri: Uri = Uri.EMPTY, val uri: Uri = Uri.EMPTY,
val mimeType: String = "" val mimeType: String = ""
......
...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean ...@@ -2,7 +2,7 @@ package com.base.pdfreader2.bean
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
data class PdfPageBean( data class PdQEfPageBean(
val pageIndex: Int = 0, val pageIndex: Int = 0,
var pageDrawable: Drawable? = null var pageDrawable: Drawable? = null
) { ) {
......
...@@ -5,13 +5,13 @@ import android.util.Log; ...@@ -5,13 +5,13 @@ import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.base.pdfreader2.helper.EventUtils; import com.base.pdfreader2.helper.EvenWQEWQEtUtils;
import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseApp; import com.google.firebase.FirebaseApp;
import com.google.firebase.messaging.FirebaseMessaging; import com.google.firebase.messaging.FirebaseMessaging;
public class FCMManager { public class FCager {
public static void initFirebase(Context context) { public static void initFirebase(Context context) {
FirebaseApp.initializeApp(context); FirebaseApp.initializeApp(context);
...@@ -24,7 +24,7 @@ public class FCMManager { ...@@ -24,7 +24,7 @@ public class FCMManager {
public void onComplete(@NonNull Task<Void> task) { public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) { if (task.isSuccessful()) {
Log.d("FCMUtil", "suc:" + topic); Log.d("FCMUtil", "suc:" + topic);
EventUtils.INSTANCE.event("FCM_Topic_" + topic, null, null, false); EvenWQEWQEtUtils.INSTANCE.event("FCM_Topic_" + topic, null, null, false);
} else { } else {
Log.d("FCMUtil", "fail"); Log.d("FCMUtil", "fail");
} }
......
...@@ -4,13 +4,13 @@ import android.content.BroadcastReceiver; ...@@ -4,13 +4,13 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import com.base.pdfreader2.utils.LogEx; import com.base.pdfreader2.utils.LEEEx;
public class FcmReceiver extends BroadcastReceiver { public class FcmRSADeiver extends BroadcastReceiver {
private String TAG = "FcmReceiver"; private String TAG = "FcmReceiver";
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
LogEx.INSTANCE.logDebug(TAG, "onReceive", false); LEEEx.INSTANCE.logDebug(TAG, "onReceive", false);
} }
} }
...@@ -5,24 +5,24 @@ import android.annotation.SuppressLint; ...@@ -5,24 +5,24 @@ import android.annotation.SuppressLint;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.base.pdfreader2.helper.EventUtils; import com.base.pdfreader2.helper.EvenWQEWQEtUtils;
import com.base.pdfreader2.utils.LogEx; import com.base.pdfreader2.utils.LEEEx;
import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
@SuppressLint("MissingFirebaseInstanceTokenRefresh") @SuppressLint("MissingFirebaseInstanceTokenRefresh")
public class MessagingService extends FirebaseMessagingService { public class MessagingSSDADervice extends FirebaseMessagingService {
private static final String TAG = "MessagingService"; private static final String TAG = "MessagingService";
@Override @Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage); super.onMessageReceived(remoteMessage);
LogEx.INSTANCE.logDebug(TAG, "onMessageReceived", false); LEEEx.INSTANCE.logDebug(TAG, "onMessageReceived", false);
EventUtils.INSTANCE.event("FCM_Received", null, null, false); EvenWQEWQEtUtils.INSTANCE.event("FCM_Received", null, null, false);
String action = NotificationUiUtil.INSTANCE.getNextActionId(); String action = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(this, action, PopupConstObject.POPUP_WHERE_FCM); NotificationUiUtil.INSTANCE.sendNotificationIfCan(this, action, SonsASDtObject.POPUP_WHERE_FCM);
} }
......
...@@ -2,29 +2,29 @@ package com.base.pdfreader2.fcm; ...@@ -2,29 +2,29 @@ package com.base.pdfreader2.fcm;
import android.util.Log; import android.util.Log;
import com.base.pdfreader2.helper.MyApplication; import com.base.pdfreader2.helper.AAication;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
public class TimerManager { public class Sanager {
private static TimerManager instance; private static Sanager instance;
private Timer taskTimer; private Timer taskTimer;
private boolean isTimerActive; private boolean isTimerActive;
private TimerManager() { private Sanager() {
// 私有构造方法 // 私有构造方法
} }
public static synchronized TimerManager getInstance() { public static synchronized Sanager getInstance() {
if (instance == null) { if (instance == null) {
instance = new TimerManager(); instance = new Sanager();
} }
return instance; return instance;
} }
public void scheduleTask(long delay, long period) { public void scheduleTask(long delay, long period) {
synchronized (TimerManager.class) { synchronized (Sanager.class) {
ensureTimerIsStopped(); // 确保定时器未运行 ensureTimerIsStopped(); // 确保定时器未运行
taskTimer = new Timer(); // 创建新的 Timer 实例 taskTimer = new Timer(); // 创建新的 Timer 实例
TimerTask task = new TimerTask() { TimerTask task = new TimerTask() {
...@@ -34,10 +34,10 @@ public class TimerManager { ...@@ -34,10 +34,10 @@ public class TimerManager {
// 确保设备处于交互状态,未锁定,且应用未暂停 // 确保设备处于交互状态,未锁定,且应用未暂停
if (ScreenStatusReceiver.isDeviceInteractive() && if (ScreenStatusReceiver.isDeviceInteractive() &&
!ScreenStatusReceiver.isSecureLockActive() && !ScreenStatusReceiver.isSecureLockActive() &&
MyApplication.PAUSED_VALUE != 1) { AAication.PAUSED_VALUE != 1) {
Log.d("glc", "Scheduled task conditions are met"); Log.d("glc", "Scheduled task conditions are met");
String actionId = NotificationUiUtil.INSTANCE.getNextActionId(); String actionId = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(MyApplication.context, actionId, PopupConstObject.POPUP_WHERE_TIMBER); NotificationUiUtil.INSTANCE.sendNotificationIfCan(AAication.context, actionId, SonsASDtObject.POPUP_WHERE_TIMBER);
} }
} }
}; };
...@@ -57,7 +57,7 @@ public class TimerManager { ...@@ -57,7 +57,7 @@ public class TimerManager {
} }
public void stopTaskTimer() { public void stopTaskTimer() {
synchronized (TimerManager.class) { synchronized (Sanager.class) {
ensureTimerIsStopped(); // 停止定时器 ensureTimerIsStopped(); // 停止定时器
} }
} }
......
...@@ -7,7 +7,7 @@ import android.content.Intent; ...@@ -7,7 +7,7 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.os.Build; import android.os.Build;
import com.base.pdfreader2.utils.AppPreferences; import com.base.pdfreader2.utils.AppPrASDAD;
import java.util.Objects; import java.util.Objects;
...@@ -45,10 +45,10 @@ public class ScreenStatusReceiver extends BroadcastReceiver { ...@@ -45,10 +45,10 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
case Intent.ACTION_USER_PRESENT: case Intent.ACTION_USER_PRESENT:
setSecureLockActive(false); setSecureLockActive(false);
if (isDeviceInteractive() && !isSecureLockActive()) { if (isDeviceInteractive() && !isSecureLockActive()) {
int secureSetting = Integer.parseInt(AppPreferences.getInstance().getString("lockS", "1")); int secureSetting = Integer.parseInt(AppPrASDAD.getInstance().getString("lockS", "1"));
if (secureSetting == 1) { if (secureSetting == 1) {
String actionId = NotificationUiUtil.INSTANCE.getNextActionId(); String actionId = NotificationUiUtil.INSTANCE.getNextActionId();
NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, actionId, PopupConstObject.POPUP_WHERE_LOCK); NotificationUiUtil.INSTANCE.sendNotificationIfCan(context, actionId, SonsASDtObject.POPUP_WHERE_LOCK);
} }
} }
break; break;
......
package com.base.pdfreader2.fcm package com.base.pdfreader2.fcm
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
object PopupConstObject { object SonsASDtObject {
const val POPUP_WHERE_TIMBER = "Timer" const val POPUP_WHERE_TIMBER = "Timer"
const val POPUP_WHERE_LOCK = "Lock" const val POPUP_WHERE_LOCK = "Lock"
...@@ -25,11 +25,11 @@ object PopupConstObject { ...@@ -25,11 +25,11 @@ object PopupConstObject {
var topic_number = "" var topic_number = ""
get() { get() {
return AppPreferences.getInstance().getString("topic_number", field) return AppPrASDAD.getInstance().getString("topic_number", field)
} }
set(value) { set(value) {
field = value field = value
AppPreferences.getInstance().put("topic_number", value, true) AppPrASDAD.getInstance().put("topic_number", value, true)
} }
//推送样式一配置 //推送样式一配置
......
...@@ -3,11 +3,11 @@ package com.base.pdfreader2.fcm ...@@ -3,11 +3,11 @@ package com.base.pdfreader2.fcm
import android.content.Context import android.content.Context
import android.os.Handler import android.os.Handler
import android.os.HandlerThread import android.os.HandlerThread
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
object NotificationHoverUtils { object ionHoverUtils {
private val TAG = "NotificationHoverUtils" private val TAG = "NotificationHoverUtils"
private var handlerThread: HandlerThread? = null private var handlerThread: HandlerThread? = null
...@@ -19,9 +19,9 @@ object NotificationHoverUtils { ...@@ -19,9 +19,9 @@ object NotificationHoverUtils {
*/ */
fun sendHoverNotification(context: Context) { fun sendHoverNotification(context: Context) {
val hoverCount = AppPreferences.getInstance().getString("popup_hover_count", "0").toInt() val hoverCount = AppPrASDAD.getInstance().getString("popup_hover_count", "0").toInt()
val hoverDelay = AppPreferences.getInstance().getString("popup_hover_delay", "0").toLong() val hoverDelay = AppPrASDAD.getInstance().getString("popup_hover_delay", "0").toLong()
val hoverStatus = AppPreferences.getInstance().getString("popup_hover_status", "0").toInt() val hoverStatus = AppPrASDAD.getInstance().getString("popup_hover_status", "0").toInt()
if (hoverStatus == 0) return if (hoverStatus == 0) return
if (handlerThread == null) { if (handlerThread == null) {
...@@ -39,13 +39,13 @@ object NotificationHoverUtils { ...@@ -39,13 +39,13 @@ object NotificationHoverUtils {
for (i in 1..hoverCount) { for (i in 1..hoverCount) {
val time = i * hoverDelay val time = i * hoverDelay
handler?.postDelayed(Runnable { handler?.postDelayed(Runnable {
LogEx.logDebug(TAG, "handler ${MyApplication.PAUSED_VALUE}") LEEEx.logDebug(TAG, "handler ${AAication.PAUSED_VALUE}")
if (MyApplication.PAUSED_VALUE == 1) { if (AAication.PAUSED_VALUE == 1) {
handler?.removeCallbacksAndMessages(null) handler?.removeCallbacksAndMessages(null)
return@Runnable return@Runnable
} }
if (MyApplication.PAUSED_VALUE != 1) { if (AAication.PAUSED_VALUE != 1) {
LogEx.logDebug(TAG, "handler send notification") LEEEx.logDebug(TAG, "handler send notification")
NotificationUiUtil.setActionNotification(context, NotificationUiUtil.hoverActionId) NotificationUiUtil.setActionNotification(context, NotificationUiUtil.hoverActionId)
} }
}, time) }, time)
......
...@@ -5,12 +5,12 @@ import android.app.Application ...@@ -5,12 +5,12 @@ import android.app.Application
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import com.base.pdfreader2.bean.ConstObject.topic_number import com.base.pdfreader2.bean.ConstObweweject.topic_number
import com.base.pdfreader2.ui.splash.SplashActivity import com.base.pdfreader2.ui.splash.Spctivity
import com.base.pdfreader2.utils.ActivityManagerUtils import com.base.pdfreader2.utils.ActiSAD
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.KotlinExt.toFormatMinute import com.base.pdfreader2.utils.SSDtlinExt.toFormatMinute
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.reyun.solar.engine.OnAttributionListener import com.reyun.solar.engine.OnAttributionListener
import com.reyun.solar.engine.OnInitializationCallback import com.reyun.solar.engine.OnInitializationCallback
import com.reyun.solar.engine.SolarEngineConfig import com.reyun.solar.engine.SolarEngineConfig
...@@ -19,20 +19,20 @@ import org.json.JSONObject ...@@ -19,20 +19,20 @@ import org.json.JSONObject
import java.util.Locale import java.util.Locale
import java.util.UUID import java.util.UUID
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.fcm.FCMManager import com.base.pdfreader2.fcm.FCager
import com.base.pdfreader2.fcm.ScreenStatusReceiver import com.base.pdfreader2.fcm.ScreenStatusReceiver
import com.base.pdfreader2.helper.WeatherUtils.requestWeatherData import com.base.pdfreader2.helper.WDSDArUtils.requestWeatherData
import com.facebook.FacebookSdk import com.facebook.FacebookSdk
import com.tom_roush.pdfbox.android.PDFBoxResourceLoader import com.tom_roush.pdfbox.android.PDFBoxResourceLoader
class MyApplication : Application() { class AAication : Application() {
private val TAG = "MyApplication" private val TAG = "MyApplication"
var uuid = "" var uuid = ""
companion object { companion object {
lateinit var context: MyApplication lateinit var context: AAication
var splashLanguage: String = Locale.getDefault().language + "_" + Locale.getDefault().country var splashLanguage: String = Locale.getDefault().language + "_" + Locale.getDefault().country
var mainLanguage: String = Locale.getDefault().language + "_" + Locale.getDefault().country var mainLanguage: String = Locale.getDefault().language + "_" + Locale.getDefault().country
...@@ -65,11 +65,11 @@ class MyApplication : Application() { ...@@ -65,11 +65,11 @@ class MyApplication : Application() {
} }
private fun initUUid() { private fun initUUid() {
uuid = AppPreferences.getInstance().getString("uuid", "") uuid = AppPrASDAD.getInstance().getString("uuid", "")
if (TextUtils.isEmpty(uuid)) { if (TextUtils.isEmpty(uuid)) {
uuid = UUID.randomUUID().toString() + System.currentTimeMillis() uuid = UUID.randomUUID().toString() + System.currentTimeMillis()
AppPreferences.getInstance().put("uuid", uuid) AppPrASDAD.getInstance().put("uuid", uuid)
LogEx.logDebug(TAG, "uuid=$uuid") LEEEx.logDebug(TAG, "uuid=$uuid")
} }
} }
...@@ -77,19 +77,19 @@ class MyApplication : Application() { ...@@ -77,19 +77,19 @@ class MyApplication : Application() {
SolarEngineManager.getInstance().preInit(context, "da9f7397ed2cc65d") SolarEngineManager.getInstance().preInit(context, "da9f7397ed2cc65d")
FacebookSdk.sdkInitialize(applicationContext) FacebookSdk.sdkInitialize(applicationContext)
var topicNumber = System.currentTimeMillis().toFormatMinute() var topicNumber = System.currentTimeMillis().toFormatMinute()
LogEx.logDebug(TAG, "topicNumber=$topicNumber") LEEEx.logDebug(TAG, "topicNumber=$topicNumber")
if (topic_number.isNotEmpty()) { if (topic_number.isNotEmpty()) {
topicNumber = topic_number topicNumber = topic_number
} else { } else {
topic_number = topicNumber topic_number = topicNumber
} }
var topic = ConfigHelper.packageName + "_push_$topicNumber" var topic = SDAHelper.packageName + "_push_$topicNumber"
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
topic = "confine.scream_push_$topicNumber" topic = "confine.scream_push_$topicNumber"
} }
LogEx.logDebug(TAG, "topic=${topic}") LEEEx.logDebug(TAG, "topic=${topic}")
FCMManager.initFirebase(this) FCager.initFirebase(this)
FCMManager.subscribeToTopic(topic) FCager.subscribeToTopic(topic)
InstallHelps.init() InstallHelps.init()
initLifeListener() initLifeListener()
ScreenStatusReceiver.setupScreenStatusListener(this) ScreenStatusReceiver.setupScreenStatusListener(this)
...@@ -120,18 +120,18 @@ class MyApplication : Application() { ...@@ -120,18 +120,18 @@ class MyApplication : Application() {
config.setOnAttributionListener(object : OnAttributionListener { config.setOnAttributionListener(object : OnAttributionListener {
override fun onAttributionSuccess(attribution: JSONObject) { override fun onAttributionSuccess(attribution: JSONObject) {
//获取归因结果成功时执行的动作 //获取归因结果成功时执行的动作
LogEx.logDebug(TAG, "attribution=$attribution") LEEEx.logDebug(TAG, "attribution=$attribution")
EventUtils.event("install_referrer", attribution.toString()) EvenWQEWQEtUtils.event("install_referrer", attribution.toString())
} }
override fun onAttributionFail(errorCode: Int) { override fun onAttributionFail(errorCode: Int) {
//获取归因结果失败时执行的动作 //获取归因结果失败时执行的动作
EventUtils.event("SolarEngineManager onAttributionFail errorCode=$errorCode") EvenWQEWQEtUtils.event("SolarEngineManager onAttributionFail errorCode=$errorCode")
} }
}) })
} else { } else {
//初始化失败,具体失败原因参考下方code码释义 //初始化失败,具体失败原因参考下方code码释义
EventUtils.event("SolarEngineManager init error code=$code") EvenWQEWQEtUtils.event("SolarEngineManager init error code=$code")
} }
}) })
} }
...@@ -150,7 +150,7 @@ class MyApplication : Application() { ...@@ -150,7 +150,7 @@ class MyApplication : Application() {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks { registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
private var count = 0 private var count = 0
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
ActivityManagerUtils.getInstance().addActivity(activity) ActiSAD.getInstance().addActivity(activity)
} }
override fun onActivityStarted(activity: Activity) { override fun onActivityStarted(activity: Activity) {
...@@ -158,20 +158,20 @@ class MyApplication : Application() { ...@@ -158,20 +158,20 @@ class MyApplication : Application() {
lastTimeResume = System.currentTimeMillis() lastTimeResume = System.currentTimeMillis()
if (count == 1 && isHotLaunch()) { if (count == 1 && isHotLaunch()) {
val topActivity: Activity? = ActivityManagerUtils.getInstance().topActivity val topActivity: Activity? = ActiSAD.getInstance().topActivity
val flag = if (topActivity == null) { val flag = if (topActivity == null) {
true true
} else { } else {
ConfigHelper.noLoadingActivities.all { !topActivity.localClassName.contains(it, true) } SDAHelper.noLoadingActivities.all { !topActivity.localClassName.contains(it, true) }
} }
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName) LEEEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
if (flag) { if (flag) {
topActivity?.startActivity( topActivity?.startActivity(
Intent( Intent(
topActivity, SplashActivity::class.java topActivity, Spctivity::class.java
).apply { ).apply {
putExtra("isHotLaunch", true) putExtra("isHotLaunch", true)
putExtra("type", -1) putExtra("type", -1)
...@@ -200,7 +200,7 @@ class MyApplication : Application() { ...@@ -200,7 +200,7 @@ class MyApplication : Application() {
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {} override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) { override fun onActivityDestroyed(activity: Activity) {
ActivityManagerUtils.getInstance().removeActivity(activity) ActiSAD.getInstance().removeActivity(activity)
} }
}) })
} }
......
...@@ -6,26 +6,26 @@ import android.os.Bundle ...@@ -6,26 +6,26 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
import com.base.pdfreader2.ui.main.MainActivity import com.base.pdfreader2.ui.main.MainActivity
import com.base.pdfreader2.bean.ConstObject.appLanguageSp import com.base.pdfreader2.bean.ConstObweweject.appLanguageSp
import com.base.pdfreader2.bean.ConstObject.changeLanguageSp import com.base.pdfreader2.bean.ConstObweweject.changeLanguageSp
import com.base.pdfreader2.utils.ActivityLauncher import com.base.pdfreader2.utils.Acauncher
import com.base.pdfreader2.utils.ActivityManagerUtils import com.base.pdfreader2.utils.ActiSAD
import com.base.pdfreader2.utils.LanguageUtils.changeAppLanguage import com.base.pdfreader2.utils.ASDageUtils.changeAppLanguage
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { abstract class ASctivity<T : ViewBinding> : AppCompatActivity() {
private val TAG = "BaseActivity" private val TAG = "BaseActivity"
protected abstract val binding: T protected abstract val binding: T
lateinit var launcher: ActivityLauncher lateinit var launcher: Acauncher
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
launcher = ActivityLauncher(this) launcher = Acauncher(this)
setContentView(binding.root) setContentView(binding.root)
EventUtils.event("page_${javaClass.simpleName}") EvenWQEWQEtUtils.event("page_${javaClass.simpleName}")
initView() initView()
initListener() initListener()
} }
...@@ -36,7 +36,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -36,7 +36,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
fun finishToMain() { fun finishToMain() {
if (this !is MainActivity && !ActivityManagerUtils.getInstance().isActivityInStack(MainActivity::class.java)) { if (this !is MainActivity && !ActiSAD.getInstance().isActivityInStack(MainActivity::class.java)) {
startActivity(Intent(this, MainActivity::class.java)) startActivity(Intent(this, MainActivity::class.java))
} }
finish() finish()
...@@ -45,7 +45,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -45,7 +45,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
var dialog: Dialog? = null var dialog: Dialog? = null
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
ActivityManagerUtils.getInstance().removeActivity(this) ActiSAD.getInstance().removeActivity(this)
if (dialog != null) { if (dialog != null) {
dialog?.dismiss() dialog?.dismiss()
dialog = null dialog = null
...@@ -62,7 +62,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -62,7 +62,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
activityTag: String? = null, activityTag: String? = null,
activityChangeCallback: ((language: String) -> Unit)? = null activityChangeCallback: ((language: String) -> Unit)? = null
): Boolean { ): Boolean {
LogEx.logDebug( LEEEx.logDebug(
TAG, TAG,
"activityTag=$activityTag " + "activityTag=$activityTag " +
"appLanguageSp=$appLanguageSp " + "appLanguageSp=$appLanguageSp " +
...@@ -77,12 +77,12 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -77,12 +77,12 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
// Restart the app // Restart the app
appLanguageSp = changeLanguageSp appLanguageSp = changeLanguageSp
activityChangeCallback?.invoke(changeLanguageSp) activityChangeCallback?.invoke(changeLanguageSp)
LogEx.logDebug(TAG, "activityTag=$activityTag recreate") LEEEx.logDebug(TAG, "activityTag=$activityTag recreate")
isRecreate = true isRecreate = true
//https://stackoverflow.com/questions/63209993/getting-lifecycle-exception-while-recreating-the-activity //https://stackoverflow.com/questions/63209993/getting-lifecycle-exception-while-recreating-the-activity
//MIUI recreate //MIUI recreate
this@BaseActivity.recreate() this@ASctivity.recreate()
} }
return isRecreate return isRecreate
} }
...@@ -97,6 +97,6 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -97,6 +97,6 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
*/ */
fun changeActivityLanguage(languageCountry: String) { fun changeActivityLanguage(languageCountry: String) {
changeAppLanguage(this, languageCountry) changeAppLanguage(this, languageCountry)
this@BaseActivity.recreate() this@ASctivity.recreate()
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import android.view.ViewGroup ...@@ -7,7 +7,7 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
abstract class BaseFragment<T : ViewBinding> : Fragment() { abstract class Baragment<T : ViewBinding> : Fragment() {
protected var isInitialized = false protected var isInitialized = false
protected abstract val binding: T protected abstract val binding: T
......
...@@ -2,14 +2,14 @@ package com.base.pdfreader2.helper ...@@ -2,14 +2,14 @@ package com.base.pdfreader2.helper
import android.os.Build import android.os.Build
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.bean.ConstObject.ifAgreePrivacy import com.base.pdfreader2.bean.ConstObweweject.ifAgreePrivacy
import com.base.pdfreader2.helper.ReportUtils.doPost import com.base.pdfreader2.helper.RepAAortUtils.doPost
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
object EventUtils { object EvenWQEWQEtUtils {
private val TAG = "EventUtils" private val TAG = "EventUtils"
fun event( fun event(
key: String, key: String,
...@@ -23,7 +23,7 @@ object EventUtils { ...@@ -23,7 +23,7 @@ object EventUtils {
} }
if (isSingleEvent) { if (isSingleEvent) {
val stringSet = AppPreferences.getInstance().getStringSet("singleEvent", setOf()) val stringSet = AppPrASDAD.getInstance().getStringSet("singleEvent", setOf())
if (stringSet.contains(key)) { if (stringSet.contains(key)) {
return return
} }
...@@ -32,17 +32,17 @@ object EventUtils { ...@@ -32,17 +32,17 @@ object EventUtils {
Thread { Thread {
var paramJson: String? = "" var paramJson: String? = ""
try { try {
val pkg = ConfigHelper.packageName val pkg = SDAHelper.packageName
val s = JSONObject() val s = JSONObject()
.put("action", key) .put("action", key)
.put("value", value) .put("value", value)
.put("ext", ext) .put("ext", ext)
val s2 = JSONObject() val s2 = JSONObject()
.put("${pkg}_3", AppPreferences.getInstance().getString("Equipment", "")) .put("${pkg}_3", AppPrASDAD.getInstance().getString("Equipment", ""))
.put("${pkg}_4", AppPreferences.getInstance().getString("Manufacturer", "")) .put("${pkg}_4", AppPrASDAD.getInstance().getString("Manufacturer", ""))
.put("${pkg}_5", Build.VERSION.SDK_INT) .put("${pkg}_5", Build.VERSION.SDK_INT)
.put("${pkg}_9", AppPreferences.getInstance().getString("uuid", "")) .put("${pkg}_9", AppPrASDAD.getInstance().getString("uuid", ""))
.put("${pkg}_10", AppPreferences.getInstance().getString("gid", "")) .put("${pkg}_10", AppPrASDAD.getInstance().getString("gid", ""))
.put("${pkg}_13", "android") .put("${pkg}_13", "android")
.put("${pkg}_15", "google") .put("${pkg}_15", "google")
.put("${pkg}_14", BuildConfig.VERSION_CODE) .put("${pkg}_14", BuildConfig.VERSION_CODE)
...@@ -52,13 +52,13 @@ object EventUtils { ...@@ -52,13 +52,13 @@ object EventUtils {
.put("data", s) .put("data", s)
.put("bp", s2) .put("bp", s2)
.toString() .toString()
LogEx.logDebug(TAG, "uuid=${AppPreferences.getInstance().getString("uuid", "")}") LEEEx.logDebug(TAG, "uuid=${AppPrASDAD.getInstance().getString("uuid", "")}")
LogEx.logDebug(TAG, "gid=${AppPreferences.getInstance().getString("gid", "")}") LEEEx.logDebug(TAG, "gid=${AppPrASDAD.getInstance().getString("gid", "")}")
paramJson = AESHelper.encrypt(data) paramJson = Selper.encrypt(data)
} catch (e: JSONException) { } catch (e: JSONException) {
paramJson = "" paramJson = ""
} }
LogEx.logDebug(TAG, "url=$url") LEEEx.logDebug(TAG, "url=$url")
doPost( doPost(
url, url,
HashMap(), HashMap(),
...@@ -68,9 +68,9 @@ object EventUtils { ...@@ -68,9 +68,9 @@ object EventUtils {
} }
private val url by lazy { private val url by lazy {
val pkg = ConfigHelper.packageName val pkg = SDAHelper.packageName
val url = StringBuilder( val url = StringBuilder(
"${ConfigHelper.eventUrl}/${ "${SDAHelper.eventUrl}/${
pkg.filter { it.isLowerCase() }.substring(4, 9) pkg.filter { it.isLowerCase() }.substring(4, 9)
}sp" }sp"
) )
......
...@@ -2,8 +2,8 @@ package com.base.pdfreader2.helper ...@@ -2,8 +2,8 @@ package com.base.pdfreader2.helper
import android.util.Log import android.util.Log
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
...@@ -19,22 +19,22 @@ import java.util.Locale ...@@ -19,22 +19,22 @@ import java.util.Locale
object NewComUtils { object NewComUtils {
private val TAG = "NewComUtils" private val TAG = "NewComUtils"
private const val API_URL = ConfigHelper.apiUrl private const val API_URL = SDAHelper.apiUrl
private const val PACKAGE_NAME_PREFIX = ConfigHelper.packageName private const val PACKAGE_NAME_PREFIX = SDAHelper.packageName
private const val DATA_KEY = "data" private const val DATA_KEY = "data"
private val url: String by lazy { private val url: String by lazy {
val packageName = ConfigHelper.packageName val packageName = SDAHelper.packageName
val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault()) val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault())
val bRefer = android.util.Base64.encodeToString( val bRefer = android.util.Base64.encodeToString(
AppPreferences.getInstance().getString("referrerUrl", "").toByteArray(), AppPrASDAD.getInstance().getString("referrerUrl", "").toByteArray(),
android.util.Base64.DEFAULT android.util.Base64.DEFAULT
) )
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${ "$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "") AppPrASDAD.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}" }&aid=${AppPrASDAD.getInstance().getString("uuid", "")}"
// &mode=3 // &mode=3
} }
...@@ -57,7 +57,7 @@ object NewComUtils { ...@@ -57,7 +57,7 @@ object NewComUtils {
return@launch return@launch
} }
val decryptedData = AESHelper.decrypt(data) val decryptedData = Selper.decrypt(data)
parseConfigBean(decryptedData) parseConfigBean(decryptedData)
withContext(Dispatchers.Main) { withContext(Dispatchers.Main) {
callback() callback()
...@@ -67,14 +67,14 @@ object NewComUtils { ...@@ -67,14 +67,14 @@ object NewComUtils {
private fun doGet(): String? { private fun doGet(): String? {
val urlPath = url val urlPath = url
LogEx.logDebug(TAG, "url=$url") LEEEx.logDebug(TAG, "url=$url")
try { try {
val conn: HttpURLConnection = URL(urlPath).openConnection() as HttpURLConnection val conn: HttpURLConnection = URL(urlPath).openConnection() as HttpURLConnection
conn.setRequestMethod("GET") conn.setRequestMethod("GET")
conn.connectTimeout = 150000 conn.connectTimeout = 150000
if (200 == conn.getResponseCode()) { if (200 == conn.getResponseCode()) {
val json = BufferedReader(InputStreamReader(conn.inputStream)).readLine() val json = BufferedReader(InputStreamReader(conn.inputStream)).readLine()
LogEx.logDebug(TAG, "json=$json") LEEEx.logDebug(TAG, "json=$json")
return json return json
} }
} catch (e: Exception) { } catch (e: Exception) {
...@@ -97,13 +97,13 @@ object NewComUtils { ...@@ -97,13 +97,13 @@ object NewComUtils {
configMap.forEach { t, u -> configMap.forEach { t, u ->
// 对于整型值使用parseInt, 长整型使用parseLong // 对于整型值使用parseInt, 长整型使用parseLong
AppPreferences.getInstance().put(t, u) AppPrASDAD.getInstance().put(t, u)
LogEx.logDebug(TAG, "t=$t u=$u") LEEEx.logDebug(TAG, "t=$t u=$u")
} }
val jsonObject = JSONObject() val jsonObject = JSONObject()
jsonObject.put("ut", AppPreferences.getInstance().getString("ut", "")) jsonObject.put("ut", AppPrASDAD.getInstance().getString("ut", ""))
EventUtils.event("user_type", ext = jsonObject) EvenWQEWQEtUtils.event("user_type", ext = jsonObject)
} }
} }
...@@ -2,7 +2,7 @@ package com.base.pdfreader2.helper; ...@@ -2,7 +2,7 @@ package com.base.pdfreader2.helper;
import android.text.TextUtils; import android.text.TextUtils;
import com.base.pdfreader2.utils.LogEx; import com.base.pdfreader2.utils.LEEEx;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.InputStreamReader; import java.io.InputStreamReader;
...@@ -10,7 +10,7 @@ import java.net.HttpURLConnection; ...@@ -10,7 +10,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.Map; import java.util.Map;
public class ReportUtils { public class RepAAortUtils {
private static String TAG = "ReportUtils"; private static String TAG = "ReportUtils";
public static String doPost(String urlPath, Map<String, String> paramsMap, String json) { public static String doPost(String urlPath, Map<String, String> paramsMap, String json) {
...@@ -42,10 +42,10 @@ public class ReportUtils { ...@@ -42,10 +42,10 @@ public class ReportUtils {
} else { } else {
s = ""; s = "";
} }
LogEx.INSTANCE.logDebug(TAG, "code=200", false); LEEEx.INSTANCE.logDebug(TAG, "code=200", false);
return s; return s;
} else { } else {
LogEx.INSTANCE.logDebug(TAG, "code!=200", false); LEEEx.INSTANCE.logDebug(TAG, "code!=200", false);
} }
} catch (Exception e) { } catch (Exception e) {
......
package com.base.pdfreader2.helper package com.base.pdfreader2.helper
object ConfigHelper { object SDAHelper {
const val privacyPolicy: String = "https://sites.google.com/view/pdfreaderimagetopdf/pdf-reader-image-to-pdf" const val privacyPolicy: String = "https://sites.google.com/view/pdfreaderimagetopdf/pdf-reader-image-to-pdf"
const val termService: String = "https://sites.google.com/view/pdfreaderimagetopdf/pdf-reader-image-to-pdf" const val termService: String = "https://sites.google.com/view/pdfreaderimagetopdf/pdf-reader-image-to-pdf"
......
...@@ -6,7 +6,7 @@ import javax.crypto.Cipher ...@@ -6,7 +6,7 @@ import javax.crypto.Cipher
import javax.crypto.spec.GCMParameterSpec import javax.crypto.spec.GCMParameterSpec
import javax.crypto.spec.SecretKeySpec import javax.crypto.spec.SecretKeySpec
object AESHelper { object Selper {
private const val aesKey = "g78bbcrtr4iaeekw" private const val aesKey = "g78bbcrtr4iaeekw"
......
...@@ -3,8 +3,8 @@ package com.base.pdfreader2.helper ...@@ -3,8 +3,8 @@ package com.base.pdfreader2.helper
import android.text.TextUtils import android.text.TextUtils
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.bean.WeatherBean import com.base.pdfreader2.bean.WeatherBean
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.google.gson.Gson import com.google.gson.Gson
import okhttp3.Call import okhttp3.Call
import okhttp3.Callback import okhttp3.Callback
...@@ -18,7 +18,7 @@ import java.util.Calendar ...@@ -18,7 +18,7 @@ import java.util.Calendar
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
object WeatherUtils { object WDSDArUtils {
private val TAG = "WeatherUtils" private val TAG = "WeatherUtils"
fun getWeatherType(param: Int): String { fun getWeatherType(param: Int): String {
val sunny_day: IntArray = intArrayOf(100, 101, 102, 103, 150, 151, 152, 153) val sunny_day: IntArray = intArrayOf(100, 101, 102, 103, 150, 151, 152, 153)
...@@ -43,14 +43,14 @@ object WeatherUtils { ...@@ -43,14 +43,14 @@ object WeatherUtils {
} }
fun getWeatherJsonStr(): String { fun getWeatherJsonStr(): String {
val data = AppPreferences.getInstance().getString(getTodayStr() + "_weather", "") val data = AppPrASDAD.getInstance().getString(getTodayStr() + "_weather", "")
return data return data
} }
fun getWeatherEntity(): WeatherBean? { fun getWeatherEntity(): WeatherBean? {
val str = getWeatherJsonStr() val str = getWeatherJsonStr()
LogEx.logDebug(TAG, "getWeatherEntity str=$str") LEEEx.logDebug(TAG, "getWeatherEntity str=$str")
if (TextUtils.isEmpty(str)) { if (TextUtils.isEmpty(str)) {
} else { } else {
try { try {
...@@ -66,9 +66,9 @@ object WeatherUtils { ...@@ -66,9 +66,9 @@ object WeatherUtils {
private val url by lazy { private val url by lazy {
val pkg = ConfigHelper.packageName val pkg = SDAHelper.packageName
val url = StringBuilder( val url = StringBuilder(
"${ConfigHelper.apiUrl}/city/${ "${SDAHelper.apiUrl}/city/${
pkg.filter { it.isLowerCase() }.substring(4, 9) pkg.filter { it.isLowerCase() }.substring(4, 9)
}tq" }tq"
) )
...@@ -90,7 +90,7 @@ object WeatherUtils { ...@@ -90,7 +90,7 @@ object WeatherUtils {
.url(url) .url(url)
.get() .get()
.build() .build()
LogEx.logDebug(TAG, "url=$url") LEEEx.logDebug(TAG, "url=$url")
client.newCall(request).enqueue(object : Callback { client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
...@@ -101,9 +101,9 @@ object WeatherUtils { ...@@ -101,9 +101,9 @@ object WeatherUtils {
val i = Regex("\"data\":\"(.*?)\"").find(it) val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") { if (i.toString() != "null") {
i?.groupValues?.get(1).let { data -> i?.groupValues?.get(1).let { data ->
LogEx.logDebug(TAG, "data=$data") LEEEx.logDebug(TAG, "data=$data")
if (!TextUtils.isEmpty(data)) { if (!TextUtils.isEmpty(data)) {
val str = AESHelper.decrypt(data ?: "") val str = Selper.decrypt(data ?: "")
saveWeatherData(str) saveWeatherData(str)
} }
} }
...@@ -140,7 +140,7 @@ object WeatherUtils { ...@@ -140,7 +140,7 @@ object WeatherUtils {
if (i.toString() != "null") { if (i.toString() != "null") {
i?.groupValues?.get(1).let { i?.groupValues?.get(1).let {
if (!TextUtils.isEmpty(it)) { if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!) val str = Selper.decrypt(it!!)
saveWeatherData(str) saveWeatherData(str)
} }
} }
...@@ -149,7 +149,7 @@ object WeatherUtils { ...@@ -149,7 +149,7 @@ object WeatherUtils {
} }
private fun saveWeatherData(string: String) { private fun saveWeatherData(string: String) {
AppPreferences.getInstance().put(getTodayStr() + "_weather", string) AppPrASDAD.getInstance().put(getTodayStr() + "_weather", string)
} }
private fun getTodayStr(): String { private fun getTodayStr(): String {
......
...@@ -3,9 +3,9 @@ package com.base.pdfreader2.helper ...@@ -3,9 +3,9 @@ package com.base.pdfreader2.helper
import com.android.installreferrer.api.InstallReferrerClient import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener import com.android.installreferrer.api.InstallReferrerStateListener
import com.base.pdfreader2.BuildConfig import com.base.pdfreader2.BuildConfig
import com.base.pdfreader2.fcm.TimerManager import com.base.pdfreader2.fcm.Sanager
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import org.json.JSONObject import org.json.JSONObject
/** /**
...@@ -17,7 +17,7 @@ object InstallHelps { ...@@ -17,7 +17,7 @@ object InstallHelps {
fun init() { fun init() {
val referrerClient = InstallReferrerClient.newBuilder(MyApplication.context).build() val referrerClient = InstallReferrerClient.newBuilder(AAication.context).build()
referrerClient.startConnection(object : InstallReferrerStateListener { referrerClient.startConnection(object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(responseCode: Int) { override fun onInstallReferrerSetupFinished(responseCode: Int) {
try { try {
...@@ -30,9 +30,9 @@ object InstallHelps { ...@@ -30,9 +30,9 @@ object InstallHelps {
obj.put("referrerClickTime", response.referrerClickTimestampSeconds) obj.put("referrerClickTime", response.referrerClickTimestampSeconds)
obj.put("appInstallTime", response.installBeginTimestampSeconds) obj.put("appInstallTime", response.installBeginTimestampSeconds)
obj.put("instantExperienceLaunched", installInfo.toString()) obj.put("instantExperienceLaunched", installInfo.toString())
EventUtils.event("install_referrer", ext = obj, isSingleEvent = true) EvenWQEWQEtUtils.event("install_referrer", ext = obj, isSingleEvent = true)
LogEx.logDebug(TAG,"referrerUrl=${response.installReferrer}") LEEEx.logDebug(TAG,"referrerUrl=${response.installReferrer}")
AppPreferences.getInstance().put("referrerUrl", response.installReferrer) AppPrASDAD.getInstance().put("referrerUrl", response.installReferrer)
if (listOf( if (listOf(
"gclid", "gclid",
"facebook", "facebook",
...@@ -41,24 +41,24 @@ object InstallHelps { ...@@ -41,24 +41,24 @@ object InstallHelps {
) { ) {
//自然用户 //自然用户
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
AppPreferences.getInstance().put("install_source", "channel") AppPrASDAD.getInstance().put("install_source", "channel")
} else { } else {
AppPreferences.getInstance().put("install_source", "origin") AppPrASDAD.getInstance().put("install_source", "origin")
} }
} else { } else {
//渠道用户 //渠道用户
AppPreferences.getInstance().put("install_source", "channel") AppPrASDAD.getInstance().put("install_source", "channel")
} }
requestCfg() requestCfg()
} }
else -> { else -> {
EventUtils.event("install_referrer_error") EvenWQEWQEtUtils.event("install_referrer_error")
requestCfg() requestCfg()
} }
} }
} catch (_: Exception) { } catch (_: Exception) {
EventUtils.event("install_referrer_error") EvenWQEWQEtUtils.event("install_referrer_error")
requestCfg() requestCfg()
} }
...@@ -73,14 +73,14 @@ object InstallHelps { ...@@ -73,14 +73,14 @@ object InstallHelps {
private fun requestCfg() { private fun requestCfg() {
NewComUtils.requestCfg { NewComUtils.requestCfg {
val timerStatus: Int = AppPreferences.getInstance().getString("timerS", "1").toIntOrNull() ?: 1 val timerStatus: Int = AppPrASDAD.getInstance().getString("timerS", "1").toIntOrNull() ?: 1
if (timerStatus == 0) { if (timerStatus == 0) {
TimerManager.getInstance().stopTaskTimer() Sanager.getInstance().stopTaskTimer()
} else { } else {
val timerDelay: Int = AppPreferences.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1 val timerDelay: Int = AppPrASDAD.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1
val timerInterval: Int = AppPreferences.getInstance().getString("timerInterval", "1").toIntOrNull() ?: 1 val timerInterval: Int = AppPrASDAD.getInstance().getString("timerInterval", "1").toIntOrNull() ?: 1
if (!TimerManager.getInstance().isTaskTimerActive) { if (!Sanager.getInstance().isTaskTimerActive) {
TimerManager.getInstance().scheduleTask( Sanager.getInstance().scheduleTask(
(timerDelay * 60 * 1000).toLong(), (timerDelay * 60 * 1000).toLong(),
(timerInterval * 60 * 1000).toLong() (timerInterval * 60 * 1000).toLong()
) )
......
...@@ -6,10 +6,10 @@ import android.database.ContentObserver ...@@ -6,10 +6,10 @@ import android.database.ContentObserver
import android.database.Cursor import android.database.Cursor
import android.net.Uri import android.net.Uri
import android.provider.MediaStore import android.provider.MediaStore
import com.base.pdfreader2.bean.ConstObject import com.base.pdfreader2.bean.ConstObweweject
import com.base.pdfreader2.fcm.NotificationUiUtil import com.base.pdfreader2.fcm.NotificationUiUtil
import com.base.pdfreader2.fcm.PopupConstObject import com.base.pdfreader2.fcm.SonsASDtObject
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
/** /**
* Observer MediaContent add * Observer MediaContent add
...@@ -21,12 +21,12 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) { ...@@ -21,12 +21,12 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) {
override fun onChange(selfChange: Boolean, uri: Uri?) { override fun onChange(selfChange: Boolean, uri: Uri?) {
super.onChange(selfChange, uri) super.onChange(selfChange, uri)
LogEx.logDebug(TAG, "uri=${uri.toString()}") LEEEx.logDebug(TAG, "uri=${uri.toString()}")
if (uri.toString().contains("images")) { if (uri.toString().contains("images")) {
NotificationUiUtil.sendNotificationIfCan( NotificationUiUtil.sendNotificationIfCan(
context, context,
ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF, ConstObweweject.NOTIFICATION_ACTION_NEW_IMAGE_PDF,
PopupConstObject.POPUP_WHERE_MEDIA_CHANGE SonsASDtObject.POPUP_WHERE_MEDIA_CHANGE
) )
} }
// uri?.let { queryNewMediaFiles(it) } // uri?.let { queryNewMediaFiles(it) }
...@@ -45,7 +45,7 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) { ...@@ -45,7 +45,7 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) {
val cursor: Cursor? = context.contentResolver.query(uri, projection, null, null, null) val cursor: Cursor? = context.contentResolver.query(uri, projection, null, null, null)
if (cursor != null) { if (cursor != null) {
LogEx.logDebug(TAG, "cursor=$cursor") LEEEx.logDebug(TAG, "cursor=$cursor")
try { try {
if (cursor.count > 0) { if (cursor.count > 0) {
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
...@@ -53,23 +53,23 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) { ...@@ -53,23 +53,23 @@ class MediaContentObserver(val context: Context) : ContentObserver(null) {
val path = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.DATA)) val path = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.DATA))
val mimeType = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.MIME_TYPE)) val mimeType = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.MIME_TYPE))
val size = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.SIZE)) val size = cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.SIZE))
LogEx.logDebug(TAG, "path=$path") LEEEx.logDebug(TAG, "path=$path")
// 处理新文件路径 // 处理新文件路径
} }
} else { } else {
LogEx.logDebug(TAG, "count=0 deleted file uri") LEEEx.logDebug(TAG, "count=0 deleted file uri")
} }
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
LogEx.logDebug(TAG, "Exception=$e") LEEEx.logDebug(TAG, "Exception=$e")
} finally { } finally {
cursor.close() cursor.close()
} }
} else { } else {
LogEx.logDebug(TAG, "cursor=$cursor") LEEEx.logDebug(TAG, "cursor=$cursor")
} }
}.start() }.start()
......
...@@ -17,19 +17,19 @@ import android.widget.RemoteViews ...@@ -17,19 +17,19 @@ import android.widget.RemoteViews
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.graphics.drawable.IconCompat import androidx.core.graphics.drawable.IconCompat
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.ConstObject import com.base.pdfreader2.bean.ConstObweweject
import com.base.pdfreader2.helper.EventUtils import com.base.pdfreader2.helper.EvenWQEWQEtUtils
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.main.MainActivity import com.base.pdfreader2.ui.main.MainActivity
import com.base.pdfreader2.ui.splash.SplashActivity import com.base.pdfreader2.ui.splash.Spctivity
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import kotlin.random.Random import kotlin.random.Random
/** /**
* 常驻通知栏 * 常驻通知栏
*/ */
class StayNotificationService : Service() { class ySADSDficationService : Service() {
private val TAG = "StayNotificationService" private val TAG = "StayNotificationService"
...@@ -40,7 +40,7 @@ class StayNotificationService : Service() { ...@@ -40,7 +40,7 @@ class StayNotificationService : Service() {
fun Context.startStayNotification() { fun Context.startStayNotification() {
if (isRunning) return if (isRunning) return
val intent = Intent(this, StayNotificationService::class.java) val intent = Intent(this, ySADSDficationService::class.java)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
return return
} }
...@@ -53,7 +53,7 @@ class StayNotificationService : Service() { ...@@ -53,7 +53,7 @@ class StayNotificationService : Service() {
} }
fun Context.restartStartStayNotification() { fun Context.restartStartStayNotification() {
val intent = Intent(this, StayNotificationService::class.java) val intent = Intent(this, ySADSDficationService::class.java)
stopService(intent) stopService(intent)
startStayNotification() startStayNotification()
...@@ -68,8 +68,8 @@ class StayNotificationService : Service() { ...@@ -68,8 +68,8 @@ class StayNotificationService : Service() {
val expendView = RemoteViews(context.packageName, R.layout.stay_notification_big) val expendView = RemoteViews(context.packageName, R.layout.stay_notification_big)
val requestCode1 = Random.nextInt(1800) val requestCode1 = Random.nextInt(1800)
val intent1 = Intent(context, SplashActivity::class.java).apply { val intent1 = Intent(context, Spctivity::class.java).apply {
putExtra("actionId", ConstObject.NOTIFICATION_ACTION_LOG) putExtra("actionId", ConstObweweject.NOTIFICATION_ACTION_LOG)
} }
val pendingIntent1 = val pendingIntent1 =
PendingIntent.getActivity( PendingIntent.getActivity(
...@@ -82,8 +82,8 @@ class StayNotificationService : Service() { ...@@ -82,8 +82,8 @@ class StayNotificationService : Service() {
expendView.setOnClickPendingIntent(R.id.fl_1, pendingIntent1) expendView.setOnClickPendingIntent(R.id.fl_1, pendingIntent1)
val requestCode2 = Random.nextInt(1800) val requestCode2 = Random.nextInt(1800)
val intent2 = Intent(context, SplashActivity::class.java).apply { val intent2 = Intent(context, Spctivity::class.java).apply {
putExtra("actionId", ConstObject.NOTIFICATION_ACTION_DOCUMENT) putExtra("actionId", ConstObweweject.NOTIFICATION_ACTION_DOCUMENT)
} }
val pendingIntent2 = val pendingIntent2 =
PendingIntent.getActivity( PendingIntent.getActivity(
...@@ -96,8 +96,8 @@ class StayNotificationService : Service() { ...@@ -96,8 +96,8 @@ class StayNotificationService : Service() {
expendView.setOnClickPendingIntent(R.id.ll_2, pendingIntent2) expendView.setOnClickPendingIntent(R.id.ll_2, pendingIntent2)
val requestCode3 = Random.nextInt(1800) val requestCode3 = Random.nextInt(1800)
val intent3 = Intent(context, SplashActivity::class.java).apply { val intent3 = Intent(context, Spctivity::class.java).apply {
putExtra("actionId", ConstObject.NOTIFICATION_ACTION_BOOKMARK) putExtra("actionId", ConstObweweject.NOTIFICATION_ACTION_BOOKMARK)
} }
val pendingIntent3 = val pendingIntent3 =
PendingIntent.getActivity( PendingIntent.getActivity(
...@@ -111,8 +111,8 @@ class StayNotificationService : Service() { ...@@ -111,8 +111,8 @@ class StayNotificationService : Service() {
val requestCode4 = Random.nextInt(1800) val requestCode4 = Random.nextInt(1800)
val intent4 = Intent(context, SplashActivity::class.java).apply { val intent4 = Intent(context, Spctivity::class.java).apply {
putExtra("actionId", ConstObject.NOTIFICATION_ACTION_NEW_IMAGE_PDF) putExtra("actionId", ConstObweweject.NOTIFICATION_ACTION_NEW_IMAGE_PDF)
} }
val pendingIntent4 = val pendingIntent4 =
PendingIntent.getActivity( PendingIntent.getActivity(
...@@ -127,7 +127,7 @@ class StayNotificationService : Service() { ...@@ -127,7 +127,7 @@ class StayNotificationService : Service() {
val builder = NotificationCompat.Builder(context, channelId) val builder = NotificationCompat.Builder(context, channelId)
val smallIcon = IconCompat.createFromIcon( val smallIcon = IconCompat.createFromIcon(
context, Icon.createWithResource( context, Icon.createWithResource(
MyApplication.context, R.mipmap.logo AAication.context, R.mipmap.logo
) )
) )
...@@ -164,13 +164,13 @@ class StayNotificationService : Service() { ...@@ -164,13 +164,13 @@ class StayNotificationService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
LogEx.logDebug(TAG, "onStartCommand intent=$intent") LEEEx.logDebug(TAG, "onStartCommand intent=$intent")
if (intent == null) { if (intent == null) {
EventUtils.event("onStartCommand", "Foreground System auto launch intent=null isRunning=$isRunning") EvenWQEWQEtUtils.event("onStartCommand", "Foreground System auto launch intent=null isRunning=$isRunning")
return START_NOT_STICKY return START_NOT_STICKY
} }
if (!isRunning) { if (!isRunning) {
LogEx.logDebug(TAG, "onStartCommand startForeground") LEEEx.logDebug(TAG, "onStartCommand startForeground")
startForeground() startForeground()
...@@ -184,7 +184,7 @@ class StayNotificationService : Service() { ...@@ -184,7 +184,7 @@ class StayNotificationService : Service() {
} }
private fun startForeground() { private fun startForeground() {
val notification = createPermanentNotification(MyApplication.context) val notification = createPermanentNotification(AAication.context)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(100, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC) startForeground(100, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
} else { } else {
...@@ -208,7 +208,7 @@ class StayNotificationService : Service() { ...@@ -208,7 +208,7 @@ class StayNotificationService : Service() {
private fun observerMediaContentObserver() { private fun observerMediaContentObserver() {
if (mediaContentObserver == null) { if (mediaContentObserver == null) {
LogEx.logDebug(TAG, "observerMediaContentObserver") LEEEx.logDebug(TAG, "observerMediaContentObserver")
mediaContentObserver = MediaContentObserver(this) mediaContentObserver = MediaContentObserver(this)
mediaContentObserver?.let { mediaContentObserver?.let {
this.contentResolver.registerContentObserver( this.contentResolver.registerContentObserver(
......
...@@ -7,25 +7,25 @@ import android.view.View ...@@ -7,25 +7,25 @@ import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import androidx.core.animation.doOnEnd import androidx.core.animation.doOnEnd
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.databinding.ActivityAppProcessLoadingBinding import com.base.pdfreader2.databinding.ActivityAaaBbbCcBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.utils.BarUtils import com.base.pdfreader2.utils.BarASDSAD
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding>() { class AppPSALoadingActivity : ASctivity<ActivityAaaBbbCcBinding>() {
override val binding: ActivityAppProcessLoadingBinding by lazy { override val binding: ActivityAaaBbbCcBinding by lazy {
ActivityAppProcessLoadingBinding.inflate(layoutInflater) ActivityAaaBbbCcBinding.inflate(layoutInflater)
} }
override fun initView() { override fun initView() {
BarUtils.setStatusBarLightMode(this, true) BarASDSAD.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarASDSAD.setStatusBarColor(this, Color.TRANSPARENT)
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) // binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
overridePendingTransition(0, 0) overridePendingTransition(0, 0)
...@@ -40,7 +40,7 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding> ...@@ -40,7 +40,7 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding>
startColorAnimation(binding.view, colors, 0, 800) startColorAnimation(binding.view, colors, 0, 800)
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
AppProcessActivity.initData(this@AppProcessLoadingActivity) SDSDAssActivity.initData(this@AppPSALoadingActivity)
} }
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
var i = 1 var i = 1
...@@ -51,8 +51,8 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding> ...@@ -51,8 +51,8 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding>
} }
} }
jumpAction = { jumpAction = {
AdmobInterstitialUtils.showInterstitialAd(this) { AdmoalUtils.showInterstitialAd(this) {
startActivity(Intent(this, AppProcessActivity::class.java)) startActivity(Intent(this, SDSDAssActivity::class.java))
finish() finish()
} }
} }
...@@ -62,7 +62,7 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding> ...@@ -62,7 +62,7 @@ class AppProcessLoadingActivity : BaseActivity<ActivityAppProcessLoadingBinding>
super.initListener() super.initListener()
binding.flFanhui.setOnClickListener { binding.flFanhui.setOnClickListener {
jumpAction = null jumpAction = null
AdmobInterstitialUtils.showInterstitialAd(this) { AdmoalUtils.showInterstitialAd(this) {
finishToMain() finishToMain()
} }
} }
......
...@@ -5,16 +5,16 @@ import android.view.View ...@@ -5,16 +5,16 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.AppBean import com.base.pdfreader2.bean.AppBsdsadean
import com.base.pdfreader2.databinding.ItemAppProcessBinding import com.base.pdfreader2.databinding.ItemAppProcessBinding
import com.base.pdfreader2.utils.XmlEx.inflate import com.base.pdfreader2.utils.dasdmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter import com.chad.library.adapter4.BaseQuickAdapter
class AppBeanAdapter : BaseQuickAdapter<AppBean, AppBeanAdapter.AppHolder>() { class SDApSDASanAdapter : BaseQuickAdapter<AppBsdsadean, SDApSDASanAdapter.AppHolder>() {
inner class AppHolder(view: View) : RecyclerView.ViewHolder(view) inner class AppHolder(view: View) : RecyclerView.ViewHolder(view)
var stopAction: ((pkg: String) -> Unit)? = null var stopAction: ((pkg: String) -> Unit)? = null
override fun onBindViewHolder(holder: AppHolder, position: Int, item: AppBean?) { override fun onBindViewHolder(holder: AppHolder, position: Int, item: AppBsdsadean?) {
if (item == null) return if (item == null) return
val binding = ItemAppProcessBinding.bind(holder.itemView) val binding = ItemAppProcessBinding.bind(holder.itemView)
......
...@@ -13,36 +13,36 @@ import android.text.Spanned ...@@ -13,36 +13,36 @@ import android.text.Spanned
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.view.View import android.view.View
import androidx.activity.addCallback import androidx.activity.addCallback
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.AppBean import com.base.pdfreader2.bean.AppBsdsadean
import com.base.pdfreader2.bean.ConstObject import com.base.pdfreader2.bean.ConstObweweject
import com.base.pdfreader2.databinding.ActivityAppProcessBinding import com.base.pdfreader2.databinding.AdssadvityAppProcedsdss2Binding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.ui.result.ResultActivity import com.base.pdfreader2.ui.result.ResuASAltActivity
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.BarUtils import com.base.pdfreader2.utils.BarASDSAD
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.RamUtils.ramPair import com.base.pdfreader2.utils.RamUasdtils.ramPair
import kotlin.random.Random import kotlin.random.Random
class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { class SDSDAssActivity : ASctivity<AdssadvityAppProcedsdss2Binding>() {
private val TAG = "AppProcessActivity" private val TAG = "AppProcessActivity"
override val binding: ActivityAppProcessBinding by lazy { override val binding: AdssadvityAppProcedsdss2Binding by lazy {
ActivityAppProcessBinding.inflate(layoutInflater) AdssadvityAppProcedsdss2Binding.inflate(layoutInflater)
} }
private lateinit var adapter: AppBeanAdapter private lateinit var adapter: SDApSDASanAdapter
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun initView() { override fun initView() {
BarUtils.setStatusBarLightMode(this, true) BarASDSAD.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarASDSAD.setStatusBarColor(this, Color.TRANSPARENT)
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) // binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
adapter = AppBeanAdapter() adapter = SDApSDASanAdapter()
adapter.stopAction = { pkg -> adapter.stopAction = { pkg ->
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", pkg, null) val uri = Uri.fromParts("package", pkg, null)
...@@ -57,7 +57,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { ...@@ -57,7 +57,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
binding.tvPercent.text = percent.toString() binding.tvPercent.text = percent.toString()
binding.tvRamRate.text = ramPair.first.toFormatSize() + " / " + ramPair.second.toFormatSize() binding.tvRamRate.text = ramPair.first.toFormatSize() + " / " + ramPair.second.toFormatSize()
AppPreferences.getInstance().put("last_process_use_time", System.currentTimeMillis()) AppPrASDAD.getInstance().put("last_process_use_time", System.currentTimeMillis())
initDataUI() initDataUI()
} }
...@@ -78,8 +78,8 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { ...@@ -78,8 +78,8 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
override fun initListener() { override fun initListener() {
super.initListener() super.initListener()
onBackPressedDispatcher.addCallback { onBackPressedDispatcher.addCallback {
if (AdmobHelper.isBackShowAd()) { if (Aer.isBackShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this@AppProcessActivity) { AdmoalUtils.showInterstitialAd(this@SDSDAssActivity) {
finishToMain() finishToMain()
} }
} else { } else {
...@@ -91,16 +91,16 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { ...@@ -91,16 +91,16 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
} }
binding.tvBtn.setOnClickListener { binding.tvBtn.setOnClickListener {
if (AdmobHelper.isBackShowAd()) { if (Aer.isBackShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this) { AdmoalUtils.showInterstitialAd(this) {
startActivity(Intent(this, ResultActivity::class.java).apply { startActivity(Intent(this, ResuASAltActivity::class.java).apply {
putExtra("from", ConstObject.FUNCTION_APP_PROCESS) putExtra("from", ConstObweweject.FUNCTION_APP_PROCESS)
}) })
finish() finish()
} }
} else { } else {
startActivity(Intent(this, ResultActivity::class.java).apply { startActivity(Intent(this, ResuASAltActivity::class.java).apply {
putExtra("from", ConstObject.FUNCTION_APP_PROCESS) putExtra("from", ConstObweweject.FUNCTION_APP_PROCESS)
}) })
finish() finish()
} }
...@@ -125,7 +125,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { ...@@ -125,7 +125,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
private var totalCount = 0 private var totalCount = 0
private var backAppCount = 0 private var backAppCount = 0
private val appList = arrayListOf<AppBean>() private val appList = arrayListOf<AppBsdsadean>()
@SuppressLint("QueryPermissionsNeeded") @SuppressLint("QueryPermissionsNeeded")
fun initData( fun initData(
...@@ -141,7 +141,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() { ...@@ -141,7 +141,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
totalCount++ totalCount++
if (index % 2 == 0 && Random.nextBoolean()) { if (index % 2 == 0 && Random.nextBoolean()) {
val appBean = AppBean( val appBean = AppBsdsadean(
packageInfo.applicationInfo.loadIcon(pm), packageInfo.applicationInfo.loadIcon(pm),
packageInfo.applicationInfo.loadLabel(pm).toString(), packageInfo.applicationInfo.loadLabel(pm).toString(),
packageInfo.applicationInfo.packageName packageInfo.applicationInfo.packageName
......
...@@ -7,12 +7,12 @@ import com.base.pdfreader2.R ...@@ -7,12 +7,12 @@ import com.base.pdfreader2.R
import com.base.pdfreader2.bean.ParentBean import com.base.pdfreader2.bean.ParentBean
import com.base.pdfreader2.databinding.ItemJunkChildBinding import com.base.pdfreader2.databinding.ItemJunkChildBinding
import com.base.pdfreader2.databinding.ItemJunkParentBinding import com.base.pdfreader2.databinding.ItemJunkParentBinding
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.XmlEx.inflate import com.base.pdfreader2.utils.dasdmlEx.inflate
import pokercc.android.expandablerecyclerview.ExpandableAdapter import pokercc.android.expandablerecyclerview.ExpandableAdapter
import java.io.File import java.io.File
class JunkExpandAdapter(private val selectAction: (size: Long) -> Unit) : ExpandableAdapter<ExpandableAdapter.ViewHolder>() { class AAnSAandAdapter(private val selectAction: (size: Long) -> Unit) : ExpandableAdapter<ExpandableAdapter.ViewHolder>() {
private val beanList = arrayListOf<ParentBean>() private val beanList = arrayListOf<ParentBean>()
override fun getChildCount(groupPosition: Int): Int { override fun getChildCount(groupPosition: Int): Int {
......
...@@ -9,13 +9,13 @@ import android.widget.Toast ...@@ -9,13 +9,13 @@ import android.widget.Toast
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.core.animation.doOnEnd import androidx.core.animation.doOnEnd
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.ConstObject.FUNCTION_SCAM_JUNK import com.base.pdfreader2.bean.ConstObweweject.FUNCTION_SCAM_JUNK
import com.base.pdfreader2.databinding.ActivityLayoutCleanupingBinding import com.base.pdfreader2.databinding.ActivityLayoutCleanupingBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.ui.result.ResultActivity import com.base.pdfreader2.ui.result.ResuASAltActivity
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.BarUtils import com.base.pdfreader2.utils.BarASDSAD
import com.base.pdfreader2.utils.updateMediaStore import com.base.pdfreader2.utils.updateMediaStore
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope import kotlinx.coroutines.MainScope
...@@ -26,7 +26,7 @@ import kotlin.random.Random ...@@ -26,7 +26,7 @@ import kotlin.random.Random
/** /**
* 实际清理页面 * 实际清理页面
*/ */
class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { class CleSADADActivity : ASctivity<ActivityLayoutCleanupingBinding>() {
override val binding: ActivityLayoutCleanupingBinding by lazy { override val binding: ActivityLayoutCleanupingBinding by lazy {
ActivityLayoutCleanupingBinding.inflate(layoutInflater) ActivityLayoutCleanupingBinding.inflate(layoutInflater)
...@@ -39,8 +39,8 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -39,8 +39,8 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
} }
override fun initView() { override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarASDSAD.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarASDSAD.getStatusBarHeight())
MainScope().launch(Dispatchers.IO) { MainScope().launch(Dispatchers.IO) {
try { try {
...@@ -60,7 +60,7 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -60,7 +60,7 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
override fun initListener() { override fun initListener() {
onBackPressedDispatcher.addCallback { onBackPressedDispatcher.addCallback {
Toast.makeText(this@CleaningActivity, "wait a moment", Toast.LENGTH_SHORT).show() Toast.makeText(this@CleSADADActivity, "wait a moment", Toast.LENGTH_SHORT).show()
} }
} }
...@@ -82,11 +82,11 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -82,11 +82,11 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
binding.idTvJd.text = "${it.animatedValue as Int}" binding.idTvJd.text = "${it.animatedValue as Int}"
} }
doOnEnd { doOnEnd {
val isCleanEndAdSp = AppPreferences.getInstance().getString("isCleanEndAdSp", "1").toInt() val isCleanEndAdSp = AppPrASDAD.getInstance().getString("isCleanEndAdSp", "1").toInt()
if (isCleanEndAdSp == 1) { if (isCleanEndAdSp == 1) {
AdmobInterstitialUtils.showInterstitialAd(this@CleaningActivity) { AdmoalUtils.showInterstitialAd(this@CleSADADActivity) {
startActivity( startActivity(
Intent(this@CleaningActivity, ResultActivity::class.java).apply { Intent(this@CleSADADActivity, ResuASAltActivity::class.java).apply {
putExtra("from", FUNCTION_SCAM_JUNK) putExtra("from", FUNCTION_SCAM_JUNK)
putExtra("clean_size", intentSize) putExtra("clean_size", intentSize)
} }
...@@ -96,7 +96,7 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() { ...@@ -96,7 +96,7 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
} }
} else { } else {
startActivity( startActivity(
Intent(this@CleaningActivity, ResultActivity::class.java).apply { Intent(this@CleSADADActivity, ResuASAltActivity::class.java).apply {
putExtra("from", FUNCTION_SCAM_JUNK) putExtra("from", FUNCTION_SCAM_JUNK)
putExtra("clean_size", intentSize) putExtra("clean_size", intentSize)
} }
......
...@@ -10,9 +10,9 @@ import androidx.recyclerview.widget.RecyclerView ...@@ -10,9 +10,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.ParentBean import com.base.pdfreader2.bean.ParentBean
import com.base.pdfreader2.databinding.ItemJunkParentScanBinding import com.base.pdfreader2.databinding.ItemJunkParentScanBinding
import com.base.pdfreader2.utils.XmlEx.inflate import com.base.pdfreader2.utils.dasdmlEx.inflate
class JunkScanAdapter : RecyclerView.Adapter<JunkScanAdapter.ParentViewHolder>() { class JunkSSADcanAdapter : RecyclerView.Adapter<JunkSSADcanAdapter.ParentViewHolder>() {
private val beanList = arrayListOf<ParentBean>() private val beanList = arrayListOf<ParentBean>()
......
...@@ -12,20 +12,20 @@ import androidx.activity.addCallback ...@@ -12,20 +12,20 @@ import androidx.activity.addCallback
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.ChildBean import com.base.pdfreader2.bean.ChildBean
import com.base.pdfreader2.bean.ConstObject.FUNCTION_SCAM_JUNK import com.base.pdfreader2.bean.ConstObweweject.FUNCTION_SCAM_JUNK
import com.base.pdfreader2.bean.ParentBean import com.base.pdfreader2.bean.ParentBean
import com.base.pdfreader2.databinding.ActivityScanJunkBinding import com.base.pdfreader2.databinding.ActivityScanJunkBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.result.ResultActivity import com.base.pdfreader2.ui.result.ResuASAltActivity
import com.base.pdfreader2.utils.AppPreferences import com.base.pdfreader2.utils.AppPrASDAD
import com.base.pdfreader2.utils.BarUtils import com.base.pdfreader2.utils.BarASDSAD
import com.base.pdfreader2.utils.FileHelp.getFileFolder import com.base.pdfreader2.utils.FileHelFFSp.getFileFolder
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.PermissionUtils.checkStorePermission import com.base.pdfreader2.utils.PermiasnUtils.checkStorePermission
import com.base.pdfreader2.utils.queryFiles import com.base.pdfreader2.utils.queryFiles
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.BufferOverflow
...@@ -38,10 +38,10 @@ import java.io.File ...@@ -38,10 +38,10 @@ import java.io.File
import kotlin.random.Random import kotlin.random.Random
class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { class ScanJunkActivity : ASctivity<ActivityScanJunkBinding>() {
private lateinit var junkScanAdapter: JunkScanAdapter private lateinit var junkScanAdapter: JunkSSADcanAdapter
private lateinit var junkExpandAdapter: JunkExpandAdapter private lateinit var junkExpandAdapter: AAnSAandAdapter
override val binding: ActivityScanJunkBinding by lazy { override val binding: ActivityScanJunkBinding by lazy {
ActivityScanJunkBinding.inflate(layoutInflater) ActivityScanJunkBinding.inflate(layoutInflater)
...@@ -57,15 +57,15 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { ...@@ -57,15 +57,15 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun initView() { override fun initView() {
BarUtils.setStatusBarLightMode(this, true) BarASDSAD.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarASDSAD.setStatusBarColor(this, Color.TRANSPARENT)
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) // binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
junkScanAdapter = JunkScanAdapter() junkScanAdapter = JunkSSADcanAdapter()
binding.rv.adapter = junkScanAdapter binding.rv.adapter = junkScanAdapter
junkExpandAdapter = JunkExpandAdapter { size -> junkExpandAdapter = AAnSAandAdapter { size ->
cleanSize = size cleanSize = size
if (size > 0) { if (size > 0) {
binding.tvBtn.text = "Clean up ${size.toFormatSize()}" binding.tvBtn.text = "Clean up ${size.toFormatSize()}"
...@@ -81,11 +81,11 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { ...@@ -81,11 +81,11 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() {
} }
} }
//record last use junk clean function time //record last use junk clean function time
AppPreferences.getInstance().put("last_use_junk_clean", System.currentTimeMillis()) AppPrASDAD.getInstance().put("last_use_junk_clean", System.currentTimeMillis())
beginScan() beginScan()
binding.root.postDelayed({ binding.root.postDelayed({
AdmobInterstitialUtils.showInterstitialAd(this) AdmoalUtils.showInterstitialAd(this)
}, 2000) }, 2000)
} }
...@@ -93,8 +93,8 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { ...@@ -93,8 +93,8 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() {
super.initListener() super.initListener()
onBackPressedDispatcher.addCallback { onBackPressedDispatcher.addCallback {
if (AdmobHelper.isBackShowAd()) { if (Aer.isBackShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this@ScanJunkActivity, false) { AdmoalUtils.showInterstitialAd(this@ScanJunkActivity, false) {
finishToMain() finishToMain()
} }
} else { } else {
...@@ -108,23 +108,23 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { ...@@ -108,23 +108,23 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() {
binding.tvBtn.setOnClickListener { binding.tvBtn.setOnClickListener {
if (binding.tvBtn.text == "Got it") { if (binding.tvBtn.text == "Got it") {
if (AdmobHelper.isBackShowAd()) { if (Aer.isBackShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this) { AdmoalUtils.showInterstitialAd(this) {
startActivity(Intent(this, ResultActivity::class.java).apply { startActivity(Intent(this, ResuASAltActivity::class.java).apply {
putExtra("from", FUNCTION_SCAM_JUNK) putExtra("from", FUNCTION_SCAM_JUNK)
}) })
finish() finish()
} }
} else { } else {
startActivity(Intent(this, ResultActivity::class.java).apply { startActivity(Intent(this, ResuASAltActivity::class.java).apply {
putExtra("from", FUNCTION_SCAM_JUNK) putExtra("from", FUNCTION_SCAM_JUNK)
}) })
finish() finish()
} }
} else { } else {
startActivity(Intent(this, CleaningActivity::class.java).apply { startActivity(Intent(this, CleSADADActivity::class.java).apply {
val list = junkExpandAdapter.getChoosePath() val list = junkExpandAdapter.getChoosePath()
putExtra("list", list.toTypedArray()) putExtra("list", list.toTypedArray())
putExtra("size", cleanSize) putExtra("size", cleanSize)
...@@ -239,7 +239,7 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() { ...@@ -239,7 +239,7 @@ class ScanJunkActivity : BaseActivity<ActivityScanJunkBinding>() {
} }
companion object { companion object {
fun fastGetJunkSize(context: Context = MyApplication.context): Long { fun fastGetJunkSize(context: Context = AAication.context): Long {
if (!context.checkStorePermission()) { if (!context.checkStorePermission()) {
return 0 return 0
} }
......
...@@ -12,17 +12,17 @@ import androidx.activity.addCallback ...@@ -12,17 +12,17 @@ import androidx.activity.addCallback
import androidx.core.widget.addTextChangedListener import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.ads.admob.AdmobNativeUtils import com.base.pdfreader2.ads.admob.AveUtils
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.databinding.ActivityExcelBinding import com.base.pdfreader2.databinding.AsvcvdsDadAdsaBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.ui.view.DocumentDialog.showDocumentMore import com.base.pdfreader2.ui.view.DAentDialog.showDocumentMore
import com.base.pdfreader2.utils.KeyBoardUtils.hideKeyboard import com.base.pdfreader2.utils.KeyBoardUSDSADtils.hideKeyboard
import com.base.pdfreader2.utils.KeyBoardUtils.showKeyBoard import com.base.pdfreader2.utils.KeyBoardUSDSADtils.showKeyBoard
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.base.pdfreader2.utils.SpStringUtils import com.base.pdfreader2.utils.sdadUtils
import com.cherry.lib.doc.bean.DocEngine import com.cherry.lib.doc.bean.DocEngine
import com.cherry.lib.doc.office.constant.EventConstant import com.cherry.lib.doc.office.constant.EventConstant
import com.cherry.lib.doc.office.ss.control.SSControl import com.cherry.lib.doc.office.ss.control.SSControl
...@@ -33,16 +33,16 @@ import kotlinx.coroutines.delay ...@@ -33,16 +33,16 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
class ExcelActivity : BaseActivity<ActivityExcelBinding>() { class ExcelDSDActivity : ASctivity<AsvcvdsDadAdsaBinding>() {
private val TAG = "ExcelActivity" private val TAG = "ExcelActivity"
override val binding: ActivityExcelBinding by lazy { override val binding: AsvcvdsDadAdsaBinding by lazy {
ActivityExcelBinding.inflate(layoutInflater) AsvcvdsDadAdsaBinding.inflate(layoutInflater)
} }
companion object { companion object {
var excelDocumentBean: DocumentBean = DocumentBean() var excelDocumentBean: DocumeewewntBean = DocumeewewntBean()
fun launchDocViewer( fun launchDocViewer(
activity: Activity, activity: Activity,
docSourceType: Int, docSourceType: Int,
...@@ -50,7 +50,7 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -50,7 +50,7 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
fileType: Int? = null, fileType: Int? = null,
engine: Int? = null engine: Int? = null
) { ) {
val intent = Intent(activity, ExcelActivity::class.java) val intent = Intent(activity, ExcelDSDActivity::class.java)
intent.putExtra(Constant.INTENT_SOURCE_KEY, docSourceType) intent.putExtra(Constant.INTENT_SOURCE_KEY, docSourceType)
intent.putExtra(Constant.INTENT_DATA_KEY, pathOrUri) intent.putExtra(Constant.INTENT_DATA_KEY, pathOrUri)
intent.putExtra(Constant.INTENT_TYPE_KEY, fileType) intent.putExtra(Constant.INTENT_TYPE_KEY, fileType)
...@@ -65,13 +65,13 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -65,13 +65,13 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
if (file.exists()) { if (file.exists()) {
binding.tvName.text = file.name binding.tvName.text = file.name
} }
AdmobNativeUtils.showNativeAd(this, binding.flAd, R.layout.layout_admob_document_in) AveUtils.showNativeAd(this, binding.flAd, R.layout.layout_admob_document_in)
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
binding.mDocView.onDestroy() binding.mDocView.onDestroy()
AdmobNativeUtils.onDestroy() AveUtils.onDestroy()
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
...@@ -83,10 +83,10 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -83,10 +83,10 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
cancelSearchUI() cancelSearchUI()
return@addCallback return@addCallback
} }
if (AdmobHelper.isShowCloseDocumentInter()) { if (Aer.isShowCloseDocumentInter()) {
AdmobInterstitialUtils.showInterstitialAd(this@ExcelActivity) { AdmoalUtils.showInterstitialAd(this@ExcelDSDActivity) {
if (it) { if (it) {
AdmobHelper.lastCloseDocumentShowAd = System.currentTimeMillis() Aer.lastCloseDocumentShowAd = System.currentTimeMillis()
} }
binding.root.postDelayed({ finishToMain() }, 500) binding.root.postDelayed({ finishToMain() }, 500)
} }
...@@ -104,15 +104,15 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -104,15 +104,15 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
showDocumentMore(excelDocumentBean) showDocumentMore(excelDocumentBean)
} }
binding.mDocView.singleTapAction = { binding.mDocView.singleTapAction = {
LogEx.logDebug(TAG, "actionDownCallBack") LEEEx.logDebug(TAG, "actionDownCallBack")
if (isShowTopLayout) { if (isShowTopLayout) {
LogEx.logDebug(TAG, "hide") LEEEx.logDebug(TAG, "hide")
hideTopLayout() hideTopLayout()
hideBottomLayout() hideBottomLayout()
} else { } else {
showTopLayout() showTopLayout()
showBottomLayout() showBottomLayout()
LogEx.logDebug(TAG, "show") LEEEx.logDebug(TAG, "show")
} }
} }
binding.ivSearch.setOnClickListener { binding.ivSearch.setOnClickListener {
...@@ -282,11 +282,11 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() { ...@@ -282,11 +282,11 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
engine = intent?.getIntExtra(Constant.INTENT_ENGINE_KEY, DocEngine.INTERNAL.value) ?: DocEngine.INTERNAL.value engine = intent?.getIntExtra(Constant.INTENT_ENGINE_KEY, DocEngine.INTERNAL.value) ?: DocEngine.INTERNAL.value
binding.mDocView.openDoc(this, pathOrUri, docSourceType, fileType, false) binding.mDocView.openDoc(this, pathOrUri, docSourceType, fileType, false)
LogEx.logDebug(TAG, "initData-pathOrUri = $pathOrUri") LEEEx.logDebug(TAG, "initData-pathOrUri = $pathOrUri")
LogEx.logDebug(TAG, "initData-docSourceType = $docSourceType") LEEEx.logDebug(TAG, "initData-docSourceType = $docSourceType")
LogEx.logDebug(TAG, "initData-fileType = $fileType") LEEEx.logDebug(TAG, "initData-fileType = $fileType")
SpStringUtils.addSpString(SpStringUtils.LAST_VIEW_KEY, (pathOrUri ?: "") + "_/_" + System.currentTimeMillis()) sdadUtils.addSpString(sdadUtils.LAST_VIEW_KEY, (pathOrUri ?: "") + "_/_" + System.currentTimeMillis())
} }
......
...@@ -10,10 +10,10 @@ import androidx.activity.result.IntentSenderRequest ...@@ -10,10 +10,10 @@ import androidx.activity.result.IntentSenderRequest
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.LifecycleCoroutineScope import androidx.lifecycle.LifecycleCoroutineScope
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.AdmobHelper.lastScanShowAd import com.base.pdfreader2.ads.Aer.lastScanShowAd
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.utils.updateMediaStore import com.base.pdfreader2.utils.updateMediaStore
import com.google.mlkit.vision.documentscanner.GmsDocumentScannerOptions import com.google.mlkit.vision.documentscanner.GmsDocumentScannerOptions
import com.google.mlkit.vision.documentscanner.GmsDocumentScanning import com.google.mlkit.vision.documentscanner.GmsDocumentScanning
...@@ -23,9 +23,9 @@ import kotlinx.coroutines.MainScope ...@@ -23,9 +23,9 @@ import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
class MainPresenter( class ASDPresenter(
val context: Context, val context: Context,
val mainView: MainView, val mainView: ASDView,
val lifecycleScope: LifecycleCoroutineScope val lifecycleScope: LifecycleCoroutineScope
) { ) {
...@@ -68,8 +68,8 @@ class MainPresenter( ...@@ -68,8 +68,8 @@ class MainPresenter(
fun starAdGmsScan(activity: Activity) { fun starAdGmsScan(activity: Activity) {
if (AdmobHelper.isShowScanInter() && AdmobHelper.canCommonShowAd()) { if (Aer.isShowScanInter() && Aer.canCommonShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(activity) { AdmoalUtils.showInterstitialAd(activity) {
if (it) { if (it) {
lastScanShowAd = System.currentTimeMillis() lastScanShowAd = System.currentTimeMillis()
} }
...@@ -107,7 +107,7 @@ class MainPresenter( ...@@ -107,7 +107,7 @@ class MainPresenter(
} }
fun deleteList(list: List<DocumentBean>) { fun deleteList(list: List<DocumeewewntBean>) {
MainScope().launch(Dispatchers.IO) { MainScope().launch(Dispatchers.IO) {
list.forEach { list.forEach {
runCatching { runCatching {
......
...@@ -2,6 +2,6 @@ package com.base.pdfreader2.ui.main ...@@ -2,6 +2,6 @@ package com.base.pdfreader2.ui.main
import android.net.Uri import android.net.Uri
interface MainView { interface ASDView {
fun handleActivityGmsScanResult(imageUri: Uri?, pdfUri: Uri?) fun handleActivityGmsScanResult(imageUri: Uri?, pdfUri: Uri?)
} }
\ No newline at end of file
...@@ -6,38 +6,37 @@ import android.view.View ...@@ -6,38 +6,37 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.ads.admob.AdmobNativeUtils import com.base.pdfreader2.ads.admob.AveUtils
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.bean.DocumentBean.Companion.TYPE_EXCEL import com.base.pdfreader2.bean.DocumeewewntBean.Companion.TYPE_EXCEL
import com.base.pdfreader2.bean.DocumentBean.Companion.TYPE_PDF import com.base.pdfreader2.bean.DocumeewewntBean.Companion.TYPE_PDF
import com.base.pdfreader2.bean.DocumentBean.Companion.TYPE_PPT import com.base.pdfreader2.bean.DocumeewewntBean.Companion.TYPE_PPT
import com.base.pdfreader2.bean.DocumentBean.Companion.TYPE_WORD import com.base.pdfreader2.bean.DocumeewewntBean.Companion.TYPE_WORD
import com.base.pdfreader2.databinding.ItemAdBinding import com.base.pdfreader2.databinding.ItemAdBinding
import com.base.pdfreader2.databinding.ItemDocumentBinding import com.base.pdfreader2.databinding.ItemDocumentBinding
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.KotlinExt.toFormatTime import com.base.pdfreader2.utils.SSDtlinExt.toFormatTime
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.dasdmlEx.inflate
import com.base.pdfreader2.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter import com.chad.library.adapter4.BaseQuickAdapter
import java.io.File import java.io.File
class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentViewHolder>() { class ASDumentAdapter() : BaseQuickAdapter<DocumeewewntBean, ASDumentAdapter.DocumentViewHolder>() {
private val TAG = "DocumentAdapter" private val TAG = "DocumentAdapter"
inner class DocumentViewHolder(view: View) : ViewHolder(view) inner class DocumentViewHolder(view: View) : ViewHolder(view)
var itemClick: ((item: DocumentBean) -> Unit)? = null var itemClick: ((item: DocumeewewntBean) -> Unit)? = null
var bookmarkAction: ((addRemove: Boolean, path: String) -> Unit)? = null var bookmarkAction: ((addRemove: Boolean, path: String) -> Unit)? = null
var moreAction: ((item: DocumentBean) -> Unit)? = null var moreAction: ((item: DocumeewewntBean) -> Unit)? = null
var selectAction: ((size: Int) -> Unit)? = null var selectAction: ((size: Int) -> Unit)? = null
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: DocumentViewHolder, position: Int, item: DocumentBean?) { override fun onBindViewHolder(holder: DocumentViewHolder, position: Int, item: DocumeewewntBean?) {
if (item == null) return if (item == null) return
if (item.isAd) { if (item.isAd) {
val binding = ItemAdBinding.bind(holder.itemView) val binding = ItemAdBinding.bind(holder.itemView)
AdmobNativeUtils.showNativeAd(null, binding.flAd, R.layout.layout_admob_document) AveUtils.showNativeAd(null, binding.flAd, R.layout.layout_admob_document)
} else { } else {
val binding = ItemDocumentBinding.bind(holder.itemView) val binding = ItemDocumentBinding.bind(holder.itemView)
changeIcon(item, binding) changeIcon(item, binding)
...@@ -124,7 +123,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen ...@@ -124,7 +123,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen
} }
fun changeIcon(item: DocumentBean, binding: ItemDocumentBinding) { fun changeIcon(item: DocumeewewntBean, binding: ItemDocumentBinding) {
if (item.type == TYPE_PDF) { if (item.type == TYPE_PDF) {
if (item.state == 0) { if (item.state == 0) {
binding.iv.setImageResource(R.mipmap.pdficon) binding.iv.setImageResource(R.mipmap.pdficon)
...@@ -144,7 +143,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen ...@@ -144,7 +143,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen
} }
} }
override fun getItemViewType(position: Int, list: List<DocumentBean>): Int { override fun getItemViewType(position: Int, list: List<DocumeewewntBean>): Int {
val item = list[position] val item = list[position]
return if (item.isAd) 1 else 0 return if (item.isAd) 1 else 0
} }
......
...@@ -9,28 +9,27 @@ import android.os.Build ...@@ -9,28 +9,27 @@ import android.os.Build
import android.os.Environment import android.os.Environment
import android.os.StatFs import android.os.StatFs
import android.os.storage.StorageManager import android.os.storage.StorageManager
import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.pdfreader2.bean.ConstObject.DO_LOCK_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_LOCK_PDF
import com.base.pdfreader2.bean.ConstObject.DO_MERGE_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_MERGE_PDF
import com.base.pdfreader2.bean.ConstObject.DO_SPLIT_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_SPLIT_PDF
import com.base.pdfreader2.bean.ConstObject.DO_UNLOCK_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_UNLOCK_PDF
import com.base.pdfreader2.databinding.FragmentToolBinding import com.base.pdfreader2.databinding.FragmentToolBinding
import com.base.pdfreader2.helper.BaseFragment import com.base.pdfreader2.helper.Baragment
import com.base.pdfreader2.helper.WeatherUtils import com.base.pdfreader2.helper.WDSDArUtils
import com.base.pdfreader2.ui.appprocess.AppProcessLoadingActivity import com.base.pdfreader2.ui.appprocess.AppPSALoadingActivity
import com.base.pdfreader2.ui.cleanjunk.ScanJunkActivity import com.base.pdfreader2.ui.cleanjunk.ScanJunkActivity
import com.base.pdfreader2.ui.pdf.PdfActivity import com.base.pdfreader2.ui.pdf.PdfAWEWQEctivity
import com.base.pdfreader2.ui.pdf.PdfSelectActivity import com.base.pdfreader2.ui.pdf.SSASSelctivity
import com.base.pdfreader2.ui.set.SetActivity import com.base.pdfreader2.ui.set.DSADSSetActivity
import com.base.pdfreader2.ui.view.ProgressBean import com.base.pdfreader2.ui.view.ProgressBean
import com.base.pdfreader2.ui.view.PwdDialog.showPdfPwdDialog import com.base.pdfreader2.ui.view.PwdDiaSSg.showPdfPwdDialog
import com.base.pdfreader2.ui.weather.WeatherInterface import com.base.pdfreader2.ui.weather.WeatASerface
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.base.pdfreader2.utils.PdfBoxUtils.checkPdfEncryption import com.base.pdfreader2.utils.PdfBasdasdoxUtils.checkPdfEncryption
import com.base.pdfreader2.utils.PermissionUtils.checkStorePermission import com.base.pdfreader2.utils.PermiasnUtils.checkStorePermission
import com.base.pdfreader2.utils.getMediaAudioCountSize import com.base.pdfreader2.utils.getMediaAudioCountSize
import com.base.pdfreader2.utils.getMediaPhotoCountSize import com.base.pdfreader2.utils.getMediaPhotoCountSize
import com.base.pdfreader2.utils.getMediaVideoCountSize import com.base.pdfreader2.utils.getMediaVideoCountSize
...@@ -39,7 +38,7 @@ import kotlinx.coroutines.launch ...@@ -39,7 +38,7 @@ import kotlinx.coroutines.launch
import java.io.File import java.io.File
class ToolFragment : BaseFragment<FragmentToolBinding>() { class ToWWQolFragment : Baragment<FragmentToolBinding>() {
private val TAG = "ToolFragment" private val TAG = "ToolFragment"
...@@ -50,7 +49,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -50,7 +49,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun setView() { override fun setView() {
val bean = WeatherUtils.getWeatherEntity()?.list?.get(0) val bean = WDSDArUtils.getWeatherEntity()?.list?.get(0)
bean?.let { bean?.let {
binding.tvWendu.text = (it.tempMax.toInt() + it.tempMin.toInt() / 2).toString() binding.tvWendu.text = (it.tempMax.toInt() + it.tempMin.toInt() / 2).toString()
} }
...@@ -72,7 +71,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -72,7 +71,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
val state = requireContext().checkPdfEncryption(uri = uri.toString()) val state = requireContext().checkPdfEncryption(uri = uri.toString())
if (state == 0) { if (state == 0) {
launch(Dispatchers.Main) { launch(Dispatchers.Main) {
startActivity(Intent(requireContext(), PdfActivity::class.java).apply { startActivity(Intent(requireContext(), PdfAWEWQEctivity::class.java).apply {
putExtra("uri", uri.toString()) putExtra("uri", uri.toString())
}) })
} }
...@@ -83,7 +82,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -83,7 +82,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
uri = uri.toString(), uri = uri.toString(),
isCheckPwd = true, isCheckPwd = true,
verificationAction = { pwd -> verificationAction = { pwd ->
startActivity(Intent(requireContext(), PdfActivity::class.java).apply { startActivity(Intent(requireContext(), PdfAWEWQEctivity::class.java).apply {
putExtra("uri", uri.toString()) putExtra("uri", uri.toString())
putExtra("pwd", pwd) putExtra("pwd", pwd)
}) })
...@@ -96,27 +95,27 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -96,27 +95,27 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
} }
} }
binding.llMerge.setOnClickListener { binding.llMerge.setOnClickListener {
startActivity(Intent(requireContext(), PdfSelectActivity::class.java).apply { startActivity(Intent(requireContext(), SSASSelctivity::class.java).apply {
putExtra("doWhat", DO_MERGE_PDF) putExtra("doWhat", DO_MERGE_PDF)
}) })
} }
binding.llSplit.setOnClickListener { binding.llSplit.setOnClickListener {
startActivity(Intent(requireContext(), PdfSelectActivity::class.java).apply { startActivity(Intent(requireContext(), SSASSelctivity::class.java).apply {
putExtra("doWhat", DO_SPLIT_PDF) putExtra("doWhat", DO_SPLIT_PDF)
}) })
} }
binding.llLock.setOnClickListener { binding.llLock.setOnClickListener {
startActivity(Intent(requireContext(), PdfSelectActivity::class.java).apply { startActivity(Intent(requireContext(), SSASSelctivity::class.java).apply {
putExtra("doWhat", DO_LOCK_PDF) putExtra("doWhat", DO_LOCK_PDF)
}) })
} }
binding.llUnlock.setOnClickListener { binding.llUnlock.setOnClickListener {
startActivity(Intent(requireContext(), PdfSelectActivity::class.java).apply { startActivity(Intent(requireContext(), SSASSelctivity::class.java).apply {
putExtra("doWhat", DO_UNLOCK_PDF) putExtra("doWhat", DO_UNLOCK_PDF)
}) })
} }
binding.llSet.setOnClickListener { binding.llSet.setOnClickListener {
startActivity(Intent(requireContext(), SetActivity::class.java)) startActivity(Intent(requireContext(), DSADSSetActivity::class.java))
} }
binding.llImagePdf.setOnClickListener { binding.llImagePdf.setOnClickListener {
val mainActivity = (requireActivity() as MainActivity?) val mainActivity = (requireActivity() as MainActivity?)
...@@ -129,13 +128,13 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -129,13 +128,13 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
mainActivity.useGmsScanFunction() mainActivity.useGmsScanFunction()
} }
binding.llProcess.setOnClickListener { binding.llProcess.setOnClickListener {
startActivity(Intent(requireContext(), AppProcessLoadingActivity::class.java)) startActivity(Intent(requireContext(), AppPSALoadingActivity::class.java))
} }
binding.tvClean.setOnClickListener { binding.tvClean.setOnClickListener {
startActivity(Intent(requireContext(), ScanJunkActivity::class.java)) startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
} }
binding.llWeather.setOnClickListener { binding.llWeather.setOnClickListener {
startActivity(Intent(requireContext(), WeatherInterface::class.java)) startActivity(Intent(requireContext(), WeatASerface::class.java))
} }
} }
...@@ -152,7 +151,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -152,7 +151,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
if (preProgressList.isNullOrEmpty()) { if (preProgressList.isNullOrEmpty()) {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
LogEx.logDebug(TAG, "now load data") LEEEx.logDebug(TAG, "now load data")
initAppVidePhotoMusicData(requireContext(), initAppVidePhotoMusicData(requireContext(),
{ {
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
...@@ -169,7 +168,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() { ...@@ -169,7 +168,7 @@ class ToolFragment : BaseFragment<FragmentToolBinding>() {
} }
} else { } else {
lifecycleScope.launch(Dispatchers.Main) { lifecycleScope.launch(Dispatchers.Main) {
LogEx.logDebug(TAG, "preload data") LEEEx.logDebug(TAG, "preload data")
binding.tvUsedStorage.text = usedBytes.toFormatSize() binding.tvUsedStorage.text = usedBytes.toFormatSize()
binding.tvTotalStorage.text = " / ${totalBytes.toFormatSize()}" binding.tvTotalStorage.text = " / ${totalBytes.toFormatSize()}"
binding.tvPercent.text = "${usedBytes * 100 / totalBytes}" binding.tvPercent.text = "${usedBytes * 100 / totalBytes}"
......
...@@ -3,17 +3,17 @@ package com.base.pdfreader2.ui.pdf ...@@ -3,17 +3,17 @@ package com.base.pdfreader2.ui.pdf
import android.content.Intent import android.content.Intent
import androidx.activity.addCallback import androidx.activity.addCallback
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.ConstObject import com.base.pdfreader2.bean.ConstObweweject
import com.base.pdfreader2.bean.PdfPageBean import com.base.pdfreader2.bean.PdQEfPageBean
import com.base.pdfreader2.databinding.ActivityPdfSplitBinding import com.base.pdfreader2.databinding.ActivityPdfSplitBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.view.NameDialog.showDocumentRenameDialog import com.base.pdfreader2.ui.view.NADialog.showDocumentRenameDialog
class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView { class PdActivity : ASctivity<ActivityPdfSplitBinding>(), PdfViewSAD {
private lateinit var pdfPresenter: PdfPresenter private lateinit var pdfPresenter: senter
private lateinit var pdfPagerAdapter: PdfPagerAdapter private lateinit var pdfPagerAdapter: PdfPrAdapter
private var path: String = "" private var path: String = ""
private var pwd: String? = "" private var pwd: String? = ""
...@@ -23,13 +23,13 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView { ...@@ -23,13 +23,13 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateAppLanguage(MyApplication.pdfSplitLanguage) { updateAppLanguage(AAication.pdfSplitLanguage) {
MyApplication.pdfSplitLanguage = it AAication.pdfSplitLanguage = it
} }
} }
override fun initView() { override fun initView() {
pdfPresenter = PdfPresenter(this, this) pdfPresenter = senter(this, this)
path = intent.extras?.getString("path", "") ?: "" path = intent.extras?.getString("path", "") ?: ""
pwd = intent.extras?.getString("pwd", "") ?: "" pwd = intent.extras?.getString("pwd", "") ?: ""
pdfPresenter.password = pwd pdfPresenter.password = pwd
...@@ -54,8 +54,8 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView { ...@@ -54,8 +54,8 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView {
binding.tvBtnSplit.setOnClickListener { binding.tvBtnSplit.setOnClickListener {
val splitIndex = pdfPagerAdapter.items.filter { it.isSelect }.map { it.pageIndex } val splitIndex = pdfPagerAdapter.items.filter { it.isSelect }.map { it.pageIndex }
showDocumentRenameDialog(okAction = { newName -> showDocumentRenameDialog(okAction = { newName ->
startActivity(Intent(this, PdfLoadingActivity::class.java).apply { startActivity(Intent(this, QWEoadingActivity::class.java).apply {
putExtra("doWhat", ConstObject.DO_SPLIT_PDF) putExtra("doWhat", ConstObweweject.DO_SPLIT_PDF)
putExtra("srcPath", path) putExtra("srcPath", path)
putExtra("pwd", pwd) putExtra("pwd", pwd)
putExtra("newPath", pdfPresenter.createNewPdfPath(newName)) putExtra("newPath", pdfPresenter.createNewPdfPath(newName))
...@@ -67,7 +67,7 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView { ...@@ -67,7 +67,7 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView {
} }
private fun initAdapter() { private fun initAdapter() {
pdfPagerAdapter = PdfPagerAdapter(path, null, R.layout.item_pdf_pager_split) pdfPagerAdapter = PdfPrAdapter(path, null, R.layout.item_pdf_pager_split)
pdfPagerAdapter.mPassword = pwd pdfPagerAdapter.mPassword = pwd
pdfPagerAdapter.selectAction = { enable, allSelect -> pdfPagerAdapter.selectAction = { enable, allSelect ->
binding.tvBtnSplit.isEnabled = enable binding.tvBtnSplit.isEnabled = enable
...@@ -77,7 +77,7 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView { ...@@ -77,7 +77,7 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView {
} }
override fun initPdfPageRv(items: List<PdfPageBean>) { override fun initPdfPageRv(items: List<PdQEfPageBean>) {
pdfPagerAdapter.submitList(items) pdfPagerAdapter.submitList(items)
} }
......
...@@ -21,39 +21,38 @@ import com.artifex.mupdfdemo.MuPDFView ...@@ -21,39 +21,38 @@ import com.artifex.mupdfdemo.MuPDFView
import com.artifex.mupdfdemo.SearchTask import com.artifex.mupdfdemo.SearchTask
import com.artifex.mupdfdemo.SearchTaskResult import com.artifex.mupdfdemo.SearchTaskResult
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.ConstObject.haveGuideGesture import com.base.pdfreader2.bean.ConstObweweject.haveGuideGesture
import com.base.pdfreader2.bean.PdfPageBean import com.base.pdfreader2.bean.PdQEfPageBean
import com.base.pdfreader2.databinding.ActivityPdfBinding import com.base.pdfreader2.databinding.ActivityPdfBinding
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.view.PdfDialog.showPdfMoreDialog import com.base.pdfreader2.ui.view.PdFSFDialog.showPdfMoreDialog
import com.base.pdfreader2.utils.KeyBoardUtils.hideKeyboard import com.base.pdfreader2.utils.KeyBoardUSDSADtils.hideKeyboard
import com.base.pdfreader2.utils.KeyBoardUtils.showKeyBoard import com.base.pdfreader2.utils.KeyBoardUSDSADtils.showKeyBoard
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.base.pdfreader2.utils.SpStringUtils import com.base.pdfreader2.utils.sdadUtils
import com.base.pdfreader2.utils.SpStringUtils.LAST_VIEW_KEY import com.base.pdfreader2.utils.sdadUtils.LAST_VIEW_KEY
import com.base.pdfreader2.utils.ToastUtils.toast import com.base.pdfreader2.utils.dasdtUtils.toast
import com.artifex.mupdfdemo.Annotation import com.artifex.mupdfdemo.Annotation
import com.artifex.mupdfdemo.Hit import com.artifex.mupdfdemo.Hit
import com.artifex.mupdfdemo.MuPDFPageAdapter import com.artifex.mupdfdemo.MuPDFPageAdapter
import com.artifex.mupdfdemo.MuPDFReaderViewListener import com.artifex.mupdfdemo.MuPDFReaderViewListener
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.AdmobHelper.isShowCloseDocument import com.base.pdfreader2.ads.Aer.isShowCloseDocument
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.ads.admob.AdmobNativeUtils import com.base.pdfreader2.ads.admob.AveUtils
import kotlinx.coroutines.cancel
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlin.random.Random import kotlin.random.Random
class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { class PdfAWEWQEctivity : ASctivity<ActivityPdfBinding>(), PdfViewSAD {
private val TAG = "PdfActivity" private val TAG = "PdfActivity"
private lateinit var pdfPresenter: PdfPresenter private lateinit var pdfPresenter: senter
private lateinit var pdfPageAdapter: PdfPagerAdapter private lateinit var pdfPageAdapter: PdfPrAdapter
private var muPDFCore: MuPDFCore? = null // 加载mupdf.so文件 private var muPDFCore: MuPDFCore? = null // 加载mupdf.so文件
private var searchTask: SearchTask? = null private var searchTask: SearchTask? = null
...@@ -70,8 +69,8 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -70,8 +69,8 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateAppLanguage(MyApplication.pdfLanguage, TAG) { updateAppLanguage(AAication.pdfLanguage, TAG) {
MyApplication.pdfLanguage = it AAication.pdfLanguage = it
} }
} }
...@@ -83,7 +82,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -83,7 +82,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
muPDFCore?.onDestroy() muPDFCore?.onDestroy()
AdmobNativeUtils.onDestroy() AveUtils.onDestroy()
} }
...@@ -103,7 +102,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -103,7 +102,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
} }
override fun initView() { override fun initView() {
val needRecreate = checkNeedRecreate(MyApplication.pdfLanguage) val needRecreate = checkNeedRecreate(AAication.pdfLanguage)
if (needRecreate) return if (needRecreate) return
startLoading() startLoading()
...@@ -114,13 +113,13 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -114,13 +113,13 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
path = intent.extras?.getString("path") ?: "" path = intent.extras?.getString("path") ?: ""
uri = intent.extras?.getString("uri") uri = intent.extras?.getString("uri")
LogEx.logDebug(TAG, "path=$path") LEEEx.logDebug(TAG, "path=$path")
LogEx.logDebug(TAG, "uri=$uri") LEEEx.logDebug(TAG, "uri=$uri")
val file = File(path) val file = File(path)
binding.tvPdfName.text = file.name binding.tvPdfName.text = file.name
pdfPresenter = PdfPresenter(this, this) pdfPresenter = senter(this, this)
initAdapter() initAdapter()
changeNormalUI() changeNormalUI()
...@@ -140,7 +139,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -140,7 +139,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
pdfPageAdapter.setPassword(pwd) pdfPageAdapter.setPassword(pwd)
createPdfUI() createPdfUI()
muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) } muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}") sdadUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}")
} else { } else {
toast("unknown error") toast("unknown error")
finish() finish()
...@@ -148,10 +147,10 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -148,10 +147,10 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
} else { } else {
createPdfUI() createPdfUI()
muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) } muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}") sdadUtils.addSpString(LAST_VIEW_KEY, "${path}_/_${System.currentTimeMillis()}")
} }
AdmobNativeUtils.showNativeAd(this, binding.flAd, R.layout.layout_admob_document_in) AveUtils.showNativeAd(this, binding.flAd, R.layout.layout_admob_document_in)
} }
private fun showGuide() { private fun showGuide() {
...@@ -185,12 +184,12 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -185,12 +184,12 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
private fun setVerticalSeekbar(current: Int, max: Int) { private fun setVerticalSeekbar(current: Int, max: Int) {
val process = max - current val process = max - current
LogEx.logDebug(TAG, "process=$process $current $max") LEEEx.logDebug(TAG, "process=$process $current $max")
binding.verticalSeekbar.progress = process binding.verticalSeekbar.progress = process
} }
override fun initListener() { override fun initListener() {
val needRecreate = checkNeedRecreate(MyApplication.pdfLanguage) val needRecreate = checkNeedRecreate(AAication.pdfLanguage)
if (needRecreate) return if (needRecreate) return
onBackPressedDispatcher.addCallback { onBackPressedDispatcher.addCallback {
...@@ -212,10 +211,10 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -212,10 +211,10 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
return@addCallback return@addCallback
} }
if (AdmobHelper.isShowCloseDocumentInter() && isShowCloseDocument()) { if (Aer.isShowCloseDocumentInter() && isShowCloseDocument()) {
AdmobInterstitialUtils.showInterstitialAd(this@PdfActivity) { AdmoalUtils.showInterstitialAd(this@PdfAWEWQEctivity) {
if (it) { if (it) {
AdmobHelper.lastCloseDocumentShowAd = System.currentTimeMillis() Aer.lastCloseDocumentShowAd = System.currentTimeMillis()
} }
binding.root.postDelayed({ finishToMain() }, 500) binding.root.postDelayed({ finishToMain() }, 500)
} }
...@@ -288,7 +287,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -288,7 +287,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
switchOrientation() switchOrientation()
} }
binding.verticalSeekbar.setOnReleaseListener { progress -> binding.verticalSeekbar.setOnReleaseListener { progress ->
LogEx.logDebug(TAG, "progress=$progress") LEEEx.logDebug(TAG, "progress=$progress")
val total = muPDFCore?.countPages() ?: 0 val total = muPDFCore?.countPages() ?: 0
val pageIndex = total - 1 - progress val pageIndex = total - 1 - progress
...@@ -362,7 +361,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -362,7 +361,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
} }
private fun initAdapter() { private fun initAdapter() {
pdfPageAdapter = PdfPagerAdapter(path, uri) pdfPageAdapter = PdfPrAdapter(path, uri)
pdfPageAdapter.clickAction = { pageIndex -> pdfPageAdapter.clickAction = { pageIndex ->
binding.mupdfReaderView.displayedViewIndex = pageIndex binding.mupdfReaderView.displayedViewIndex = pageIndex
} }
...@@ -637,7 +636,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView { ...@@ -637,7 +636,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
const val SAVE_MODE_PAINTING_BRUSH = "Painting Brush" const val SAVE_MODE_PAINTING_BRUSH = "Painting Brush"
} }
override fun initPdfPageRv(items: List<PdfPageBean>) { override fun initPdfPageRv(items: List<PdQEfPageBean>) {
pdfPageAdapter.submitList(items) pdfPageAdapter.submitList(items)
pdfPageAdapter.changeSelectPager(0) pdfPageAdapter.changeSelectPager(0)
iniSetVerticalSeekbar(items.size) iniSetVerticalSeekbar(items.size)
......
...@@ -4,15 +4,15 @@ import android.content.Intent ...@@ -4,15 +4,15 @@ import android.content.Intent
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import com.base.pdfreader2.bean.ConstObject.DO_MERGE_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_MERGE_PDF
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.databinding.ActivityPdfMergeBinding import com.base.pdfreader2.databinding.ActivityPdfMergeBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.view.NameDialog.showDocumentRenameDialog import com.base.pdfreader2.ui.view.NADialog.showDocumentRenameDialog
import com.base.pdfreader2.ui.view.PwdDialog.showPdfPwdDialog import com.base.pdfreader2.ui.view.PwdDiaSSg.showPdfPwdDialog
import com.base.pdfreader2.utils.KotlinExt.toFormatTime2 import com.base.pdfreader2.utils.SSDtlinExt.toFormatTime2
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel import kotlinx.coroutines.cancel
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
...@@ -21,24 +21,24 @@ import java.util.concurrent.ArrayBlockingQueue ...@@ -21,24 +21,24 @@ import java.util.concurrent.ArrayBlockingQueue
import java.util.concurrent.BlockingQueue import java.util.concurrent.BlockingQueue
class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { class PdfMEQWEergeActivity : ASctivity<ActivityPdfMergeBinding>() {
private val TAG = "PdfMergeActivity" private val TAG = "PdfMergeActivity"
override val binding: ActivityPdfMergeBinding by lazy { override val binding: ActivityPdfMergeBinding by lazy {
ActivityPdfMergeBinding.inflate(layoutInflater) ActivityPdfMergeBinding.inflate(layoutInflater)
} }
private lateinit var pdfPresenter: PdfPresenter private lateinit var pdfPresenter: senter
private lateinit var adapter: PdfMergeAdapter private lateinit var adapter: eDDArgeAdapter
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateAppLanguage(MyApplication.pdfMergeLanguage) { updateAppLanguage(AAication.pdfMergeLanguage) {
MyApplication.pdfMergeLanguage = it AAication.pdfMergeLanguage = it
} }
} }
override fun initView() { override fun initView() {
pdfPresenter = PdfPresenter(this) pdfPresenter = senter(this)
initAdapter() initAdapter()
} }
...@@ -57,7 +57,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -57,7 +57,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
verificationPasswordDialogs { verificationPasswordDialogs {
showDocumentRenameDialog(name = "Merge_${System.currentTimeMillis().toFormatTime2()}", okAction = { name -> showDocumentRenameDialog(name = "Merge_${System.currentTimeMillis().toFormatTime2()}", okAction = { name ->
startActivity(Intent(this, PdfLoadingActivity::class.java).apply { startActivity(Intent(this, QWEoadingActivity::class.java).apply {
putExtra("doWhat", DO_MERGE_PDF) putExtra("doWhat", DO_MERGE_PDF)
putExtra("newPath", pdfPresenter.createNewPdfPath(name)) putExtra("newPath", pdfPresenter.createNewPdfPath(name))
}) })
...@@ -69,21 +69,21 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -69,21 +69,21 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
} }
private fun verificationPasswordDialogs(callBack: () -> Unit) { private fun verificationPasswordDialogs(callBack: () -> Unit) {
val queue: BlockingQueue<DocumentBean> = ArrayBlockingQueue(1) val queue: BlockingQueue<DocumeewewntBean> = ArrayBlockingQueue(1)
val pwdItemList = mergePdfList.filter { it.state == 1 }.toMutableList() val pwdItemList = mergePdfList.filter { it.state == 1 }.toMutableList()
if (pwdItemList.isNotEmpty()) { if (pwdItemList.isNotEmpty()) {
LogEx.logDebug(TAG, "verificationPasswordDialogs1") LEEEx.logDebug(TAG, "verificationPasswordDialogs1")
val verifiedList = arrayListOf<DocumentBean>() val verifiedList = arrayListOf<DocumeewewntBean>()
val first = pwdItemList[0] val first = pwdItemList[0]
queue.put(first) queue.put(first)
pwdItemList.removeAt(0) pwdItemList.removeAt(0)
LogEx.logDebug(TAG, "verificationPasswordDialogs2") LEEEx.logDebug(TAG, "verificationPasswordDialogs2")
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
while (isActive) { while (isActive) {
val item: DocumentBean = queue.take() val item: DocumeewewntBean = queue.take()
LogEx.logDebug(TAG, "pwdItem =${item.path}") LEEEx.logDebug(TAG, "pwdItem =${item.path}")
if (item.path == "Cancel") { if (item.path == "Cancel") {
break break
} }
...@@ -96,7 +96,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -96,7 +96,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
queue.put(next) queue.put(next)
pwdItemList.removeAt(0) pwdItemList.removeAt(0)
} else { } else {
queue.put(DocumentBean(path = "Cancel")) queue.put(DocumeewewntBean(path = "Cancel"))
} }
}, cancelAction = { }, cancelAction = {
cancel() cancel()
...@@ -104,12 +104,12 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -104,12 +104,12 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
} }
} }
LogEx.logDebug(TAG, "verificationPasswordDialogs3 ${verifiedList.size}") LEEEx.logDebug(TAG, "verificationPasswordDialogs3 ${verifiedList.size}")
verifiedList.forEach { verifiedItem -> verifiedList.forEach { verifiedItem ->
mergePdfList.find { it.path == verifiedItem.path }?.pwd = verifiedItem.pwd mergePdfList.find { it.path == verifiedItem.path }?.pwd = verifiedItem.pwd
} }
mergePdfList.forEach { mergePdfList.forEach {
LogEx.logDebug(TAG, "密码=" + it.pwd) LEEEx.logDebug(TAG, "密码=" + it.pwd)
} }
launch(Dispatchers.Main) { launch(Dispatchers.Main) {
callBack.invoke() callBack.invoke()
...@@ -122,10 +122,10 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -122,10 +122,10 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
} }
private fun initAdapter() { private fun initAdapter() {
val callBack = PdfMergeItemTouchHelperCallBack() val callBack = PdfMeerCallBack()
val itemTouchHelper = ItemTouchHelper(callBack) val itemTouchHelper = ItemTouchHelper(callBack)
itemTouchHelper.attachToRecyclerView(binding.rv) itemTouchHelper.attachToRecyclerView(binding.rv)
adapter = PdfMergeAdapter(itemTouchHelper, callBack) adapter = eDDArgeAdapter(itemTouchHelper, callBack)
adapter.removeAction = { adapter.removeAction = {
mergePdfList.remove(it) mergePdfList.remove(it)
binding.tvBtnNext.isEnabled = mergePdfList.size >= 2 binding.tvBtnNext.isEnabled = mergePdfList.size >= 2
...@@ -138,11 +138,11 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -138,11 +138,11 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
mergePdfList.add(newPosition, bean) mergePdfList.add(newPosition, bean)
mergePdfList.forEach { mergePdfList.forEach {
LogEx.logDebug(TAG, "mergePdfList ${it.path}") LEEEx.logDebug(TAG, "mergePdfList ${it.path}")
} }
adapter.items.forEach { adapter.items.forEach {
LogEx.logDebug(TAG, "items ${it.path}") LEEEx.logDebug(TAG, "items ${it.path}")
} }
// adapter.items = mergePdfList // adapter.items = mergePdfList
...@@ -153,7 +153,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() { ...@@ -153,7 +153,7 @@ class PdfMergeActivity : BaseActivity<ActivityPdfMergeBinding>() {
} }
companion object { companion object {
val mergePdfList: ArrayList<DocumentBean> = arrayListOf() val mergePdfList: ArrayList<DocumeewewntBean> = arrayListOf()
} }
......
...@@ -2,9 +2,9 @@ package com.base.pdfreader2.ui.pdf ...@@ -2,9 +2,9 @@ package com.base.pdfreader2.ui.pdf
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
class PdfMergeItemTouchHelperCallBack : ItemTouchHelper.Callback() { class PdfMeerCallBack : ItemTouchHelper.Callback() {
var changeListOrder: ((olderPosition: Int, newPosition: Int) -> Unit)? = null var changeListOrder: ((olderPosition: Int, newPosition: Int) -> Unit)? = null
...@@ -44,7 +44,7 @@ class PdfMergeItemTouchHelperCallBack : ItemTouchHelper.Callback() { ...@@ -44,7 +44,7 @@ class PdfMergeItemTouchHelperCallBack : ItemTouchHelper.Callback() {
override fun isLongPressDragEnabled(): Boolean { override fun isLongPressDragEnabled(): Boolean {
LogEx.logDebug(TAG, "isLongPressDragEnabled $enableLongPress ${System.currentTimeMillis()}") LEEEx.logDebug(TAG, "isLongPressDragEnabled $enableLongPress ${System.currentTimeMillis()}")
return enableLongPress return enableLongPress
} }
......
...@@ -7,22 +7,22 @@ import android.view.ViewGroup ...@@ -7,22 +7,22 @@ import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.PdfPageBean import com.base.pdfreader2.bean.PdQEfPageBean
import com.base.pdfreader2.databinding.ItemPdfPagerBinding import com.base.pdfreader2.databinding.ItemPdfPagerBinding
import com.base.pdfreader2.databinding.ItemPdfPagerSplitBinding import com.base.pdfreader2.databinding.ItemPdfPagerSplitBinding
import com.base.pdfreader2.utils.PdfBoxUtils.getPdfDrawablePage import com.base.pdfreader2.utils.PdfBasdasdoxUtils.getPdfDrawablePage
import com.base.pdfreader2.utils.XmlEx.inflate import com.base.pdfreader2.utils.dasdmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter import com.chad.library.adapter4.BaseQuickAdapter
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.ThreadPoolExecutor import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class PdfPagerAdapter( class PdfPrAdapter(
val pdfPath: String, val pdfPath: String,
val uri: String? = null, val uri: String? = null,
val itemLayout: Int = R.layout.item_pdf_pager, val itemLayout: Int = R.layout.item_pdf_pager,
) : BaseQuickAdapter<PdfPageBean, PdfPagerAdapter.PdfPagerViewHolder>() { ) : BaseQuickAdapter<PdQEfPageBean, PdfPrAdapter.PdfPagerViewHolder>() {
var mPassword: String? = null var mPassword: String? = null
var selectAction: ((enable: Boolean, allSelect: Boolean) -> Unit)? = null var selectAction: ((enable: Boolean, allSelect: Boolean) -> Unit)? = null
...@@ -42,7 +42,7 @@ class PdfPagerAdapter( ...@@ -42,7 +42,7 @@ class PdfPagerAdapter(
) )
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: PdfPagerViewHolder, position: Int, item: PdfPageBean?) { override fun onBindViewHolder(holder: PdfPagerViewHolder, position: Int, item: PdQEfPageBean?) {
if (item == null) return if (item == null) return
when (itemLayout) { when (itemLayout) {
R.layout.item_pdf_pager -> { R.layout.item_pdf_pager -> {
...@@ -83,7 +83,7 @@ class PdfPagerAdapter( ...@@ -83,7 +83,7 @@ class PdfPagerAdapter(
private fun loadPagerDrawable( private fun loadPagerDrawable(
context: Context, context: Context,
item: PdfPageBean, item: PdQEfPageBean,
itemView: View, itemView: View,
iv: ImageView, iv: ImageView,
scale: Float = 1f scale: Float = 1f
......
package com.base.pdfreader2.ui.pdf package com.base.pdfreader2.ui.pdf
import com.base.pdfreader2.bean.PdfPageBean import com.base.pdfreader2.bean.PdQEfPageBean
interface PdfView { interface PdfViewSAD {
fun initPdfPageRv(items: List<PdfPageBean>) fun initPdfPageRv(items: List<PdQEfPageBean>)
fun jumpPage(pageIndex: Int) = Unit fun jumpPage(pageIndex: Int) = Unit
......
...@@ -3,16 +3,16 @@ package com.base.pdfreader2.ui.pdf ...@@ -3,16 +3,16 @@ package com.base.pdfreader2.ui.pdf
import android.content.Intent import android.content.Intent
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.artifex.mupdfdemo.MuPDFCore import com.artifex.mupdfdemo.MuPDFCore
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.ConstObject.DO_MERGE_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_MERGE_PDF
import com.base.pdfreader2.bean.ConstObject.DO_SAVE_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_SAVE_PDF
import com.base.pdfreader2.bean.ConstObject.DO_SPLIT_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_SPLIT_PDF
import com.base.pdfreader2.databinding.ActivityPdfLoadingBinding import com.base.pdfreader2.databinding.ActivityPdfLoadingBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.base.pdfreader2.utils.ToastUtils.toast import com.base.pdfreader2.utils.dasdtUtils.toast
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
...@@ -20,7 +20,7 @@ import kotlinx.coroutines.launch ...@@ -20,7 +20,7 @@ import kotlinx.coroutines.launch
import java.io.File import java.io.File
import kotlin.random.Random import kotlin.random.Random
class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { class QWEoadingActivity : ASctivity<ActivityPdfLoadingBinding>() {
private val TAG = "PdfLoadingActivity" private val TAG = "PdfLoadingActivity"
private var doWhat = "" private var doWhat = ""
...@@ -28,7 +28,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -28,7 +28,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
private var newPath: String = "" private var newPath: String = ""
private var pwd: String? = null private var pwd: String? = null
private var splitIndex: List<Int> = listOf() private var splitIndex: List<Int> = listOf()
private lateinit var pdfPresenter: PdfPresenter private lateinit var pdfPresenter: senter
override val binding: ActivityPdfLoadingBinding by lazy { override val binding: ActivityPdfLoadingBinding by lazy {
ActivityPdfLoadingBinding.inflate(layoutInflater) ActivityPdfLoadingBinding.inflate(layoutInflater)
...@@ -40,14 +40,14 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -40,14 +40,14 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
var resultFile: File? = null var resultFile: File? = null
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateAppLanguage(MyApplication.pdfLoadingLanguage) { updateAppLanguage(AAication.pdfLoadingLanguage) {
MyApplication.pdfLoadingLanguage = it AAication.pdfLoadingLanguage = it
} }
} }
fun progressFinishAd(next: () -> Unit) { fun progressFinishAd(next: () -> Unit) {
if (AdmobHelper.canCommonShowAd()) { if (Aer.canCommonShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this) { AdmoalUtils.showInterstitialAd(this) {
next.invoke() next.invoke()
} }
} else { } else {
...@@ -57,11 +57,11 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -57,11 +57,11 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
} }
override fun initView() { override fun initView() {
if (checkNeedRecreate(MyApplication.pdfLoadingLanguage)) { if (checkNeedRecreate(AAication.pdfLoadingLanguage)) {
return return
} }
pdfPresenter = PdfPresenter(this) pdfPresenter = senter(this)
initSpPa() initSpPa()
pdfPresenter.password = pwd pdfPresenter.password = pwd
...@@ -70,7 +70,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -70,7 +70,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
progressFinishAction = { progressFinishAction = {
progressFinishAd { progressFinishAd {
if (resultFile != null) { if (resultFile != null) {
startActivity(Intent(this, PdfActivity::class.java).apply { startActivity(Intent(this, PdfAWEWQEctivity::class.java).apply {
putExtra("path", resultFile?.absolutePath ?: "") putExtra("path", resultFile?.absolutePath ?: "")
}) })
} else { } else {
...@@ -91,7 +91,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -91,7 +91,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
muPDFCore = null muPDFCore = null
progressFinishAction = { progressFinishAction = {
progressFinishAd { progressFinishAd {
startActivity(Intent(this, PdfActivity::class.java).apply { startActivity(Intent(this, PdfAWEWQEctivity::class.java).apply {
putExtra("path", srcPath) putExtra("path", srcPath)
}) })
finish() finish()
...@@ -107,7 +107,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -107,7 +107,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
DO_MERGE_PDF -> { DO_MERGE_PDF -> {
progressFinishAction = { progressFinishAction = {
progressFinishAd { progressFinishAd {
startActivity(Intent(this, PdfActivity::class.java).apply { startActivity(Intent(this, PdfAWEWQEctivity::class.java).apply {
putExtra("path", newPath) putExtra("path", newPath)
}) })
finish() finish()
...@@ -142,7 +142,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() { ...@@ -142,7 +142,7 @@ class PdfLoadingActivity : BaseActivity<ActivityPdfLoadingBinding>() {
pwd = intent.extras?.getString("pwd") pwd = intent.extras?.getString("pwd")
newPath = intent?.extras?.getString("newPath", "") ?: "" newPath = intent?.extras?.getString("newPath", "") ?: ""
splitIndex = intent.extras?.getString("splitIndex")?.split(",")?.map { it.toInt() } ?: listOf() splitIndex = intent.extras?.getString("splitIndex")?.split(",")?.map { it.toInt() } ?: listOf()
LogEx.logDebug(TAG, "initSpPa doWhat=$doWhat srcPath=$srcPath pwd=$pwd newPath=$newPath splitIndex=$splitIndex") LEEEx.logDebug(TAG, "initSpPa doWhat=$doWhat srcPath=$srcPath pwd=$pwd newPath=$newPath splitIndex=$splitIndex")
} }
companion object { companion object {
......
...@@ -7,27 +7,27 @@ import androidx.activity.addCallback ...@@ -7,27 +7,27 @@ import androidx.activity.addCallback
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.ads.AdmobHelper import com.base.pdfreader2.ads.Aer
import com.base.pdfreader2.ads.admob.AdmobInterstitialUtils import com.base.pdfreader2.ads.admob.AdmoalUtils
import com.base.pdfreader2.bean.ConstObject.DO_LOCK_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_LOCK_PDF
import com.base.pdfreader2.bean.ConstObject.DO_MERGE_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_MERGE_PDF
import com.base.pdfreader2.bean.ConstObject.DO_SPLIT_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_SPLIT_PDF
import com.base.pdfreader2.bean.ConstObject.DO_UNLOCK_PDF import com.base.pdfreader2.bean.ConstObweweject.DO_UNLOCK_PDF
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.databinding.ActivityPdfSelectBinding import com.base.pdfreader2.databinding.ActivityPdfSelectBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.ui.main.DocumentAdapter import com.base.pdfreader2.ui.main.ASDumentAdapter
import com.base.pdfreader2.ui.main.DocumentPresenter import com.base.pdfreader2.ui.main.ASDASDentPresenter
import com.base.pdfreader2.ui.view.PwdDialog.showPdfPwdDialog import com.base.pdfreader2.ui.view.PwdDiaSSg.showPdfPwdDialog
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { class SSASSelctivity : ASctivity<ActivityPdfSelectBinding>() {
private val TAG = "PdfSelectActivity" private val TAG = "PdfSelectActivity"
private lateinit var documentPresenter: DocumentPresenter private lateinit var documentPresenter: ASDASDentPresenter
private lateinit var adapter: DocumentAdapter private lateinit var adapter: ASDumentAdapter
private var doWhat: String = "" private var doWhat: String = ""
...@@ -37,22 +37,22 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -37,22 +37,22 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateAppLanguage(MyApplication.pdfSelectLanguage) { updateAppLanguage(AAication.pdfSelectLanguage) {
MyApplication.pdfSelectLanguage = it AAication.pdfSelectLanguage = it
} }
} }
override fun initView() { override fun initView() {
if (checkNeedRecreate(MyApplication.pdfSelectLanguage)) { if (checkNeedRecreate(AAication.pdfSelectLanguage)) {
return return
} }
doWhat = intent.extras?.getString("doWhat", "") ?: "" doWhat = intent.extras?.getString("doWhat", "") ?: ""
LogEx.logDebug(TAG, "doWhat=$doWhat") LEEEx.logDebug(TAG, "doWhat=$doWhat")
documentPresenter = DocumentPresenter(this) documentPresenter = ASDASDentPresenter(this)
initAdapter() initAdapter()
...@@ -92,7 +92,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -92,7 +92,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
} }
private fun refreshUI(list: List<DocumentBean>) { private fun refreshUI(list: List<DocumeewewntBean>) {
adapter.submitList(list) adapter.submitList(list)
binding.llEmpty.isVisible = list.isEmpty() binding.llEmpty.isVisible = list.isEmpty()
binding.progressBar.visibility = View.GONE binding.progressBar.visibility = View.GONE
...@@ -102,7 +102,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -102,7 +102,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
override fun initListener() { override fun initListener() {
super.initListener() super.initListener()
if (checkNeedRecreate(MyApplication.pdfSelectLanguage)) { if (checkNeedRecreate(AAication.pdfSelectLanguage)) {
return return
} }
...@@ -116,20 +116,20 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -116,20 +116,20 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
binding.tvBtnNext.setOnClickListener { binding.tvBtnNext.setOnClickListener {
if (doWhat == DO_MERGE_PDF) { if (doWhat == DO_MERGE_PDF) {
val selectList = adapter.items.filter { it.isSelect } val selectList = adapter.items.filter { it.isSelect }
PdfMergeActivity.mergePdfList.clear() PdfMEQWEergeActivity.mergePdfList.clear()
PdfMergeActivity.mergePdfList.addAll(selectList) PdfMEQWEergeActivity.mergePdfList.addAll(selectList)
startActivity(Intent(this, PdfMergeActivity::class.java)) startActivity(Intent(this, PdfMEQWEergeActivity::class.java))
} }
} }
} }
@SuppressLint("StringFormatMatches") @SuppressLint("StringFormatMatches")
private fun initAdapter() { private fun initAdapter() {
adapter = DocumentAdapter() adapter = ASDumentAdapter()
adapter.itemClick = { adapter.itemClick = {
if (doWhat == DO_SPLIT_PDF) { if (doWhat == DO_SPLIT_PDF) {
if (it.state == 0) { if (it.state == 0) {
startActivity(Intent(this, PdfSplitActivity::class.java).apply { startActivity(Intent(this, PdActivity::class.java).apply {
putExtra("path", it.path) putExtra("path", it.path)
}) })
} else { } else {
...@@ -138,7 +138,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -138,7 +138,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
path = it.path, path = it.path,
isCheckPwd = true, isCheckPwd = true,
verificationAction = { pwd -> verificationAction = { pwd ->
startActivity(Intent(this, PdfSplitActivity::class.java).apply { startActivity(Intent(this, PdActivity::class.java).apply {
putExtra("path", it.path) putExtra("path", it.path)
putExtra("pwd", pwd) putExtra("pwd", pwd)
}) })
...@@ -148,8 +148,8 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -148,8 +148,8 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
} }
if (doWhat == DO_LOCK_PDF) { if (doWhat == DO_LOCK_PDF) {
showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = { showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = {
if (AdmobHelper.canCommonShowAd()) { if (Aer.canCommonShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this) { flag -> AdmoalUtils.showInterstitialAd(this) { flag ->
adapter.remove(it) adapter.remove(it)
binding.llEmpty.isVisible = adapter.items.isEmpty() binding.llEmpty.isVisible = adapter.items.isEmpty()
} }
...@@ -161,8 +161,8 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -161,8 +161,8 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
} }
if (doWhat == DO_UNLOCK_PDF) { if (doWhat == DO_UNLOCK_PDF) {
showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = { showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = {
if (AdmobHelper.canCommonShowAd()) { if (Aer.canCommonShowAd()) {
AdmobInterstitialUtils.showInterstitialAd(this) { flag -> AdmoalUtils.showInterstitialAd(this) { flag ->
adapter.remove(it) adapter.remove(it)
binding.llEmpty.isVisible = adapter.items.isEmpty() binding.llEmpty.isVisible = adapter.items.isEmpty()
} }
...@@ -174,7 +174,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() { ...@@ -174,7 +174,7 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
} }
} }
adapter.selectAction = { adapter.selectAction = {
LogEx.logDebug(TAG, "selectAction $it") LEEEx.logDebug(TAG, "selectAction $it")
if (it == 0) { if (it == 0) {
binding.tvSelectTip.visibility = View.INVISIBLE binding.tvSelectTip.visibility = View.INVISIBLE
binding.tvBtnNext.isEnabled = false binding.tvBtnNext.isEnabled = false
......
...@@ -8,29 +8,29 @@ import android.view.ViewGroup ...@@ -8,29 +8,29 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.bean.DocumentBean import com.base.pdfreader2.bean.DocumeewewntBean
import com.base.pdfreader2.databinding.ItemPdfMergeBinding import com.base.pdfreader2.databinding.ItemPdfMergeBinding
import com.base.pdfreader2.utils.KotlinExt.toFormatSize import com.base.pdfreader2.utils.SSDtlinExt.toFormatSize
import com.base.pdfreader2.utils.KotlinExt.toFormatTime4 import com.base.pdfreader2.utils.SSDtlinExt.toFormatTime4
import com.base.pdfreader2.utils.LogEx import com.base.pdfreader2.utils.LEEEx
import com.base.pdfreader2.utils.XmlEx.inflate import com.base.pdfreader2.utils.dasdmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter import com.chad.library.adapter4.BaseQuickAdapter
import java.io.File import java.io.File
class PdfMergeAdapter( class eDDArgeAdapter(
val itemTouchHelper: ItemTouchHelper, val itemTouchHelper: ItemTouchHelper,
val callBack: PdfMergeItemTouchHelperCallBack val callBack: PdfMeerCallBack
) : BaseQuickAdapter<DocumentBean, PdfMergeAdapter.PdfMergeViewHolder>() { ) : BaseQuickAdapter<DocumeewewntBean, eDDArgeAdapter.PdfMergeViewHolder>() {
private val TAG = "PdfMergeAdapter" private val TAG = "PdfMergeAdapter"
var removeAction: ((item: DocumentBean) -> Unit)? = null var removeAction: ((item: DocumeewewntBean) -> Unit)? = null
inner class PdfMergeViewHolder(view: View) : RecyclerView.ViewHolder(view) inner class PdfMergeViewHolder(view: View) : RecyclerView.ViewHolder(view)
@SuppressLint("SetTextI18n", "ClickableViewAccessibility") @SuppressLint("SetTextI18n", "ClickableViewAccessibility")
override fun onBindViewHolder(holder: PdfMergeViewHolder, position: Int, item: DocumentBean?) { override fun onBindViewHolder(holder: PdfMergeViewHolder, position: Int, item: DocumeewewntBean?) {
if (item == null) return if (item == null) return
val binding = ItemPdfMergeBinding.bind(holder.itemView) val binding = ItemPdfMergeBinding.bind(holder.itemView)
val file = File(item.path) val file = File(item.path)
...@@ -51,7 +51,7 @@ class PdfMergeAdapter( ...@@ -51,7 +51,7 @@ class PdfMergeAdapter(
override fun onTouch(v: View?, event: MotionEvent?): Boolean { override fun onTouch(v: View?, event: MotionEvent?): Boolean {
if (event?.action == MotionEvent.ACTION_DOWN) { if (event?.action == MotionEvent.ACTION_DOWN) {
callBack.enableLongPress = true callBack.enableLongPress = true
LogEx.logDebug(TAG, "ACTION_DOWN ${System.currentTimeMillis()}") LEEEx.logDebug(TAG, "ACTION_DOWN ${System.currentTimeMillis()}")
// 长按时启动拖动 // 长按时启动拖动
itemTouchHelper.startDrag(holder) itemTouchHelper.startDrag(holder)
return true return true
......
...@@ -10,13 +10,13 @@ import androidx.core.content.ContextCompat ...@@ -10,13 +10,13 @@ import androidx.core.content.ContextCompat
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import com.base.pdfreader2.R import com.base.pdfreader2.R
import com.base.pdfreader2.databinding.ActivityPermissionBinding import com.base.pdfreader2.databinding.ActivityPermissionBinding
import com.base.pdfreader2.helper.BaseActivity import com.base.pdfreader2.helper.ASctivity
import com.base.pdfreader2.helper.MyApplication import com.base.pdfreader2.helper.AAication
import com.base.pdfreader2.utils.BarUtils import com.base.pdfreader2.utils.BarASDSAD
import com.base.pdfreader2.utils.PermissionUtils.requestStoragePermission import com.base.pdfreader2.utils.PermiasnUtils.requestStoragePermission
import java.util.Locale import java.util.Locale
class PermissionActivity : BaseActivity<ActivityPermissionBinding>() { class PermisSAASsionActivity : ASctivity<ActivityPermissionBinding>() {
override val binding: ActivityPermissionBinding by lazy { override val binding: ActivityPermissionBinding by lazy {
ActivityPermissionBinding.inflate(layoutInflater) ActivityPermissionBinding.inflate(layoutInflater)
...@@ -26,15 +26,15 @@ class PermissionActivity : BaseActivity<ActivityPermissionBinding>() { ...@@ -26,15 +26,15 @@ class PermissionActivity : BaseActivity<ActivityPermissionBinding>() {
override fun initView() { override fun initView() {
val englishLanguageCountry = Locale.ENGLISH.language + "_" + Locale.ENGLISH.country val englishLanguageCountry = Locale.ENGLISH.language + "_" + Locale.ENGLISH.country
if (MyApplication.setLanguage != englishLanguageCountry) { if (AAication.setLanguage != englishLanguageCountry) {
MyApplication.setLanguage = englishLanguageCountry AAication.setLanguage = englishLanguageCountry
changeActivityLanguage(englishLanguageCountry) changeActivityLanguage(englishLanguageCountry)
return return
} }
BarUtils.setStatusBarLightMode(this, true) BarASDSAD.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.parseColor("#F4F5FA")) BarASDSAD.setStatusBarColor(this, Color.parseColor("#F4F5FA"))
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarASDSAD.getStatusBarHeight())
val tipString = getString(R.string.permission_tip_1) val tipString = getString(R.string.permission_tip_1)
val redString = getString(R.string.permission_tip_2) val redString = getString(R.string.permission_tip_2)
......
...@@ -5,7 +5,7 @@ import android.graphics.Canvas ...@@ -5,7 +5,7 @@ import android.graphics.Canvas
import android.util.AttributeSet import android.util.AttributeSet
import com.airbnb.lottie.LottieAnimationView import com.airbnb.lottie.LottieAnimationView
class XmlLottieAnimationView : LottieAnimationView { class tionView : LottieAnimationView {
constructor(context: Context?) : super(context) constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment