Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fiveworld
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_fiveworld
Commits
32333d2a
Commit
32333d2a
authored
Oct 15, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用名称修改
parent
7974d139
Changes
50
Show whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
485 additions
and
757 deletions
+485
-757
022fa15081334ca42f45a0482fb20d2f.bin
...ry/build/.transforms/022fa15081334ca42f45a0482fb20d2f.bin
+0
-1
classes.dex
...orms/022fa15081334ca42f45a0482fb20d2f/classes/classes.dex
+0
-0
merge-state
...termediates/incremental/debug-mergeNativeLibs/merge-state
+0
-0
merger.xml
...ermediates/incremental/mergeDebugJniLibFolders/merger.xml
+1
-1
merger.xml
...ld/intermediates/incremental/mergeDebugShaders/merger.xml
+1
-1
merger.xml
...d/intermediates/incremental/packageDebugAssets/merger.xml
+1
-1
compile-file-map.properties
...emental/packageDebugResources/compile-file-map.properties
+1
-1
merger.xml
...ntermediates/incremental/packageDebugResources/merger.xml
+2
-2
manifest-merger-blame-debug-report.txt
...e_blame_file/debug/manifest-merger-blame-debug-report.txt
+2
-2
manifest-merger-debug-report.txt
...brary/build/outputs/logs/manifest-merger-debug-report.txt
+18
-18
build.gradle
app/build.gradle
+1
-3
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-3
MintsApplication.java
app/src/main/java/com/mints/fiveworld/MintsApplication.java
+2
-2
DeviceInfo.kt
app/src/main/java/com/mints/fiveworld/common/DeviceInfo.kt
+98
-94
AlarmManager.java
...main/java/com/mints/fiveworld/keepalive/AlarmManager.java
+7
-7
OutAppRouter.kt
...c/main/java/com/mints/fiveworld/keepalive/OutAppRouter.kt
+5
-5
AntiAuditManager.kt
...m/mints/fiveworld/keepalive/appswitch/AntiAuditManager.kt
+2
-1
TrackManager.java
...c/main/java/com/mints/fiveworld/manager/TrackManager.java
+6
-0
WifiDataManager.kt
.../java/com/mints/fiveworld/manager/wifi/WifiDataManager.kt
+86
-138
MainPresenter.kt
.../java/com/mints/fiveworld/mvp/presenters/MainPresenter.kt
+1
-0
SplashPresenter.kt
...ava/com/mints/fiveworld/mvp/presenters/SplashPresenter.kt
+1
-0
TrackPresenter.java
...va/com/mints/fiveworld/mvp/presenters/TrackPresenter.java
+1
-1
OkHttpInterceptor.java
.../main/java/com/mints/fiveworld/net/OkHttpInterceptor.java
+3
-0
AboutusActivity.kt
.../java/com/mints/fiveworld/ui/activitys/AboutusActivity.kt
+4
-1
MainActivity.kt
...ain/java/com/mints/fiveworld/ui/activitys/MainActivity.kt
+1
-1
WebActivity.kt
...main/java/com/mints/fiveworld/ui/activitys/WebActivity.kt
+3
-0
ApkActivity.kt
...com/mints/fiveworld/ui/activitys/keepalive/ApkActivity.kt
+3
-3
TriggerActivity.kt
...mints/fiveworld/ui/activitys/keepalive/TriggerActivity.kt
+3
-3
Utils.java
app/src/main/java/com/mints/fiveworld/utils/Utils.java
+4
-2
WorldConstants.kt
...ain/java/com/mints/mingce/world/content/WorldConstants.kt
+2
-2
WorldContext.kt
.../main/java/com/mints/mingce/world/content/WorldContext.kt
+3
-3
WorldEvents.kt
...c/main/java/com/mints/mingce/world/content/WorldEvents.kt
+2
-2
WorldObserver.kt
...main/java/com/mints/mingce/world/content/WorldObserver.kt
+56
-56
AbstractAbs.java
...ain/java/com/mints/mingce/world/settings/AbstractAbs.java
+1
-1
WorldKeys.kt
...rc/main/java/com/mints/mingce/world/settings/WorldKeys.kt
+2
-2
WorldSettings.kt
...ain/java/com/mints/mingce/world/settings/WorldSettings.kt
+6
-6
WorldUtils.kt
app/src/main/java/com/mints/mingce/world/utils/WorldUtils.kt
+3
-3
DimenUtils.java
...c/main/java/com/mints/mingce/world/widget/DimenUtils.java
+1
-1
SlideWorldView.java
...in/java/com/mints/mingce/world/widget/SlideWorldView.java
+3
-3
WorldActivity.kt
.../main/java/com/mints/mingce/world/widget/WorldActivity.kt
+13
-13
WorldActivity2.kt
...main/java/com/mints/mingce/world/widget/WorldActivity2.kt
+5
-0
WorldActivity3.kt
...main/java/com/mints/mingce/world/widget/WorldActivity3.kt
+5
-0
WorldComponent.kt
...main/java/com/mints/mingce/world/widget/WorldComponent.kt
+54
-56
WorldRootLayout.kt
...ain/java/com/mints/mingce/world/widget/WorldRootLayout.kt
+3
-3
ScreenLockerActivity2.kt
...ain/java/com/mints/screen/locker/ScreenLockerActivity2.kt
+0
-3
ScreenLockerActivity3.kt
...ain/java/com/mints/screen/locker/ScreenLockerActivity3.kt
+0
-3
ScreenLockerAdConfig.kt
...java/com/mints/screen/locker/core/ScreenLockerAdConfig.kt
+0
-5
AdImpressionHandler.kt
...java/com/mints/screen/locker/utils/AdImpressionHandler.kt
+0
-225
activity_aboutus.xml
app/src/main/res/layout/activity_aboutus.xml
+64
-77
activity_world_view.xml
app/src/main/res/layout/activity_world_view.xml
+2
-2
No files found.
animlibrary/build/.transforms/022fa15081334ca42f45a0482fb20d2f.bin
deleted
100644 → 0
View file @
7974d139
o/classes
animlibrary/build/.transforms/022fa15081334ca42f45a0482fb20d2f/classes/classes.dex
deleted
100644 → 0
View file @
7974d139
File deleted
animlibrary/build/intermediates/incremental/debug-mergeNativeLibs/merge-state
View file @
32333d2a
No preview for this file type
animlibrary/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml
View file @
32333d2a
<?xml version="1.0" encoding="utf-8"?>
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\jniLibs"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\debug\jniLibs"
/></dataSet></merger>
\ No newline at end of file
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/jniLibs"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/jniLibs"
/></dataSet></merger>
\ No newline at end of file
animlibrary/build/intermediates/incremental/mergeDebugShaders/merger.xml
View file @
32333d2a
<?xml version="1.0" encoding="utf-8"?>
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\shaders"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\debug\shaders"
/></dataSet></merger>
\ No newline at end of file
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/shaders"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/shaders"
/></dataSet></merger>
\ No newline at end of file
animlibrary/build/intermediates/incremental/packageDebugAssets/merger.xml
View file @
32333d2a
<?xml version="1.0" encoding="utf-8"?>
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\assets"
/><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\build\intermediates\shader_assets\debug\out"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\debug\assets"
/></dataSet></merger>
\ No newline at end of file
<merger
version=
"3"
><dataSet
config=
"main"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/assets"
/><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/intermediates/shader_assets/debug/out"
/></dataSet><dataSet
config=
"debug"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/assets"
/></dataSet></merger>
\ No newline at end of file
animlibrary/build/intermediates/incremental/packageDebugResources/compile-file-map.properties
View file @
32333d2a
#
Wed Oct 13 18:59:07
CST 2021
#
Thu Oct 14 14:57:01
CST 2021
animlibrary/build/intermediates/incremental/packageDebugResources/merger.xml
View file @
32333d2a
<?xml version="1.0" encoding="utf-8"?>
<merger
version=
"3"
><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"main$Generated"
generated=
"true"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\res"
/><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\build\generated\res\rs\debug"
/><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\build\generated\res\resValues\debug"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"main"
generated-set=
"main$Generated"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\res"
><file
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\res\values\
attrs.xml"
qualifiers=
""
><declare-styleable
name=
"AnimatedSvgView"
>
<merger
version=
"3"
><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"main$Generated"
generated=
"true"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res"
/><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/rs/debug"
/><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/resValues/debug"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"main"
generated-set=
"main$Generated"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res"
><file
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res/values/
attrs.xml"
qualifiers=
""
><declare-styleable
name=
"AnimatedSvgView"
>
<attr
format=
"integer"
name=
"animatedSvgImageSizeX"
/>
<attr
format=
"integer"
name=
"animatedSvgImageSizeY"
/>
<attr
format=
"string"
name=
"animatedSvgTraceTime"
/>
...
...
@@ -11,7 +11,7 @@
<attr
format=
"reference"
name=
"animatedSvgTraceResidueColors"
/>
<attr
format=
"integer"
name=
"animatedSvgTraceMarkerLength"
/>
<attr
format=
"reference"
name=
"animatedSvgFillColors"
/>
</declare-styleable></file></source><source
path=
"
D:\android_space\My5GWorld\android_fiveworld\animlibrary\build\generated\res\rs\debug"
/><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\build\generated\res\resValues\debug"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"debug$Generated"
generated=
"true"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\debug\res"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"debug"
generated-set=
"debug$Generated"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\debug\
res"
/></dataSet><mergedItems><configuration
qualifiers=
""
><declare-styleable
name=
"AnimatedSvgView"
>
</declare-styleable></file></source><source
path=
"
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/rs/debug"
/><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/resValues/debug"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"debug$Generated"
generated=
"true"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/res"
/></dataSet><dataSet
aapt-namespace=
"http://schemas.android.com/apk/res-auto"
config=
"debug"
generated-set=
"debug$Generated"
ignore_pattern=
"!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
><source
path=
"/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/
res"
/></dataSet><mergedItems><configuration
qualifiers=
""
><declare-styleable
name=
"AnimatedSvgView"
>
<attr
format=
"integer"
name=
"animatedSvgImageSizeX"
/>
<attr
format=
"integer"
name=
"animatedSvgImageSizeY"
/>
<attr
format=
"string"
name=
"animatedSvgTraceTime"
/>
...
...
animlibrary/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt
View file @
32333d2a
...
...
@@ -4,8 +4,8 @@
4
5 <uses-sdk
6 android:minSdkVersion="14"
6-->
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
6-->
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
7 android:targetSdkVersion="28" />
7-->
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
7-->
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
8
9</manifest>
animlibrary/build/outputs/logs/manifest-merger-debug-report.txt
View file @
32333d2a
-- Merging decision tree log ---
manifest
ADDED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml:1:1-63
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml:1:1-63
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml:1:1-63
ADDED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml:1:1-63
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml:1:1-63
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml:1:1-63
package
ADDED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml:1:11-61
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
ADDED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml:1:11-61
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
xmlns:android
ADDED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml:1:1-63
ADDED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml:1:1-63
uses-sdk
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml reason: use-sdk injection requested
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml reason: use-sdk injection requested
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
android:targetSdkVersion
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
ADDED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
ADDED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
android:minSdkVersion
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
ADDED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
D:\android_space\My5GWorld\android_fiveworld\animlibrary\src\main\
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
ADDED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
INJECTED from
/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/
AndroidManifest.xml
app/build.gradle
View file @
32333d2a
...
...
@@ -124,12 +124,10 @@ android {
productFlavors
{
fiveworld
{}
toutiao
{}
ks_cs
{}
store360
{}
oppo
{}
vivo
{}
huawei
{}
xiaomi
{}
meizu
{}
}
productFlavors
.
all
{
...
...
app/src/main/AndroidManifest.xml
View file @
32333d2a
...
...
@@ -208,7 +208,7 @@
android:theme=
"@style/OutTransparentTheme"
/>
<activity
android:name=
"com.mints.
screen.locker.ScreenLocker
Activity"
android:name=
"com.mints.
mingce.world.widget.World
Activity"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale|density|fontScale|layoutDirection|navigation|uiMode|screenLayout|mcc|mnc"
android:excludeFromRecents=
"true"
android:immersive=
"true"
...
...
@@ -219,7 +219,7 @@
android:theme=
"@style/AppTheme.LockScreen"
/>
<activity
android:name=
"com.mints.
screen.locker.ScreenLocker
Activity2"
android:name=
"com.mints.
mingce.world.widget.World
Activity2"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale|density|fontScale|layoutDirection|navigation|uiMode|screenLayout|mcc|mnc"
android:excludeFromRecents=
"true"
android:immersive=
"true"
...
...
@@ -229,7 +229,7 @@
android:theme=
"@style/AppTheme.LockScreen"
/>
<activity
android:name=
"com.mints.
screen.locker.ScreenLocker
Activity3"
android:name=
"com.mints.
mingce.world.widget.World
Activity3"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale|density|fontScale|layoutDirection|navigation|uiMode|screenLayout|mcc|mnc"
android:excludeFromRecents=
"true"
android:immersive=
"true"
...
...
app/src/main/java/com/mints/fiveworld/MintsApplication.java
View file @
32333d2a
...
...
@@ -65,7 +65,7 @@ import kotlin.jvm.functions.Function1;
import
rx.Scheduler
;
import
rx.schedulers.Schedulers
;
import
com.mints.
screen.locker.core.ScreenLocker
Observer
;
import
com.mints.
mingce.world.content.World
Observer
;
/**
* 描述:Application
...
...
@@ -222,7 +222,7 @@ public class MintsApplication extends BaseApp {
thirdConfig
();
// 锁屏模块初始化
new
ScreenLocker
Observer
(
this
).
start
(
this
);
new
World
Observer
(
this
).
start
(
this
);
CoreAdContext
.
Companion
.
setLockerResumeCallback
(
new
Function1
<
Activity
,
Boolean
>()
{
@Override
...
...
app/src/main/java/com/mints/fiveworld/common/DeviceInfo.kt
View file @
32333d2a
...
...
@@ -379,15 +379,17 @@ class DeviceInfo private constructor() {
*
* @return
*/
val
ssid
:
String
?
val
ssid
:
String
get
()
{
if
(
mContext
==
null
)
{
return
null
}
try
{
val
wifi
=
mContext
!!
.
getSystemService
(
Context
.
WIFI_SERVICE
)
as
WifiManager
val
info
=
wifi
.
connectionInfo
return
info
.
ssid
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
return
""
}
}
/**
...
...
@@ -403,15 +405,17 @@ class DeviceInfo private constructor() {
*
* @return
*/
val
bssid
:
String
?
val
bssid
:
String
get
()
{
if
(
mContext
==
null
)
{
return
null
}
try
{
val
wifi
=
mContext
!!
.
getSystemService
(
Context
.
WIFI_SERVICE
)
as
WifiManager
val
info
=
wifi
.
connectionInfo
return
info
.
bssid
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
return
""
}
}
/**
...
...
app/src/main/java/com/mints/fiveworld/keepalive/AlarmManager.java
View file @
32333d2a
...
...
@@ -30,7 +30,7 @@ import com.mints.fiveworld.utils.SystemUtils;
import
com.mints.fiveworld.utils.Utils
;
import
com.mints.fiveworld.utils.WifiUtils
;
import
com.mints.fiveworld.utils.IntentUtils
;
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
;
import
com.mints.
mingce.world.utils.World
Utils
;
import
com.utils.BaseUtils
;
import
net.app.AbsActivityLifecycleCallbacks
;
...
...
@@ -372,7 +372,7 @@ public class AlarmManager implements Handler.Callback {
long
userTime
=
mSettings
.
readLong
(
KEY_COOL_USER_ACTION_TIME
,
0L
);
if
(
userTime
==
0
)
{
// 记录第一次横屏的时间
if
(
ScreenLocker
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
if
(
World
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
userTime
=
System
.
currentTimeMillis
();
mSettings
.
writeLong
(
KEY_COOL_USER_ACTION_TIME
,
userTime
);
// LogUtil.d(TAG, "***横屏场景*** -> 第一次触发横屏,记录当前触发时间戳:" + userTime);
...
...
@@ -398,7 +398,7 @@ public class AlarmManager implements Handler.Callback {
}
}
else
{
// 20分钟之内有切换过竖屏,重置时间
if
(!
ScreenLocker
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
if
(!
World
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
// LogUtil.d(TAG, "***横屏场景*** -> " + APP_OUT_COOL_MINTER + "分钟之内有切到竖屏,重置时间");
mSettings
.
writeLong
(
KEY_COOL_USER_ACTION_TIME
,
0L
);
}
else
{
...
...
@@ -470,7 +470,7 @@ public class AlarmManager implements Handler.Callback {
if
(
WifiDataManager
.
INSTANCE
.
getTiming
())
{
// 锁屏在前台时,不弹出应用外广告
if
(!
ScreenLocker
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
// 息屏
if
(!
World
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
// 息屏
||
ForegroundOrBackground
.
isScreenForeground
()
// 是否在锁屏页上方
)
{
UmengManager
.
INSTANCE
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_OUT_TIME10_LOCK
.
name
());
...
...
@@ -478,11 +478,11 @@ public class AlarmManager implements Handler.Callback {
AdReportManager
.
INSTANCE
.
eventScene
(
ForegroundOrBackground
.
isForeground2
()
?
AdReportManager
.
INNER_IN
:
AdReportManager
.
INNER_OUT
,
System
.
currentTimeMillis
(),
Constant
.
CARRIER_OUT_TEN_TIME
,
" 是否息屏="
+
ScreenLocker
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" 是否息屏="
+
World
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" 是否在锁屏页上方="
+
ForegroundOrBackground
.
isScreenForeground
()
,
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
AdReportManager
.
ERROR_CODE_FOREGROUND
,
"应用锁屏时,不弹出应用外广告"
);
LogUtil
.
d
(
TAG
,
"应用在锁屏时 isScreenOn="
+
ScreenLocker
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
+
LogUtil
.
d
(
TAG
,
"应用在锁屏时 isScreenOn="
+
World
Utils
.
INSTANCE
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" isScreenActivityResume="
+
ForegroundOrBackground
.
isScreenForeground
());
return
false
;
}
...
...
@@ -565,7 +565,7 @@ public class AlarmManager implements Handler.Callback {
}
// 横屏
if
(
ScreenLocker
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
if
(
World
Utils
.
INSTANCE
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
UmengManager
.
INSTANCE
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_OUT_TIME10_HORIZONTALSCREEN
.
name
());
AdReportManager
.
INSTANCE
.
eventScene
(
...
...
app/src/main/java/com/mints/fiveworld/keepalive/OutAppRouter.kt
View file @
32333d2a
...
...
@@ -17,7 +17,7 @@ import com.mints.fiveworld.utils.ForegroundOrBackground
import
com.mints.fiveworld.utils.LogUtil
import
com.mints.fiveworld.utils.Utils
import
com.mints.fiveworld.utils.IntentUtils
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
import
com.mints.
mingce.world.utils.World
Utils
/**
*
...
...
@@ -205,7 +205,7 @@ object OutAppRouter {
fun
canPopActivity
(
carrier
:
String
,
remark
:
String
):
Boolean
{
// 锁屏在前台时,不弹出应用外广告
if
(!
ScreenLocker
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
// 息屏
if
(!
World
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
// 息屏
||
ForegroundOrBackground
.
isScreenForeground
()
// 是否在锁屏页上方
)
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_LOCK
.
name
)
...
...
@@ -213,7 +213,7 @@ object OutAppRouter {
if
(
ForegroundOrBackground
.
isForeground2
())
AdReportManager
.
INNER_IN
else
AdReportManager
.
INNER_OUT
,
System
.
currentTimeMillis
(),
carrier
,
" 是否息屏="
+
ScreenLocker
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" 是否息屏="
+
World
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" 是否是否在锁屏页上方="
+
ForegroundOrBackground
.
isScreenForeground
(),
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
AdReportManager
.
ERROR_CODE_FOREGROUND
,
...
...
@@ -221,7 +221,7 @@ object OutAppRouter {
)
LogUtil
.
d
(
TAG
,
"应用在锁屏时 isScreenOn="
+
ScreenLocker
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
+
"应用在锁屏时 isScreenOn="
+
World
Utils
.
isScreenOn
(
MintsApplication
.
getContext
())
+
" isScreenActivityResume="
+
ForegroundOrBackground
.
isScreenForeground
()
)
return
false
...
...
@@ -296,7 +296,7 @@ object OutAppRouter {
}
// 横屏
if
(
ScreenLocker
Utils
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
if
(
World
Utils
.
isHorizontalScreen
(
MintsApplication
.
getContext
()))
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_HORIZONTALSCREEN
.
name
)
AdReportManager
.
eventScene
(
if
(
ForegroundOrBackground
.
isForeground2
())
AdReportManager
.
INNER_IN
else
AdReportManager
.
INNER_OUT
,
...
...
app/src/main/java/com/mints/fiveworld/keepalive/appswitch/AntiAuditManager.kt
View file @
32333d2a
...
...
@@ -29,10 +29,11 @@ class AntiAuditManager private constructor() {
const
val
TODAY_INSTALL_APK_COUNT
=
"TODAY_INSTALL_APK_COUNT"
// 安装个数
const
val
TODAY_INSTALL_SUM_COUNT
=
"TODAY_INSTALL_SUM_COUNT"
// 安装总个数(阈值)
// senceType 0-vpn,1-反策略,2-协议
// senceType 0-vpn,1-反策略,2-协议
3-意见反馈
const
val
SENCE_VPN
=
"0"
// vpn
const
val
SENCE_FAZHI
=
"1"
// 阈值
const
val
SENCE_AGREEMENT
=
"2"
// 协议
const
val
SENCE_CALLAPP
=
"3"
// 意见反馈
val
instance
:
AntiAuditManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
AntiAuditManager
()
...
...
app/src/main/java/com/mints/fiveworld/manager/TrackManager.java
View file @
32333d2a
...
...
@@ -44,6 +44,12 @@ public class TrackManager {
}
}
public
void
saveTerminalInfo
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
saveTerminalInfo
();
}
}
public
void
cmtGroMoreInfo
(
HashMap
<
String
,
Object
>
vo
)
{
if
(
trackPresenter
!=
null
&&
!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
getUserID
()))
{
trackPresenter
.
cmtGroMoreInfo
(
vo
);
...
...
app/src/main/java/com/mints/fiveworld/manager/wifi/WifiDataManager.kt
View file @
32333d2a
...
...
@@ -166,13 +166,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
PHONE_OFF_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -192,13 +192,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 场景开关=${
sp
.
getBoolean
(
PHONE_OFF_SWITCH
,
tru
e
fals
e
)
}
当天弹出次数
=
$
{
sp
.
getInt
(
PHONE_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -222,13 +222,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 场景开关=${
sp
.
getBoolean
(
PHONE_OFF_SWITCH
,
tru
e
fals
e
)
}
当天弹出次数
=
$
{
sp
.
getInt
(
PHONE_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -274,13 +274,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_ON_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -299,13 +299,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_ON_SWITCH
,
tru
e
fals
e
)
}
当天弹出次数
=
$
{
sp
.
getInt
(
WIFI_ON
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -316,7 +316,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
WIFI_ON_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
WIFI_ON_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -331,13 +331,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_ON_SWITCH
,
tru
e
fals
e
)
}
当天弹出次数
=
$
{
sp
.
getInt
(
WIFI_ON
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -377,13 +377,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_OFF_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -402,13 +402,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_OFF_SWITCH
,
tru
e
fals
e
)
}
wifiOff
->
wifiOff
次数
=
$
{
sp
.
getInt
(
WIFI_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -419,7 +419,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
WIFI_OFF_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
WIFI_OFF_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -434,13 +434,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
WIFI_OFF_SWITCH
,
tru
e
fals
e
)
}
wifiOff
->
wifiOff
次数
=
$
{
sp
.
getInt
(
WIFI_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -473,58 +473,6 @@ object WifiDataManager {
return
true
}
/**
* 是否显示充电连接广告
*/
// fun getBatteryOn(): Boolean {
// LogUtil.d(
// TAG,
// "batteryOn -> 充电连接 -> isBlackOrClose()=${isBlackOrClose()} !sp.getBoolean(BATTERY_ON_SWITCH, true)=${
// !sp.getBoolean(
// BATTERY_ON_SWITCH,
// true
// )
// }"
// )
//
// AdReportManager.eventScene(
// AdReportManager.INNER_OUT, System.currentTimeMillis(), Constant.CARRIER_CHARGE_ON,
// "", AdReportManager.EVENT_TYPE_SCENCE_BEGIN
// )
//
// // 总开关关闭 return
// if (isBlackOrClose() || !sp.getBoolean(BATTERY_ON_SWITCH, true)) {
// AdReportManager.eventScene(
// AdReportManager.INNER_OUT,
// System.currentTimeMillis(),
// Constant.CARRIER_CHARGE_ON,
// "batteryOn -> 充电连接 -> isBlackOrClose()=${isBlackOrClose()} !sp.getBoolean(BATTERY_ON_SWITCH, true)=${
// !sp.getBoolean(
// BATTERY_ON_SWITCH,
// true
// )
// } batteryOn -> batteryOn次数=${sp.getInt(BATTERY_ON, 0)}",AdReportManager.EVENT_TYPE_SCENCE_CLOSE
// ,AdReportManager.ERROR_CODE_OPEN,"总开关/场景开关")
//
// return false
// }
//
// val batteryOn = sp.getInt(BATTERY_ON, 0)
//
// // 次数超过限制 return
// if(batteryOn>=BATTERY_ON_TIMES){
// AdReportManager.eventScene(AdReportManager.INNER_OUT,System.currentTimeMillis(),Constant.CARRIER_CHARGE_ON,
// "batteryOn -> batteryOn次数=${sp.getInt(BATTERY_ON, 0)}",AdReportManager.EVENT_TYPE_SCENCE_CLOSE
// ,AdReportManager.ERROR_CODE_COUNT,"超过次数")
// return false
// }
//
// LogUtil.d(TAG, "batteryOn -> batteryOn次数=${batteryOn}")
// if (batteryOn < BATTERY_ON_TIMES) {
// return true
// }
// return false
// }
/**
* 是否显示断电连接广告
...
...
@@ -536,13 +484,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
BATTERY_OFF_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -556,13 +504,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
BATTERY_OFF_SWITCH
,
tru
e
fals
e
)
}
batteryOff
->
batteryOff
次数
=
$
{
sp
.
getInt
(
BATTERY_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_BEGIN
...
...
@@ -571,7 +519,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
BATTERY_OFF_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
BATTERY_OFF_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -586,13 +534,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
BATTERY_OFF_SWITCH
,
tru
e
fals
e
)
}
batteryOff
->
batteryOff
次数
=
$
{
sp
.
getInt
(
BATTERY_OFF
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_BEGIN
...
...
@@ -633,13 +581,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
LOCK_ON_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -658,13 +606,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
LOCK_ON_SWITCH
,
tru
e
fals
e
)
}
lockOn
->
lockOn
次数
=
$
{
sp
.
getInt
(
LOCK_ON
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -675,7 +623,7 @@ object WifiDataManager {
}
// 开关关闭 return
if
(!
sp
.
getBoolean
(
LOCK_ON_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
LOCK_ON_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -690,13 +638,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
LOCK_ON_SWITCH
,
tru
e
fals
e
)
}
lockOn
->
lockOn
次数
=
$
{
sp
.
getInt
(
LOCK_ON
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -739,13 +687,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
INSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -764,13 +712,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
INSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
install
->
install
次数
=
$
{
sp
.
getInt
(
INSTALL_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -781,7 +729,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
INSTALL_APK_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
INSTALL_APK_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -795,13 +743,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
INSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
install
->
install
次数
=
$
{
sp
.
getInt
(
INSTALL_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -844,13 +792,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UNINSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -869,13 +817,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UNINSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
uninstall
->
uninstall
次数
=
$
{
sp
.
getInt
(
UNINSTALL_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -886,7 +834,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
UNINSTALL_APK_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
UNINSTALL_APK_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -901,13 +849,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UNINSTALL_APK_SWITCH
,
tru
e
fals
e
)
}
uninstall
->
uninstall
次数
=
$
{
sp
.
getInt
(
UNINSTALL_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -949,13 +897,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UPDATE_APK_SWITCH
,
tru
e
fals
e
)
}
"
)
...
...
@@ -974,13 +922,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UPDATE_APK_SWITCH
,
tru
e
fals
e
)
}
update
->
update
次数
=
$
{
sp
.
getInt
(
UPDATE_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -991,7 +939,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
UPDATE_APK_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
UPDATE_APK_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1005,13 +953,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${
sp
.
getBoolean
(
UPDATE_APK_SWITCH
,
tru
e
fals
e
)
}
update
->
update
次数
=
$
{
sp
.
getInt
(
UPDATE_APK
,
0
)}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1053,7 +1001,7 @@ object WifiDataManager {
"timing -> 定时 -> 是否命中黑名单=${isBlackOrClose()} 当前场景开关=${
sp
.
getBoolean
(
TIMING_SWITCH
,
tru
e
fals
e
)
}
timing
->
定时次数
=
$
{
sp
.
getInt
(
TIMING
,
0
)}
定时阈值
=
" + TIMING_TIMES
)
...
...
@@ -1067,10 +1015,10 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${sp.getBoolean(TIMING_SWITCH,
tru
e)}"
+
" 当前场景开关=${sp.getBoolean(TIMING_SWITCH,
fals
e)}"
+
" timing -> 当天已弹出定时次数=${sp.getInt(TIMING, 0)}"
+
"定时阈值="
+
TIMING_TIMES
,
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1081,7 +1029,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
TIMING_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
TIMING_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1095,10 +1043,10 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前场景开关=${sp.getBoolean(TIMING_SWITCH,
tru
e)}"
+
" 当前场景开关=${sp.getBoolean(TIMING_SWITCH,
fals
e)}"
+
" timing -> 当天已弹出定时次数=${sp.getInt(TIMING, 0)}"
+
" 定时阈值="
+
TIMING_TIMES
,
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1136,7 +1084,7 @@ object WifiDataManager {
LogUtil
.
d
(
TAG
,
"lowPower -> 低电量 -> 是否命中黑名单=${isBlackOrClose()} 当前场景开关=${
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
tru
e
)
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
fals
e
)
}
"
)
...
...
@@ -1154,13 +1102,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1171,7 +1119,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1185,13 +1133,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
LOW_POWER_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1231,7 +1179,7 @@ object WifiDataManager {
LogUtil
.
d
(
TAG
,
"weakSignal -> 弱网环境 -> 是否命中黑名单=${isBlackOrClose()} 当前场景开关=${
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
tru
e
)
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
fals
e
)
}
"
)
...
...
@@ -1249,13 +1197,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1266,7 +1214,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1280,13 +1228,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
WEAK_SIGNAL_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1327,7 +1275,7 @@ object WifiDataManager {
LogUtil
.
d
(
TAG
,
"cool -> 横屏降温 -> 是否命中黑名单=${isBlackOrClose()} 当前场景开关=${
sp
.
getBoolean
(
COOL_SWITCH
,
tru
e
)
sp
.
getBoolean
(
COOL_SWITCH
,
fals
e
)
}
"
)
...
...
@@ -1345,13 +1293,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
COOL_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1362,7 +1310,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
COOL_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
COOL_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1376,13 +1324,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
COOL_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1422,7 +1370,7 @@ object WifiDataManager {
LogUtil
.
d
(
TAG
,
"lowStorage -> 存储空间不足 -> 是否命中黑名单=${AntiAuditManager.instance.isBlack()} 当前场景开关=${
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
tru
e
)
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
fals
e
)
}
"
)
...
...
@@ -1440,13 +1388,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1457,7 +1405,7 @@ object WifiDataManager {
}
// 总开关关闭 return
if
(!
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
tru
e
))
{
if
(!
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
fals
e
))
{
// 场景开关关闭
UmengManager
.
onEventArgs
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_SWITCH_CLOSE
.
name
,
...
...
@@ -1471,13 +1419,13 @@ object WifiDataManager {
" 总开关=${
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
fals
e
)
}
" +
" 当前开关=${
!
sp
.
getBoolean
(
LOW_STORAGE_SWITCH
,
tru
e
fals
e
)
}
",
AdReportManager
.
EVENT_TYPE_SCENCE_CLOSE
,
...
...
@@ -1775,7 +1723,7 @@ object WifiDataManager {
}
// 场景总开关
val
allSwitch
=
sp
.
getBoolean
(
APP_OUT_SWITCH
,
tru
e
)
val
allSwitch
=
sp
.
getBoolean
(
APP_OUT_SWITCH
,
fals
e
)
if
(!
allSwitch
)
{
LogUtil
.
d
(
TAG
,
"是否命中黑名单 -> 应用外总开关=${allSwitch} , isBlack=${isBlack}"
)
...
...
app/src/main/java/com/mints/fiveworld/mvp/presenters/MainPresenter.kt
View file @
32333d2a
...
...
@@ -72,6 +72,7 @@ class MainPresenter : BasePresenter<MainView>() {
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
...
...
app/src/main/java/com/mints/fiveworld/mvp/presenters/SplashPresenter.kt
View file @
32333d2a
...
...
@@ -103,6 +103,7 @@ class SplashPresenter : BasePresenter<SplashView>() {
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
vo
[
"device"
]
=
DeviceUuidFactory
().
deviceUuid
.
toString
()
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
...
...
app/src/main/java/com/mints/fiveworld/mvp/presenters/TrackPresenter.java
View file @
32333d2a
...
...
@@ -21,6 +21,7 @@ import com.mints.fiveworld.mvp.model.OutAppConfig;
import
com.mints.fiveworld.mvp.model.UserBean
;
import
com.mints.fiveworld.mvp.model.WifiActiveBean
;
import
com.mints.fiveworld.utils.DeviceUuidFactory
;
import
com.mints.fiveworld.utils.WifiUtils
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
...
...
@@ -76,7 +77,6 @@ public class TrackPresenter extends BaseTrackPresenter {
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
vo
.
put
(
"device"
,
new
DeviceUuidFactory
().
getDeviceUuid
().
toString
());
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
...
...
app/src/main/java/com/mints/fiveworld/net/OkHttpInterceptor.java
View file @
32333d2a
...
...
@@ -6,6 +6,7 @@ import com.bytedance.hume.readapk.HumeSDK;
import
com.google.gson.Gson
;
import
com.mints.fiveworld.BuildConfig
;
import
com.mints.fiveworld.MintsApplication
;
import
com.mints.fiveworld.common.DeviceInfo
;
import
com.mints.fiveworld.manager.TrackManager
;
import
com.mints.fiveworld.manager.UserManager
;
import
com.mints.fiveworld.mvp.model.AppRequest
;
...
...
@@ -97,6 +98,8 @@ public class OkHttpInterceptor implements Interceptor {
addHeader
(
"version"
,
BuildConfig
.
VERSION_NAME
).
addHeader
(
"token"
,
tokenID
).
addHeader
(
"channel"
,
channel
).
addHeader
(
"wifiId"
,
DeviceInfo
.
Companion
.
getInstance
().
getBssid
()).
addHeader
(
"wifiName"
,
DeviceInfo
.
Companion
.
getInstance
().
getSsid
()).
addHeader
(
"new-session"
,
MD5
.
GetMD5Code
(
String
.
valueOf
(
time
))).
addHeader
(
"last-session"
,
Base64
.
encode
(
String
.
valueOf
(
time
).
getBytes
(
"UTF-8"
))).
build
();
...
...
app/src/main/java/com/mints/fiveworld/ui/activitys/AboutusActivity.kt
View file @
32333d2a
...
...
@@ -8,6 +8,8 @@ import com.mints.fiveworld.BuildConfig
import
com.mints.fiveworld.MintsApplication
import
com.mints.fiveworld.R
import
com.mints.fiveworld.common.Constant
import
com.mints.fiveworld.keepalive.appswitch.AntiAuditManager
import
com.mints.fiveworld.manager.AppPreferencesManager
import
com.mints.fiveworld.manager.wifi.WifiDataManager
import
com.mints.fiveworld.ui.activitys.base.BaseActivity
import
com.mints.fiveworld.utils.ToastUtil
...
...
@@ -47,7 +49,8 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
tvAboutasVersion
.
setOnLongClickListener
{
ToastUtil
.
showLong
(
MintsApplication
.
getContext
(),
"黑名单:true不弹,false弹"
+
WifiDataManager
.
isBlackOrClose
()
"黑名单:"
+
AntiAuditManager
.
instance
.
isBlack
()+
"\n 应用外总开关:"
+
AppPreferencesManager
.
get
().
getBoolean
(
WifiDataManager
.
APP_OUT_SWITCH
,
false
)
)
true
}
...
...
app/src/main/java/com/mints/fiveworld/ui/activitys/MainActivity.kt
View file @
32333d2a
...
...
@@ -55,7 +55,7 @@ class MainActivity : BaseActivity(), MainView {
}
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
))
{
mainPresenter
.
getNetWorkIp
()
TrackManager
.
getInstance
().
saveTerminalInfo
()
}
showPowerDialog
()
...
...
app/src/main/java/com/mints/fiveworld/ui/activitys/WebActivity.kt
View file @
32333d2a
...
...
@@ -105,6 +105,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
isCmtBlackAgreementFlag
=
true
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
AntiAuditManager
.
instance
.
setBlack
(
true
);
}
}
}
...
...
@@ -139,6 +140,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
if
(
bottomFlag
&&
registerFlag
)
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
AntiAuditManager
.
instance
.
setBlack
(
true
);
}
}
else
if
(
url
.
equals
(
Constant
.
REGISTER_URL
))
{
AppPreferencesManager
.
get
().
put
(
Constant
.
REGISTER_FLAG
,
true
)
...
...
@@ -147,6 +149,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
if
(
bottomFlag
&&
privacyFlag
)
{
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_BLACK_FOR_AGREEMENT
.
name
)
AntiAuditManager
.
instance
.
cmtBlackToServier
(
AntiAuditManager
.
SENCE_AGREEMENT
)
AntiAuditManager
.
instance
.
setBlack
(
true
);
}
}
}
...
...
app/src/main/java/com/mints/fiveworld/ui/activitys/keepalive/ApkActivity.kt
View file @
32333d2a
...
...
@@ -23,7 +23,7 @@ import com.mints.fiveworld.utils.AppUtil
import
com.mints.fiveworld.utils.LogUtil
import
com.mints.fiveworld.utils.Utils
import
com.mints.library.utils.GlideUtils
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
import
com.mints.
mingce.world.utils.World
Utils
import
kotlinx.android.synthetic.main.activity_apk.*
import
java.util.*
...
...
@@ -233,10 +233,10 @@ class ApkActivity : BaseOutActivity() {
override
fun
onFinish
()
{
if
(!
this
@ApkActivity
.
isFinishing
)
{
if
(!
ScreenLocker
Utils
.
isScreenOn
(
MintsApplication
.
getContext
()))
{
if
(!
World
Utils
.
isScreenOn
(
MintsApplication
.
getContext
()))
{
LogUtil
.
d
(
TAG
,
"是否亮屏=${
ScreenLocker
Utils.isScreenOn(MintsApplication.getContext())}"
"是否亮屏=${
World
Utils.isScreenOn(MintsApplication.getContext())}"
)
return
}
...
...
app/src/main/java/com/mints/fiveworld/ui/activitys/keepalive/TriggerActivity.kt
View file @
32333d2a
...
...
@@ -30,7 +30,7 @@ import com.mints.fiveworld.utils.SpanUtils
import
com.mints.fiveworld.utils.TimeRender
import
com.mints.fiveworld.utils.Utils
import
com.mints.library.utils.GlideUtils
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
import
com.mints.
mingce.world.utils.World
Utils
import
kotlinx.android.synthetic.main.activity_timing.*
import
kotlin.random.Random
...
...
@@ -262,10 +262,10 @@ class TriggerActivity : BaseOutActivity() {
override
fun
onFinish
()
{
if
(!
this
@TriggerActivity
.
isFinishing
)
{
if
(!
ScreenLocker
Utils
.
isScreenOn
(
MintsApplication
.
getContext
()))
{
if
(!
World
Utils
.
isScreenOn
(
MintsApplication
.
getContext
()))
{
LogUtil
.
d
(
TAG
,
"是否亮屏=${
ScreenLocker
Utils.isScreenOn(MintsApplication.getContext())}"
"是否亮屏=${
World
Utils.isScreenOn(MintsApplication.getContext())}"
)
return
}
...
...
app/src/main/java/com/mints/fiveworld/utils/Utils.java
View file @
32333d2a
...
...
@@ -54,6 +54,7 @@ import com.mints.fiveworld.MintsApplication;
import
com.mints.fiveworld.ad.AdReportManager
;
import
com.mints.fiveworld.common.Constant
;
import
com.mints.fiveworld.keepalive.appswitch.AntiAuditManager
;
import
com.mints.fiveworld.manager.wifi.WifiDataManager
;
import
com.mints.library.utils.CommonUtils
;
import
java.io.File
;
...
...
@@ -253,7 +254,7 @@ public final class Utils {
}
/**
*
是否是vivo或华为
渠道且不是黑名单
*
商店
渠道且不是黑名单
*
* @return true 加载广告
*/
...
...
@@ -266,9 +267,10 @@ public final class Utils {
TextUtils
.
equals
(
"oppo"
,
channel_name
)
||
TextUtils
.
equals
(
"meizu"
,
channel_name
)
||
TextUtils
.
equals
(
"vivo"
,
channel_name
)
||
TextUtils
.
equals
(
"store360"
,
channel_name
)
||
TextUtils
.
equals
(
"huawei"
,
channel_name
)
||
TextUtils
.
equals
(
"xiaomi"
,
channel_name
))
{
if
(
AntiAuditManager
.
Companion
.
getInstance
().
isBlack
())
{
if
(
WifiDataManager
.
INSTANCE
.
isBlackOrClose
())
{
return
false
;
}
}
...
...
app/src/main/java/com/mints/
screen/locker/core/ScreenLocker
Constants.kt
→
app/src/main/java/com/mints/
mingce/world/content/World
Constants.kt
View file @
32333d2a
package
com.mints.
screen.locker.core
package
com.mints.
mingce.world.content
object
ScreenLocker
Constants
{
object
World
Constants
{
const
val
INTENT_KEY_FLAGS
=
"kdd1"
const
val
INTENT_KEY_MARK
=
"kdd2"
...
...
app/src/main/java/com/mints/
screen/locker/core/ScreenLocker
Context.kt
→
app/src/main/java/com/mints/
mingce/world/content/World
Context.kt
View file @
32333d2a
package
com.mints.
screen.locker.core
package
com.mints.
mingce.world.content
import
android.app.Activity
import
java.lang.ref.WeakReference
private
const
val
TAG
=
"
screenlocker
.context"
private
const
val
TAG
=
"
world
.context"
object
ScreenLocker
Context
{
object
World
Context
{
internal
var
canShowScreenLockerWhenScreenOn
=
true
internal
var
lastScreenOffTime
=
0L
...
...
app/src/main/java/com/mints/
screen/locker/core/ScreenLocker
Events.kt
→
app/src/main/java/com/mints/
mingce/world/content/World
Events.kt
View file @
32333d2a
package
com.mints.
screen.locker.core
package
com.mints.
mingce.world.content
import
com.squareup.module.feature.FeatureConstants
internal
object
ScreenLocker
Events
{
internal
object
World
Events
{
private
const
val
BASE
=
867
_0000
const
val
USER_UNLOCKED
=
BASE
+
1
const
val
SCREENLOCKER_UNLOCKED_BY_USER
=
FeatureConstants
.
CUSTOM_UNLOCKED
...
...
app/src/main/java/com/mints/
screen/locker/core/ScreenLocker
Observer.kt
→
app/src/main/java/com/mints/
mingce/world/content/World
Observer.kt
View file @
32333d2a
package
com.mints.
screen.locker.core
package
com.mints.
mingce.world.content
import
android.annotation.SuppressLint
import
android.app.Activity
...
...
@@ -19,10 +19,10 @@ import com.mints.fiveworld.BuildConfig
import
com.mints.fiveworld.ad.AdReportManager
import
com.mints.fiveworld.manager.UmengManager
import
com.mints.fiveworld.manager.wifi.WifiDataManager
import
com.mints.
screen.locker.ScreenLocker
Activity
import
com.mints.
screen.locker.ScreenLocker
Activity3
import
com.mints.
screen.locker.settings.ScreenLocker
Settings
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
import
com.mints.
mingce.world.widget.World
Activity
import
com.mints.
mingce.world.widget.World
Activity3
import
com.mints.
mingce.world.settings.World
Settings
import
com.mints.
mingce.world.utils.World
Utils
import
com.popups.base.UiConstants
import
com.receivers.ACTION_SCREENCHECKER_OFF
import
com.receivers.ACTION_SCREENCHECKER_ON
...
...
@@ -42,9 +42,9 @@ import net.utils.Log
@Suppress
(
"SpellCheckingInspection"
)
private
const
val
TAG
=
"
screenlocker
.core.ob"
private
const
val
TAG
=
"
world
.core.ob"
class
ScreenLocker
Observer
(
private
val
context
:
Context
)
{
class
World
Observer
(
private
val
context
:
Context
)
{
companion
object
{
const
val
useCallback
=
false
...
...
@@ -64,14 +64,14 @@ class ScreenLockerObserver(private val context: Context) {
"startScreenLockerForced() called with: context = [$context], flags = [$flags], thread = ${Thread.currentThread()}"
)
if
(!
ScreenLocker
Settings
.
isEnabled
())
{
if
(!
World
Settings
.
isEnabled
())
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"startScreenLockerForced: NOT ENABLED! ignore!"
)
return
}
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_START_INVOKED
,
World
Constants
.
EVENT_SCREEN_LOCKER_START_INVOKED
,
EventParams
().
apply
{
reason
(
reason
.
toString
())
set
(
"flags"
,
flags
)
...
...
@@ -186,21 +186,21 @@ class ScreenLockerObserver(private val context: Context) {
lockerIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_BROUGHT_TO_FRONT
)
}
lockerIntent
.
putExtra
(
ScreenLocker
Constants
.
INTENT_KEY_FLAGS
,
flags
)
lockerIntent
.
putExtra
(
ScreenLocker
Constants
.
INTENT_KEY_REASON
,
reason
)
lockerIntent
.
putExtra
(
ScreenLocker
Constants
.
INTENT_KEY_MARK
,
System
.
currentTimeMillis
())
lockerIntent
.
putExtra
(
World
Constants
.
INTENT_KEY_FLAGS
,
flags
)
lockerIntent
.
putExtra
(
World
Constants
.
INTENT_KEY_REASON
,
reason
)
lockerIntent
.
putExtra
(
World
Constants
.
INTENT_KEY_MARK
,
System
.
currentTimeMillis
())
return
lockerIntent
}
private
fun
selectCorrectActivity
(
context
:
Context
):
Class
<
out
Activity
>
{
val
lockScreenProtected
=
ScreenLocker
Utils
.
isLockScreenProtected
(
context
)
val
lockScreenProtected
=
World
Utils
.
isLockScreenProtected
(
context
)
UmengManager
.
onEvent
(
AdReportManager
.
EventType
.
EVENT_TYPE_SCENCE_OUT_ACTIVITY_SHOW_SUC_LOCK
.
name
)
val
clazz
=
when
{
shouldShowLockerAfterUserPresent
()
->
ScreenLocker
Activity3
::
class
.
java
lockScreenProtected
->
ScreenLocker
Activity3
::
class
.
java
else
->
ScreenLocker
Activity
::
class
.
java
shouldShowLockerAfterUserPresent
()
->
World
Activity3
::
class
.
java
lockScreenProtected
->
World
Activity3
::
class
.
java
else
->
World
Activity
::
class
.
java
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"selectCorrectActivity() returned: $clazz"
)
...
...
@@ -209,11 +209,11 @@ class ScreenLockerObserver(private val context: Context) {
@Suppress
(
"unused"
)
fun
dismissForced
()
{
BaseApp
.
get
().
bus
.
post
(
ScreenLocker
Events
.
UNLOCK_REQUESTED
)
BaseApp
.
get
().
bus
.
post
(
World
Events
.
UNLOCK_REQUESTED
)
}
fun
shouldShowLockerAfterUserPresent
():
Boolean
{
return
if
(
PhoneBrandUtils
.
isOppo
()
&&
ScreenLocker
Utils
.
isLockScreenProtected
(
BaseApp
.
instance
))
{
return
if
(
PhoneBrandUtils
.
isOppo
()
&&
World
Utils
.
isLockScreenProtected
(
BaseApp
.
instance
))
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"shouldShowLockerAfterUserPresent: MATCH!!!!"
)
true
}
else
{
...
...
@@ -241,7 +241,7 @@ class ScreenLockerObserver(private val context: Context) {
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE
World
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE
)
when
(
intent
.
action
)
{
ScreenMonitor
.
MY_SCREEN_OFF
,
Intent
.
ACTION_SCREEN_OFF
,
...
...
@@ -275,23 +275,23 @@ class ScreenLockerObserver(private val context: Context) {
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_USER_PRESENT
World
Constants
.
EVENT_SCREEN_LOCKER_USER_PRESENT
)
ScreenLocker
Context
.
screenOffCalled
=
false
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
=
false
World
Context
.
screenOffCalled
=
false
World
Context
.
canShowScreenLockerWhenScreenOn
=
false
BaseApp
.
get
().
taskPool
.
cancel
(
taskTagShowScreenLocker
)
if
(
shouldShowLockerAfterUserPresent
())
{
showScreenLocker
(
context
,
ScreenLocker
Constants
.
SHOW_REASON_USER_PRESENT
World
Constants
.
SHOW_REASON_USER_PRESENT
)
}
else
{
if
(
sendUserUnlocked
)
{
sendUserUnlocked
=
false
BaseApp
.
get
().
taskPool
.
cancel
(
taskTagShowScreenLocker
)
BaseApp
.
get
().
bus
.
post
(
BusEvent
.
of
(
ScreenLocker
Events
.
USER_UNLOCKED
))
BaseApp
.
get
().
bus
.
post
(
BusEvent
.
of
(
World
Events
.
USER_UNLOCKED
))
}
ActivityManagerProxy
.
ensureActive
()
}
...
...
@@ -309,12 +309,12 @@ class ScreenLockerObserver(private val context: Context) {
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_SCREEN_ON
World
Constants
.
EVENT_SCREEN_LOCKER_SCREEN_ON
)
ScreenLocker
Context
.
lastScreenOnTime
=
System
.
currentTimeMillis
()
World
Context
.
lastScreenOnTime
=
System
.
currentTimeMillis
()
val
screenOnGap
=
ScreenLockerContext
.
lastScreenOnTime
-
ScreenLocker
Context
.
lastScreenOffTime
WorldContext
.
lastScreenOnTime
-
World
Context
.
lastScreenOffTime
if
(
screenOnGap
in
1
..
4999
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"onReceive: SCREEN ON counter +1"
)
...
...
@@ -331,28 +331,28 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"onReceive: SCREEN ON counter RESET!"
)
}
ScreenLocker
Context
.
screenOffCalled
=
false
World
Context
.
screenOffCalled
=
false
// 避免有的其他应用盖我们,尽量再启动一次。也避免灭屏广告收不到的问题。
if
((
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
&&
shouldInvokeScreenLockerUiWhenScreenOn
()))
{
if
((
World
Context
.
canShowScreenLockerWhenScreenOn
&&
shouldInvokeScreenLockerUiWhenScreenOn
()))
{
if
(
forbidShowWhenScreenOff
||
shouldShowLockerAfterUserPresent
())
{
// start on thread...
showScreenLocker
(
context
,
ScreenLocker
Constants
.
SHOW_REASON_SCREEN_ON
World
Constants
.
SHOW_REASON_SCREEN_ON
)
}
else
{
BaseApp
.
get
().
taskPool
.
launchOnUiDelayed
(
1000L
,
taskTagShowScreenLocker
)
{
if
(
/*shouldShowLockerAfterUserPresent || */
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
&&
shouldInvokeScreenLockerUiWhenScreenOn
())
{
if
(
/*shouldShowLockerAfterUserPresent || */
World
Context
.
canShowScreenLockerWhenScreenOn
&&
shouldInvokeScreenLockerUiWhenScreenOn
())
{
showScreenLocker
(
context
,
ScreenLocker
Constants
.
SHOW_REASON_SCREEN_ON
World
Constants
.
SHOW_REASON_SCREEN_ON
)
}
else
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"onReceive: screen is on. but ignored showScreenLocker() invocation. Root cause = condition checking... A 2 "
+
"\nScreenLockerContext.canShowScreenLockerWhenScreenOn = ${
ScreenLocker
Context.canShowScreenLockerWhenScreenOn}"
+
"\nScreenLockerContext.canShowScreenLockerWhenScreenOn = ${
World
Context.canShowScreenLockerWhenScreenOn}"
+
"\nshouldInvokeScreenLockerUiWhenScreenOn() = ${shouldInvokeScreenLockerUiWhenScreenOn()}"
)
}
...
...
@@ -363,7 +363,7 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"onReceive: screen is on. but ignored showScreenLocker() invocation. Root cause = condition checking... A 1"
+
"\nScreenLockerContext.canShowScreenLockerWhenScreenOn = ${
ScreenLocker
Context.canShowScreenLockerWhenScreenOn}"
+
"\nScreenLockerContext.canShowScreenLockerWhenScreenOn = ${
World
Context.canShowScreenLockerWhenScreenOn}"
+
"\nshouldInvokeScreenLockerUiWhenScreenOn() = ${shouldInvokeScreenLockerUiWhenScreenOn()}"
)
...
...
@@ -384,14 +384,14 @@ class ScreenLockerObserver(private val context: Context) {
try
{
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_SCREEN_OFF
World
Constants
.
EVENT_SCREEN_LOCKER_SCREEN_OFF
)
ScreenLocker
Context
.
lastScreenOffTime
=
System
.
currentTimeMillis
()
World
Context
.
lastScreenOffTime
=
System
.
currentTimeMillis
()
ScreenLocker
Context
.
screenOffCalled
=
true
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
=
World
Context
.
screenOffCalled
=
true
World
Context
.
canShowScreenLockerWhenScreenOn
=
!
shouldShowLockerAfterUserPresent
()
||
forbidShowWhenScreenOff
sendUserUnlocked
=
ScreenLocker
Utils
.
hasSystemLockScreen
(
context
)
sendUserUnlocked
=
World
Utils
.
hasSystemLockScreen
(
context
)
BaseApp
.
get
().
taskPool
.
cancel
(
taskTagShowScreenLocker
)
}
catch
(
e
:
Throwable
)
{
...
...
@@ -403,7 +403,7 @@ class ScreenLockerObserver(private val context: Context) {
if
(!
shouldShowLockerAfterUserPresent
()
&&
!
forbidShowWhenScreenOff
)
{
showScreenLocker
(
context
,
ScreenLocker
Constants
.
SHOW_REASON_SCREEN_OFF
World
Constants
.
SHOW_REASON_SCREEN_OFF
)
}
}
...
...
@@ -411,23 +411,23 @@ class ScreenLockerObserver(private val context: Context) {
private
val
lockScreenCallback
=
object
:
ScreenStatusMonitor
.
ScreenStatusListener
{
override
fun
onScreenOff
()
{
BaseApp
.
instance
.
eventLogger
.
logEvent
(
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
BaseApp
.
instance
.
eventLogger
.
logEvent
(
World
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
onHandleScreenOff
(
BaseApp
.
instance
)
}
override
fun
onScreenOn
()
{
BaseApp
.
instance
.
eventLogger
.
logEvent
(
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
BaseApp
.
instance
.
eventLogger
.
logEvent
(
World
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
onHandleScreenOn
(
BaseApp
.
instance
)
}
override
fun
onUserPresent
()
{
BaseApp
.
instance
.
eventLogger
.
logEvent
(
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
BaseApp
.
instance
.
eventLogger
.
logEvent
(
World
Constants
.
EVENT_SCREEN_LOCKER_RECEIVE3
)
onHandleUserPresent
(
BaseApp
.
instance
)
}
}
private
fun
shouldInvokeScreenLockerUiWhenScreenOn
():
Boolean
{
return
forbidShowWhenScreenOff
||
(
ScreenLockerContext
.
observerInUse
.
isAlive
&&
!
ScreenLockerContext
.
observerInUse
.
isTouching
&&
!
ScreenLocker
Context
.
observerInUse
.
isFinishing
)
return
forbidShowWhenScreenOff
||
(
WorldContext
.
observerInUse
.
isAlive
&&
!
WorldContext
.
observerInUse
.
isTouching
&&
!
World
Context
.
observerInUse
.
isFinishing
)
}
...
...
@@ -442,7 +442,7 @@ class ScreenLockerObserver(private val context: Context) {
when
(
state
)
{
TelephonyManager
.
CALL_STATE_RINGING
,
TelephonyManager
.
CALL_STATE_OFFHOOK
->
{
CoreAdContext
.
callProcessing
=
true
BaseApp
.
get
().
bus
.
post
(
ScreenLocker
Events
.
CALL_INCOMING
)
BaseApp
.
get
().
bus
.
post
(
World
Events
.
CALL_INCOMING
)
}
TelephonyManager
.
CALL_STATE_IDLE
->
{
CoreAdContext
.
callProcessing
=
false
...
...
@@ -467,7 +467,7 @@ class ScreenLockerObserver(private val context: Context) {
// }
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_START_PREINVOKE
,
World
Constants
.
EVENT_SCREEN_LOCKER_START_PREINVOKE
,
EventParams
().
apply
{
reason
(
reason
.
toString
())
}
...
...
@@ -503,7 +503,7 @@ class ScreenLockerObserver(private val context: Context) {
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_INIT
,
World
Constants
.
EVENT_SCREEN_LOCKER_INIT
,
EventParams
()
)
...
...
@@ -513,20 +513,20 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"start: ERROR"
,
e
)
}
BaseApp
.
instance
.
eventLogger
.
logEvent
(
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_INIT_2
)
BaseApp
.
instance
.
eventLogger
.
logEvent
(
World
Constants
.
EVENT_SCREEN_LOCKER_INIT_2
)
if
(
useCallback
)
{
ScreenStatusMonitor
.
getInstance
().
addCallback
(
lockScreenCallback
)
}
else
{
ScreenMonitor
.
getInstance
().
register
(
null
,
lockScreenReceiver
)
}
if
(
ScreenLocker
Utils
.
canShowScreenLocker
(
context
))
{
ScreenLocker
Context
.
screenOffCalled
=
true
if
(
World
Utils
.
canShowScreenLocker
(
context
))
{
World
Context
.
screenOffCalled
=
true
sendUserUnlocked
=
ScreenLocker
Utils
.
hasSystemLockScreen
(
context
)
sendUserUnlocked
=
World
Utils
.
hasSystemLockScreen
(
context
)
showScreenLocker
(
context
,
ScreenLocker
Constants
.
SHOW_REASON_SCREEN_OFF
World
Constants
.
SHOW_REASON_SCREEN_OFF
)
}
BusEventObserver
.
observe
(
BaseApp
.
get
().
bus
,
this
::
onBusEvent
)
...
...
@@ -568,7 +568,7 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"onActivityResumed: activity = $activity"
)
// avoid back ad shows on top of system lock screen
if
(
activity
is
ScreenLocker
Activity
)
{
if
(
activity
is
World
Activity
)
{
CoreAdContext
.
lastShowScreenLockerTimestamp
=
System
.
currentTimeMillis
()
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"onActivityResumed: activity = $activity"
)
}
...
...
@@ -579,7 +579,7 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"onActivityPaused: activity = $activity"
)
// avoid back ad shows on top of system lock screen
if
(
activity
is
ScreenLocker
Activity
)
{
if
(
activity
is
World
Activity
)
{
CoreAdContext
.
lastShowScreenLockerTimestamp
=
System
.
currentTimeMillis
()
}
}
...
...
@@ -596,8 +596,8 @@ class ScreenLockerObserver(private val context: Context) {
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onBusEvent() called with: event = [$event]"
)
when
(
event
.
event
)
{
ScreenLocker
Events
.
SCREENLOCKER_UNLOCKED_BY_USER
->
{
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
=
false
World
Events
.
SCREENLOCKER_UNLOCKED_BY_USER
->
{
World
Context
.
canShowScreenLockerWhenScreenOn
=
false
}
}
}
...
...
app/src/main/java/com/mints/
screen/locker
/AbstractAbs.java
→
app/src/main/java/com/mints/
mingce/world/settings
/AbstractAbs.java
View file @
32333d2a
package
com
.
mints
.
screen
.
locker
;
package
com
.
mints
.
mingce
.
world
.
settings
;
import
android.app.Activity
$Intent
;
import
android.os.Bundle
;
...
...
app/src/main/java/com/mints/
screen/locker/settings/ScreenLockerRemote
Keys.kt
→
app/src/main/java/com/mints/
mingce/world/settings/World
Keys.kt
View file @
32333d2a
package
com.mints.
screen.locker
.settings
package
com.mints.
mingce.world
.settings
import
net.settings.IRemoteKeys
object
ScreenLockerRemote
Keys
:
IRemoteKeys
{
object
World
Keys
:
IRemoteKeys
{
const
val
KEY_DISMISS_WITH_SYSTEM_KEYGUARD
=
"ext_dd_dwsk"
const
val
KEY_AD_EXPIRE_INTERVAL
=
"ext_dd_aexpint"
const
val
KEY_AD_POPULATE_INTERVAL
=
"ext_dd_alint"
...
...
app/src/main/java/com/mints/
screen/locker/settings/ScreenLocker
Settings.kt
→
app/src/main/java/com/mints/
mingce/world/settings/World
Settings.kt
View file @
32333d2a
package
com.mints.
screen.locker
.settings
package
com.mints.
mingce.world
.settings
import
net.cloud.RemoteProxy
import
net.common.minutesMillis
import
net.settings.AppSettings
import
net.settings.ISettings
object
ScreenLocker
Settings
{
object
World
Settings
{
const
val
KEY_ENABLED
=
"dd_ena"
const
val
KEY_RED_PACKET_POPUP_TIME
=
"dd_rp_pptime"
...
...
@@ -19,22 +19,22 @@ object ScreenLockerSettings {
}
fun
isDismissWithSystemKeyguard
():
Boolean
{
return
RemoteProxy
.
readInt
(
ScreenLockerRemote
Keys
.
KEY_DISMISS_WITH_SYSTEM_KEYGUARD
,
ISettings
.
BOOLEAN_FALSE
)
==
ISettings
.
BOOLEAN_TRUE
return
RemoteProxy
.
readInt
(
World
Keys
.
KEY_DISMISS_WITH_SYSTEM_KEYGUARD
,
ISettings
.
BOOLEAN_FALSE
)
==
ISettings
.
BOOLEAN_TRUE
}
/**
* 如果广告显示超过一定时长,无论如何我都换一个
*/
fun
getAdExpireInterval
():
Long
{
return
RemoteProxy
.
readLong
(
ScreenLockerRemote
Keys
.
KEY_AD_EXPIRE_INTERVAL
,
45
.
minutesMillis
())
return
RemoteProxy
.
readLong
(
World
Keys
.
KEY_AD_EXPIRE_INTERVAL
,
45
.
minutesMillis
())
}
fun
getAdPopulateInterval
():
Long
{
return
RemoteProxy
.
readLong
(
ScreenLockerRemote
Keys
.
KEY_AD_POPULATE_INTERVAL
,
1
.
minutesMillis
())
return
RemoteProxy
.
readLong
(
World
Keys
.
KEY_AD_POPULATE_INTERVAL
,
1
.
minutesMillis
())
}
fun
getRedPacketPopupInterval
():
Long
{
return
RemoteProxy
.
readLong
(
ScreenLockerRemote
Keys
.
KEY_RED_PACKET_POPUP_INTERVAL
,
30
.
minutesMillis
())
return
RemoteProxy
.
readLong
(
World
Keys
.
KEY_RED_PACKET_POPUP_INTERVAL
,
30
.
minutesMillis
())
}
var
lastRedPacketPopupPopupTime
:
Long
...
...
app/src/main/java/com/mints/
screen/locker/utils/ScreenLocker
Utils.kt
→
app/src/main/java/com/mints/
mingce/world/utils/World
Utils.kt
View file @
32333d2a
package
com.mints.
screen.locker
.utils
package
com.mints.
mingce.world
.utils
import
android.annotation.SuppressLint
import
android.app.KeyguardManager
...
...
@@ -19,10 +19,10 @@ import java.text.SimpleDateFormat
import
java.util.*
private
const
val
TAG
=
"
screenlocker
.utils"
private
const
val
TAG
=
"
world
.utils"
@Suppress
(
"DEPRECATION"
)
object
ScreenLocker
Utils
{
object
World
Utils
{
/**
* 若灭屏状态 或者 是否解锁了
*/
...
...
app/src/main/java/com/mints/
screen/locker/ui
/DimenUtils.java
→
app/src/main/java/com/mints/
mingce/world/widget
/DimenUtils.java
View file @
32333d2a
package
com
.
mints
.
screen
.
locker
.
ui
;
package
com
.
mints
.
mingce
.
world
.
widget
;
import
android.content.Context
;
import
android.util.DisplayMetrics
;
...
...
app/src/main/java/com/mints/
screen/locker/ui/SlideToUnLock
View.java
→
app/src/main/java/com/mints/
mingce/world/widget/SlideWorld
View.java
View file @
32333d2a
package
com
.
mints
.
screen
.
locker
.
ui
;
package
com
.
mints
.
mingce
.
world
.
widget
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
...
...
@@ -22,7 +22,7 @@ import com.mints.fiveworld.R;
* <link>https://github.com/RockySteveJobs/LockerScreen</link>
*/
public
class
Slide
ToUnLockView
extends
ScreenLocker
RootLayout
{
public
class
Slide
WorldView
extends
World
RootLayout
{
// private RippleBackground mLockRipple;
private
View
mUnLockContainer
;
...
...
@@ -44,7 +44,7 @@ public class SlideToUnLockView extends ScreenLockerRootLayout {
private
int
moveDistance
=
0
;
private
float
unlockDistance
=
0
;
public
Slide
ToUnLock
View
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
public
Slide
World
View
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
();
}
...
...
app/src/main/java/com/mints/
screen/locker/ScreenLocker
Activity.kt
→
app/src/main/java/com/mints/
mingce/world/widget/World
Activity.kt
View file @
32333d2a
package
com.mints.
screen.locker
package
com.mints.
mingce.world.widget
import
android.content.Intent
import
android.os.Bundle
...
...
@@ -9,32 +9,32 @@ import com.ad.AdHelper
import
com.mints.fiveworld.BuildConfig
import
com.mints.fiveworld.ad.express.OutScreenExpress
import
net.utils.Log
import
com.mints.
screen.locker.core.ScreenLocker
Constants
import
com.mints.
screen.locker.core.ScreenLocker
Context
import
com.mints.
screen.locker.ui.ScreenLockerComponent
import
com.mints.
mingce.world.content.World
Constants
import
com.mints.
mingce.world.content.World
Context
import
com.mints.
mingce.world.settings.AbstractAbs
import
net.common.OutAppActivity
import
net.component.LockerActivity
private
const
val
TAG
=
"
screenlocker
.ui.activity"
private
const
val
TAG
=
"
world
.ui.activity"
open
class
ScreenLocker
Activity
:
AbstractAbs
(),
net
.
analytics
.
UiPage
,
LockerActivity
,
open
class
World
Activity
:
AbstractAbs
(),
net
.
analytics
.
UiPage
,
LockerActivity
,
OutAppActivity
{
init
{
@Suppress
(
"LeakingThis"
)
proxy
=
ScreenLocker
Component
(
this
)
proxy
=
World
Component
(
this
)
}
override
val
name
:
String
get
()
=
ScreenLocker
Constants
.
PAGE_SCREEN_LOCKER
get
()
=
World
Constants
.
PAGE_SCREEN_LOCKER
override
fun
dispatchTouchEvent
(
ev
:
MotionEvent
):
Boolean
{
when
(
ev
.
action
)
{
MotionEvent
.
ACTION_DOWN
->
{
ScreenLocker
Context
.
observer
(
this
).
isTouching
=
true
World
Context
.
observer
(
this
).
isTouching
=
true
}
MotionEvent
.
ACTION_UP
,
MotionEvent
.
ACTION_CANCEL
->
{
ScreenLocker
Context
.
observer
(
this
).
isTouching
=
false
World
Context
.
observer
(
this
).
isTouching
=
false
}
}
...
...
@@ -93,7 +93,7 @@ open class ScreenLockerActivity : AbstractAbs(), net.analytics.UiPage, LockerAct
private
fun
checkAdActivityStart
(
intent
:
Intent
?)
{
val
proxy1
=
proxy
if
(
proxy1
is
ScreenLocker
Component
&&
intent
?.
component
?.
className
!=
null
)
{
if
(
proxy1
is
World
Component
&&
intent
?.
component
?.
className
!=
null
)
{
proxy1
.
preStartActivity
()
// 有的时候广告有可能启动app
if
(
AdHelper
.
isAdActivity
(
...
...
app/src/main/java/com/mints/mingce/world/widget/WorldActivity2.kt
0 → 100644
View file @
32333d2a
package
com.mints.mingce.world.widget
import
com.mints.mingce.world.widget.WorldActivity
open
class
WorldActivity2
:
WorldActivity
()
\ No newline at end of file
app/src/main/java/com/mints/mingce/world/widget/WorldActivity3.kt
0 → 100644
View file @
32333d2a
package
com.mints.mingce.world.widget
import
com.mints.mingce.world.widget.WorldActivity2
class
WorldActivity3
:
WorldActivity2
()
\ No newline at end of file
app/src/main/java/com/mints/
screen/locker/ui/ScreenLocker
Component.kt
→
app/src/main/java/com/mints/
mingce/world/widget/World
Component.kt
View file @
32333d2a
package
com.mints.
screen.locker.ui
package
com.mints.
mingce.world.widget
import
android.content.Context
import
android.content.Intent
...
...
@@ -14,8 +14,6 @@ import android.view.Window
import
android.view.WindowManager
import
android.view.animation.DecelerateInterpolator
import
android.widget.*
import
androidx.core.view.updateLayoutParams
import
androidx.core.view.updatePadding
import
com.activityutil.ActivityManagerProxy
import
com.ad.AdHelper
import
com.main.ScreenMonitor
...
...
@@ -48,31 +46,31 @@ import com.mints.fiveworld.ui.activitys.IncreasespeedActivity
import
com.mints.fiveworld.ui.widgets.RoundRectLayout
import
com.mints.fiveworld.utils.LogUtil
import
com.mints.fiveworld.utils.Utils
import
com.mints.
screen.locker.core.ScreenLocker
Constants
import
com.mints.
screen.locker.core.ScreenLocker
Context
import
com.mints.
screen.locker.core.ScreenLocker
Events
import
com.mints.
screen.locker.core.ScreenLocker
Observer
import
com.mints.
screen.locker.settings.ScreenLocker
Settings
import
com.mints.
screen.locker.utils.ScreenLocker
Utils
import
com.mints.
mingce.world.content.World
Constants
import
com.mints.
mingce.world.content.World
Context
import
com.mints.
mingce.world.content.World
Events
import
com.mints.
mingce.world.content.World
Observer
import
com.mints.
mingce.world.settings.World
Settings
import
com.mints.
mingce.world.utils.World
Utils
import
java.text.SimpleDateFormat
import
java.util.*
private
const
val
TAG
=
"
screenlocker
.ui.activity"
private
const
val
TAG
=
"
world
.ui.activity"
internal
class
ScreenLocker
Component
(
component
:
IComponent
)
:
AbsComponent
(
component
),
internal
class
World
Component
(
component
:
IComponent
)
:
AbsComponent
(
component
),
ScreenMonitor
.
Listener
{
private
val
moreThan2SecPage
=
object
:
UiPage
{
override
val
name
:
String
get
()
=
ScreenLocker
Constants
.
PAGE_SCREEN_LOCKER_MORE_THAN_2_SEC
get
()
=
World
Constants
.
PAGE_SCREEN_LOCKER_MORE_THAN_2_SEC
}
private
val
moreThan1SecVisibile
=
Any
()
private
var
intentFlags
=
0
private
var
reason
=
ScreenLocker
Constants
.
SHOW_REASON_UNKNWON
private
var
reason
=
World
Constants
.
SHOW_REASON_UNKNWON
private
val
weekFormat
=
SimpleDateFormat
(
R
.
string
.
dd_date_fmt
.
stringRes
(),
Locale
.
getDefault
())
// private var avoidRestartSelfOnUserLeaveHint = false
...
...
@@ -132,7 +130,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
private
fun
updateDateTime
()
{
val
calendar
=
GregorianCalendar
.
getInstance
()
val
hourString
=
ScreenLocker
Utils
.
getHourString
(
activity
,
System
.
currentTimeMillis
())
val
hourString
=
World
Utils
.
getHourString
(
activity
,
System
.
currentTimeMillis
())
val
timeString
=
weekFormat
.
format
(
calendar
.
time
)
activity
.
ddTimeText
.
text
=
hourString
activity
.
ddDateText
.
text
=
timeString
...
...
@@ -150,7 +148,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
WifiDataManager
.
increaseCount
(
WifiDataManager
.
LOCK_ON
)
AdHelper
.
config
.
avoidRestartSelfOnUserLeaveHint
=
false
ScreenLocker
Context
.
changeOwnership
(
activity
)
World
Context
.
changeOwnership
(
activity
)
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
...
...
@@ -158,7 +156,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
)
val
useNewWay
=
false
if
(
useNewWay
&&
!
ScreenLocker
Observer
.
shouldShowLockerAfterUserPresent
())
{
if
(
useNewWay
&&
!
World
Observer
.
shouldShowLockerAfterUserPresent
())
{
val
window
:
Window
=
window
if
(
true
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
28
)
{
...
...
@@ -173,7 +171,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
}
}
setContentView
(
R
.
layout
.
activity_
screenlocker
)
setContentView
(
R
.
layout
.
activity_
world_view
)
localScreenOnState
=
CommonUtils
.
isScreenOn
(
activity
)
==
true
...
...
@@ -181,8 +179,8 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
window
.
setWindowAnimations
(
R
.
style
.
AppTheme_LockScreen_Animation
)
val
layoutParams
=
window
.
attributes
val
isUsingShowWhenLockedFlag
=
!
ScreenLockerUtils
.
isLockScreenProtected
(
activity
)
&&
!
ScreenLocker
Observer
.
shouldShowLockerAfterUserPresent
()
ScreenLocker
Utils
.
makeLockWindowFullScreen
(
!
WorldUtils
.
isLockScreenProtected
(
activity
)
&&
!
World
Observer
.
shouldShowLockerAfterUserPresent
()
World
Utils
.
makeLockWindowFullScreen
(
activity
,
layoutParams
,
isUsingShowWhenLockedFlag
...
...
@@ -191,7 +189,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
window
.
statusBarColor
=
Color
.
TRANSPARENT
window
.
navigationBarColor
=
Color
.
TRANSPARENT
ScreenLocker
Utils
.
updateWindowFlags
(
window
.
decorView
)
World
Utils
.
updateWindowFlags
(
window
.
decorView
)
}
initView
()
...
...
@@ -306,8 +304,8 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
)
do
{
if
(
intent
!=
null
)
{
intentFlags
=
intent
.
getIntExtra
(
ScreenLocker
Constants
.
INTENT_KEY_FLAGS
,
0
)
if
(
intentFlags
.
hasFlags
(
ScreenLocker
Observer
.
FLAG_START_WITH_CHARGE_BG
))
{
intentFlags
=
intent
.
getIntExtra
(
World
Constants
.
INTENT_KEY_FLAGS
,
0
)
if
(
intentFlags
.
hasFlags
(
World
Observer
.
FLAG_START_WITH_CHARGE_BG
))
{
activity
.
window
.
setBackgroundDrawableResource
(
R
.
drawable
.
dd_bg_win_charge
)
// 充电锁屏需要刷新一下广告
...
...
@@ -316,15 +314,15 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
}
reason
=
intent
.
getIntExtra
(
ScreenLocker
Constants
.
INTENT_KEY_REASON
,
ScreenLocker
Constants
.
SHOW_REASON_UNKNWON
World
Constants
.
INTENT_KEY_REASON
,
World
Constants
.
SHOW_REASON_UNKNWON
)
val
invokeMark
=
intent
.
getLongExtra
(
ScreenLocker
Constants
.
INTENT_KEY_MARK
,
0L
)
val
invokeMark
=
intent
.
getLongExtra
(
World
Constants
.
INTENT_KEY_MARK
,
0L
)
if
(
invokeMark
>
0
&&
lastInvokeMark
!=
invokeMark
)
{
lastInvokeMark
=
invokeMark
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_START_SUCCEED
,
World
Constants
.
EVENT_SCREEN_LOCKER_START_SUCCEED
,
EventParams
().
apply
{
set
(
"flags"
,
intentFlags
)
reason
(
reason
.
toString
())
...
...
@@ -360,15 +358,15 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onBusEvent() called with: event = [$event]"
)
when
(
event
.
event
)
{
ScreenLocker
Events
.
USER_UNLOCKED
->
{
if
(
ScreenLocker
Settings
.
isDismissWithSystemKeyguard
())
{
World
Events
.
USER_UNLOCKED
->
{
if
(
World
Settings
.
isDismissWithSystemKeyguard
())
{
unlock
(
false
)
}
}
ScreenLocker
Events
.
CALL_INCOMING
->
{
World
Events
.
CALL_INCOMING
->
{
unlock
(
false
)
}
ScreenLocker
Events
.
UNLOCK_REQUESTED
->
{
World
Events
.
UNLOCK_REQUESTED
->
{
unlock
(
false
)
}
...
...
@@ -426,7 +424,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
/** 如果亮屏后过快,在 {@link ScreenLockerObserver#lockScreenReceiver} 这个Receiver上,会因为屏幕点亮而延迟启动一遍锁屏(这个是怕别人盖)
* 这时候,用户好不容易点击了广告,又被带回来了。这样体验很差
*/
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
=
false
World
Context
.
canShowScreenLockerWhenScreenOn
=
false
// val originValue = AdHelper.config.avoidRestartSelfOnUserLeaveHint
AdHelper
.
config
.
avoidRestartSelfOnUserLeaveHint
=
true
...
...
@@ -441,7 +439,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
"onAdEvent: CLICK ad cause AdActivity started, so we need to finish self."
)
if
(
ScreenLocker
Utils
.
hasSystemLockScreen
(
activity
))
{
if
(
World
Utils
.
hasSystemLockScreen
(
activity
))
{
CommonUtils
.
showToast
(
activity
.
applicationContext
,
R
.
string
.
unlock_to_see_details
.
stringRes
()
...
...
@@ -553,7 +551,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
val
fgView
=
activity
.
ddForeground
resetWindowTransparentBackground
()
activity
.
root
.
setOnTouchToUnlockListener
(
object
:
Slide
ToUnLock
View
.
OnTouchToUnlockListener
{
Slide
World
View
.
OnTouchToUnlockListener
{
private
val
interpolator
=
DecelerateInterpolator
()
override
fun
onTouchLockArea
()
{
// bgView?.setBackgroundColor(Color.parseColor("#66000000"))
...
...
@@ -664,7 +662,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
unlockedSinceStarted
=
true
if
(
unlockedByUser
)
{
BaseApp
.
get
().
bus
.
post
(
ScreenLocker
Events
.
SCREENLOCKER_UNLOCKED_BY_USER
)
BaseApp
.
get
().
bus
.
post
(
World
Events
.
SCREENLOCKER_UNLOCKED_BY_USER
)
}
// keepAdIfPossible()
...
...
@@ -680,8 +678,8 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
CoreAdContext
.
lockerUnlockCallback
?.
invoke
(
activity
,
unlockedByUser
)
}
if
(
ScreenLocker
Observer
.
shouldShowLockerAfterUserPresent
())
{
BaseApp
.
get
().
bus
.
post
(
BusEvent
.
of
(
ScreenLocker
Events
.
USER_UNLOCKED
))
if
(
World
Observer
.
shouldShowLockerAfterUserPresent
())
{
BaseApp
.
get
().
bus
.
post
(
BusEvent
.
of
(
World
Events
.
USER_UNLOCKED
))
ActivityManagerProxy
.
ensureActive
()
}
...
...
@@ -727,7 +725,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
}
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"unlock: moveTaskToBack = $moveTaskToBack"
)
if
(!
moveTaskToBack
||
ScreenLocker
Observer
.
shouldShowLockerAfterUserPresent
())
{
if
(!
moveTaskToBack
||
World
Observer
.
shouldShowLockerAfterUserPresent
())
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"finishSelf: FALIED TO MOVE TASK TO BACK!!!"
)
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"finishSelf: FALIED TO MOVE TASK TO BACK!!!"
)
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"finishSelf: FALIED TO MOVE TASK TO BACK!!!"
)
...
...
@@ -735,7 +733,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
AdHelper
.
config
.
avoidRestartSelfOnUserLeaveHint
=
true
super
.
finishSelf
()
activity
.
overridePendingTransition
(
0
,
R
.
anim
.
no_animation
)
ScreenLocker
Context
.
observer
(
activity
).
isFinishing
=
true
World
Context
.
observer
(
activity
).
isFinishing
=
true
}
else
{
// 成功转入后台,那就保持广告状态
keepAdIfPossible
()
...
...
@@ -772,13 +770,13 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onStart() called "
)
CoreAdContext
.
lockerActivityStarted
=
true
ScreenLocker
Context
.
lastScreenLockerStartTime
=
System
.
currentTimeMillis
()
World
Context
.
lastScreenLockerStartTime
=
System
.
currentTimeMillis
()
unlockedSinceStarted
=
false
ScreenLocker
Utils
.
closeSystemLockView
(
activity
)
World
Utils
.
closeSystemLockView
(
activity
)
ScreenLocker
Context
.
observer
(
activity
).
isStarted
=
true
World
Context
.
observer
(
activity
).
isStarted
=
true
resetViewState
()
updateDateTime
()
...
...
@@ -804,16 +802,16 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onResume() called "
)
CoreAdContext
.
lockerResumeCallback
?.
invoke
(
activity
)
ScreenLocker
Context
.
observer
(
activity
).
taskId
=
activity
.
taskId
ScreenLocker
Context
.
observer
(
activity
).
isResumed
=
true
ScreenLocker
Context
.
observer
(
activity
).
isResumedSinceLastScreenOff
=
true
World
Context
.
observer
(
activity
).
taskId
=
activity
.
taskId
World
Context
.
observer
(
activity
).
isResumed
=
true
World
Context
.
observer
(
activity
).
isResumedSinceLastScreenOff
=
true
CoreAdContext
.
lockerActivityResumed
=
true
updateDateTime
()
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_START_RESUMED
,
EventParams
().
apply
{
World
Constants
.
EVENT_SCREEN_LOCKER_START_RESUMED
,
EventParams
().
apply
{
set
(
"flags"
,
intentFlags
)
reason
(
reason
.
toString
())
})
...
...
@@ -861,8 +859,8 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
// adImpressionHandler.notifyWindowFocusState(false, !unlockedSinceStarted)
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onPause() called isFinishing = ${activity.isFinishing}"
)
ScreenLocker
Context
.
observer
(
activity
).
isResumed
=
false
ScreenLocker
Context
.
observer
(
activity
).
isFinishing
=
activity
.
isFinishing
World
Context
.
observer
(
activity
).
isResumed
=
false
World
Context
.
observer
(
activity
).
isFinishing
=
activity
.
isFinishing
taskPool
.
cancel
(
moreThan2SecPage
)
taskPool
.
cancel
(
moreThan1SecVisibile
)
...
...
@@ -872,7 +870,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
override
fun
onStop
()
{
super
.
onStop
()
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onStop() called isFinishing = ${activity.isFinishing}"
)
ScreenLocker
Context
.
observer
(
activity
).
isFinishing
=
activity
.
isFinishing
World
Context
.
observer
(
activity
).
isFinishing
=
activity
.
isFinishing
CoreAdContext
.
lockerActivityStarted
=
false
...
...
@@ -887,7 +885,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
// }
resetViewState
()
ScreenLocker
Context
.
observer
(
activity
).
isStarted
=
false
World
Context
.
observer
(
activity
).
isStarted
=
false
}
override
fun
onDestroy
()
{
...
...
@@ -896,7 +894,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
taskPool
.
cancel
(
this
)
BrandEventLogger
.
logEventWithBrand
(
BaseApp
.
instance
.
eventLogger
,
ScreenLocker
Constants
.
EVENT_SCREEN_LOCKER_DESTROYED
,
EventParams
().
apply
{
World
Constants
.
EVENT_SCREEN_LOCKER_DESTROYED
,
EventParams
().
apply
{
set
(
"flags"
,
intentFlags
)
reason
(
reason
.
toString
())
})
...
...
@@ -904,7 +902,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
super
.
onDestroy
()
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"onDestroy() called "
)
ScreenLocker
Context
.
observer
(
activity
).
taskId
=
null
World
Context
.
observer
(
activity
).
taskId
=
null
ScreenMonitor
.
getInstance
().
unregister
(
this
,
null
)
receiver
.
unregister
()
}
...
...
@@ -919,9 +917,9 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
private
fun
restartSelf
()
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"restartSelf() called "
)
ScreenLocker
Observer
.
startScreenLockerForced
(
World
Observer
.
startScreenLockerForced
(
activity
,
ScreenLocker
Constants
.
SHOW_REASON_RESTART_SELF
,
World
Constants
.
SHOW_REASON_RESTART_SELF
,
intentFlags
)
userPresented
=
false
...
...
@@ -966,7 +964,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
userPresented
=
false
localScreenOnState
=
false
ScreenLocker
Context
.
observer
(
activity
).
isResumedSinceLastScreenOff
=
false
World
Context
.
observer
(
activity
).
isResumedSinceLastScreenOff
=
false
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"onScreenOff: try dismissing red packet dialog..."
)
...
...
@@ -1011,7 +1009,7 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
private
fun
showNativeAd
()
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"showNativeAd() called "
)
if
(!
ScreenLocker
Utils
.
isScreenOn
(
activity
))
{
if
(!
World
Utils
.
isScreenOn
(
activity
))
{
LogUtil
.
d
(
TAG
,
"应用外锁屏 未亮屏 ---> 不展示广告"
)
return
}
...
...
@@ -1269,6 +1267,6 @@ internal class ScreenLockerComponent(component: IComponent) : AbsComponent(compo
internal
fun
preStartActivity
()
{
AdHelper
.
config
.
avoidRestartSelfOnUserLeaveHint
=
true
ScreenLocker
Context
.
canShowScreenLockerWhenScreenOn
=
false
World
Context
.
canShowScreenLockerWhenScreenOn
=
false
}
}
\ No newline at end of file
app/src/main/java/com/mints/
screen/locker/ui/ScreenLocker
RootLayout.kt
→
app/src/main/java/com/mints/
mingce/world/widget/World
RootLayout.kt
View file @
32333d2a
package
com.mints.
screen.locker.ui
package
com.mints.
mingce.world.widget
import
android.content.Context
import
android.util.AttributeSet
...
...
@@ -7,9 +7,9 @@ import android.view.WindowInsets
import
com.mints.fiveworld.BuildConfig
import
net.widget.RootFrameLayout
private
const
val
TAG
=
"
screenlocker
.ui.rootLayout"
private
const
val
TAG
=
"
world
.ui.rootLayout"
open
class
ScreenLocker
RootLayout
(
context
:
Context
,
attrs
:
AttributeSet
)
:
RootFrameLayout
(
context
,
attrs
)
{
open
class
World
RootLayout
(
context
:
Context
,
attrs
:
AttributeSet
)
:
RootFrameLayout
(
context
,
attrs
)
{
interface
OnWindowVisibilityChangeListener
{
fun
onWindowVisibilityChanged
(
visibility
:
Int
)
}
...
...
app/src/main/java/com/mints/screen/locker/ScreenLockerActivity2.kt
deleted
100644 → 0
View file @
7974d139
package
com.mints.screen.locker
open
class
ScreenLockerActivity2
:
ScreenLockerActivity
()
\ No newline at end of file
app/src/main/java/com/mints/screen/locker/ScreenLockerActivity3.kt
deleted
100644 → 0
View file @
7974d139
package
com.mints.screen.locker
class
ScreenLockerActivity3
:
ScreenLockerActivity2
()
\ No newline at end of file
app/src/main/java/com/mints/screen/locker/core/ScreenLockerAdConfig.kt
deleted
100644 → 0
View file @
7974d139
package
com.mints.screen.locker.core
object
ScreenLockerAdConfig
{
const
val
AD_NAME_BOTTOM_AD
=
"dd_ba1"
}
\ No newline at end of file
app/src/main/java/com/mints/screen/locker/utils/AdImpressionHandler.kt
deleted
100644 → 0
View file @
7974d139
package
com.mints.screen.locker.utils
import
android.os.Handler
import
android.os.Looper
import
android.os.Message
import
com.mints.fiveworld.BuildConfig
import
net.common.millis
import
net.common.minutesMillis
import
net.common.secondsMillis
import
net.common.utils.CommonUtils
import
net.utils.Log
import
kotlin.math.max
import
kotlin.random.Random
//private const val TAG = "ad.utils.impression"
private
const
val
TAG
=
"screenlocker.ui.activity.ad"
/**
* 广告规则
* 1. 灭屏了,一定可以换广告(解决用户手动灭屏亮屏)
* 2. 广告过期一定能换(45分钟)
* 3. 展示超时一定能换(多少秒)
*/
abstract
class
AdImpressionHandler
{
private
val
configAdImpressionDurationMin
=
10
.
secondsMillis
()
private
val
configAdExpireDuration
=
45
.
minutesMillis
()
private
val
configAdImpressionDitherInterval
=
150
.
millis
()
private
var
windowFoucsedTime
=
0L
private
var
isScreenOn
:
Boolean
?
=
null
private
var
isWindowFocused
:
Boolean
?
=
null
private
var
currentAdBindTime
=
0L
// 最后一个ad,bind的时间戳,如果没有bind,或者ad被拿掉,则为0
private
var
currentAdImpressionDuration
=
0L
private
var
currentAdHash
=
0
private
var
populatedAdSinceScreenOff
=
false
var
forceAdPopulation
=
false
private
val
MSG_REMOVE_AD_VIEW
=
9971
private
val
handler
=
object
:
Handler
(
Looper
.
getMainLooper
())
{
override
fun
handleMessage
(
msg
:
Message
)
{
when
(
msg
.
what
)
{
MSG_REMOVE_AD_VIEW
->
{
if
(
currentAdHash
==
msg
.
arg1
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"handleMessage: invoking remove ad view..."
)
removeAd
()
}
else
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"handleMessage: ad hash changed! ignored remove op!"
)
}
}
}
}
}
fun
init
(
screenOn
:
Boolean
,
windowFocused
:
Boolean
)
{
notifyScreenState
(
screenOn
,
false
)
notifyWindowFocusState
(
windowFocused
,
false
)
// 准备好广告
tryPopulateAdReload
()
}
fun
resetAd
(
adObject
:
Any
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"resetAd: called"
)
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
"webView.helper"
,
"resetAd: called, AD RESET!"
)
currentAdImpressionDuration
=
0L
currentAdHash
=
adObject
.
hashCode
()
currentAdBindTime
=
System
.
currentTimeMillis
()
if
(
isScreenOn
==
false
&&
!
populatedAdSinceScreenOff
)
{
populatedAdSinceScreenOff
=
true
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"resetAd: populatedAdSinceScreenOff = true"
)
}
// 准备好广告
tryPopulateAdReload
()
}
fun
notifyScreenState
(
isScreenOn
:
Boolean
,
canInvokeReload
:
Boolean
=
true
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"notifyScreenState() called with: isScreenOn = [$isScreenOn], canInvokeReload = [$canInvokeReload]"
)
if
(
this
.
isScreenOn
==
isScreenOn
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"notifyScreenState: screen on state not change, ignored!"
)
return
}
this
.
isScreenOn
=
isScreenOn
if
(!
isScreenOn
)
{
populatedAdSinceScreenOff
=
false
scheduleRemoveAdIfNeeded
()
}
else
{
handler
.
removeMessages
(
MSG_REMOVE_AD_VIEW
)
}
if
(
canInvokeReload
)
{
// 屏幕状态改变,怎么样都要触发载入广告
tryPopulateAdReload
()
}
}
private
fun
scheduleRemoveAdIfNeeded
()
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"scheduleRemoveAdIfNeeded() called currentAdImpressionDuration = $currentAdImpressionDuration"
)
handler
.
removeMessages
(
MSG_REMOVE_AD_VIEW
)
// 避免windowFocus回调抖动,导致刚放上去的广告,被拿掉
if
(
currentAdImpressionDuration
<
configAdImpressionDitherInterval
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"scheduleRemoveAdIfNeeded: reduced currentAdImpressionDuration dither! ignored!"
)
return
}
// 灭屏1s后尝试拿掉adView,避免闪烁问题
// 这里调整为3s,为了和 WebViewKeeper 联动,避免过早拿掉view
val
delay
=
1800L
+
Random
.
nextInt
(
1800
)
// 三秒左右
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"scheduleRemoveAd() called delay = $delay"
)
handler
.
sendMessageDelayed
(
handler
.
obtainMessage
(
MSG_REMOVE_AD_VIEW
,
currentAdHash
,
0
),
delay
)
}
fun
notifyWindowFocusState
(
isWindowFocused
:
Boolean
,
canInvokeReload
:
Boolean
=
true
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"notifyWindowFocusState() called with: isWindowFocused = [$isWindowFocused], canInvokeReload = [$canInvokeReload]"
)
if
(
this
.
isWindowFocused
==
isWindowFocused
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"notifyWindowFocusState: window focus state not change, ignored!"
)
return
}
this
.
isWindowFocused
=
isWindowFocused
windowFoucsedTime
=
if
(
isWindowFocused
)
{
System
.
currentTimeMillis
()
}
else
{
// 窗体失去焦点,检查是不是够换广告了
checkAdImpressionDelta
()
0L
}
if
(
canInvokeReload
)
{
tryPopulateAdReload
()
}
}
private
fun
checkAdImpressionDelta
()
{
val
adImpressionDurationDelta
=
calcAdImpressionDelta
()
if
(
adImpressionDurationDelta
>
0L
)
{
currentAdImpressionDuration
+=
adImpressionDurationDelta
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"checkAdImpressionDelta: currentAdImpressionDuration = $currentAdImpressionDuration, DELTA-adImpressionDurationDelta = $adImpressionDurationDelta"
)
}
else
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"checkAdImpressionDelta: Delta = ZERO! ignored"
)
}
}
fun
canPopulateAd
():
Boolean
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"canPopulateAd() called forceAdPopulation = $forceAdPopulation, currentAdBindTime = $currentAdBindTime, "
+
"populatedAdSinceScreenOff = $populatedAdSinceScreenOff, currentAdImpressionDuration = $currentAdImpressionDuration"
)
var
result
=
false
if
(
forceAdPopulation
&&
hasCachedAd
())
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"canPopulateAd: forceAdPopulation = TRUE, ad population allowed!"
)
forceAdPopulation
=
false
return
true
}
if
(
currentAdBindTime
<=
0L
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"canPopulateAd: never bind ad, ad population allowed!"
)
result
=
true
}
else
if
(
CommonUtils
.
isTimeout
(
currentAdBindTime
,
configAdExpireDuration
))
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"canPopulateAd: ad is about to expire, ad population allowed!"
)
result
=
true
}
else
if
(
isScreenOn
==
false
&&
!
populatedAdSinceScreenOff
&&
currentAdImpressionDuration
>
configAdImpressionDitherInterval
)
{
// 增加 currentAdImpressionDuration 判断是为了避免一种情况
// 当 windowFocus = false 而且灭屏时,有些情况仍然导致窗体产生焦点一小段时间,避免这个时间间隔带来的抖动,否则在test-case
// 亮屏,等待10s,灭屏,导致广告超时,可以重新加载
// 重新加载发生在windowFocusLost时,加载成功
// 回调,onScreeOff() 导致从灭屏开始未加载过广告=true
// 广告load完成,因为上个条件,继续渲染广告,导致前一个广告白白浪费
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"canPopulateAd: screen is off, and didn't populate ad since then, allowed! currentAdImpressionDuration = $currentAdImpressionDuration"
)
result
=
true
}
else
{
val
adImpressionDelta
=
calcAdImpressionDelta
()
val
totalImpressionDuration
=
currentAdImpressionDuration
+
adImpressionDelta
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"canPopulateAd: totalImpressionDuration = $totalImpressionDuration ($currentAdImpressionDuration + delta $adImpressionDelta)"
)
if
(
totalImpressionDuration
>
configAdImpressionDurationMin
)
{
if
(
BuildConfig
.
DEBUG
)
Log
.
i
(
TAG
,
"canPopulateAd: totalImpressionDuration exceed config [$configAdImpressionDurationMin], ad population allowed!"
)
result
=
true
}
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"canPopulateAd() returned: RESULT = $result"
)
return
result
}
private
fun
calcAdImpressionDelta
():
Long
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"calcAdImpressionDelta: window lost focus, windowFoucsedTime = $windowFoucsedTime, currentAdBindTime = $currentAdBindTime"
)
return
if
(
windowFoucsedTime
>
0L
&&
currentAdBindTime
>
0L
)
{
System
.
currentTimeMillis
()
-
max
(
currentAdBindTime
,
windowFoucsedTime
)
}
else
{
0
}
}
private
fun
tryPopulateAdReload
()
{
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"tryPopulateAdReload: called"
)
onTryPopulateAdOrReload
()
}
abstract
fun
onTryPopulateAdOrReload
()
abstract
fun
hasCachedAd
():
Boolean
open
fun
removeAd
()
{}
}
\ No newline at end of file
app/src/main/res/layout/activity_aboutus.xml
View file @
32333d2a
...
...
@@ -7,17 +7,6 @@
<include
layout=
"@layout/header_layout"
/>
<com.mints.fiveworld.ui.widgets.ElasticScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fillViewport=
"true"
android:overScrollMode=
"never"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tvAboutasVersion"
android:layout_width=
"wrap_content"
...
...
@@ -102,7 +91,5 @@
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</com.mints.fiveworld.ui.widgets.ElasticScrollView>
</LinearLayout>
app/src/main/res/layout/activity_
screenlocker
.xml
→
app/src/main/res/layout/activity_
world_view
.xml
View file @
32333d2a
<?xml version="1.0" encoding="utf-8"?>
<com.mints.
screen.locker.ui.SlideToUnLock
View
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.mints.
mingce.world.widget.SlideWorld
View
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/root"
...
...
@@ -479,4 +479,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</com.mints.screen.locker.ui.SlideToUnLockView>
\ No newline at end of file
</com.mints.mingce.world.widget.SlideWorldView>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment