Commit 32333d2a authored by mengcuiguang's avatar mengcuiguang

应用名称修改

parent 7974d139
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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
<?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:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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:.*:&lt;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"/>
......
......@@ -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>
-- 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
......@@ -124,12 +124,10 @@ android {
productFlavors {
fiveworld {}
toutiao {}
ks_cs {}
store360 {}
oppo {}
vivo {}
huawei {}
xiaomi {}
meizu {}
}
productFlavors.all {
......
......@@ -208,7 +208,7 @@
android:theme="@style/OutTransparentTheme" />
<activity
android:name="com.mints.screen.locker.ScreenLockerActivity"
android:name="com.mints.mingce.world.widget.WorldActivity"
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.ScreenLockerActivity2"
android:name="com.mints.mingce.world.widget.WorldActivity2"
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.ScreenLockerActivity3"
android:name="com.mints.mingce.world.widget.WorldActivity3"
android:configChanges="keyboardHidden|orientation|screenSize|locale|density|fontScale|layoutDirection|navigation|uiMode|screenLayout|mcc|mnc"
android:excludeFromRecents="true"
android:immersive="true"
......
......@@ -65,7 +65,7 @@ import kotlin.jvm.functions.Function1;
import rx.Scheduler;
import rx.schedulers.Schedulers;
import com.mints.screen.locker.core.ScreenLockerObserver;
import com.mints.mingce.world.content.WorldObserver;
/**
* 描述:Application
......@@ -222,7 +222,7 @@ public class MintsApplication extends BaseApp {
thirdConfig();
// 锁屏模块初始化
new ScreenLockerObserver(this).start(this);
new WorldObserver(this).start(this);
CoreAdContext.Companion.setLockerResumeCallback(new Function1<Activity, Boolean>() {
@Override
......
......@@ -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 ""
}
}
/**
......
......@@ -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.ScreenLockerUtils;
import com.mints.mingce.world.utils.WorldUtils;
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 (ScreenLockerUtils.INSTANCE.isHorizontalScreen(MintsApplication.getContext())) {
if (WorldUtils.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 (!ScreenLockerUtils.INSTANCE.isHorizontalScreen(MintsApplication.getContext())) {
if (!WorldUtils.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 (!ScreenLockerUtils.INSTANCE.isScreenOn(MintsApplication.getContext()) // 息屏
if (!WorldUtils.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,
" 是否息屏=" + ScreenLockerUtils.INSTANCE.isScreenOn(MintsApplication.getContext()) +
" 是否息屏=" + WorldUtils.INSTANCE.isScreenOn(MintsApplication.getContext()) +
" 是否在锁屏页上方=" + ForegroundOrBackground.isScreenForeground()
, AdReportManager.EVENT_TYPE_SCENCE_CLOSE, AdReportManager.ERROR_CODE_FOREGROUND, "应用锁屏时,不弹出应用外广告");
LogUtil.d(TAG, "应用在锁屏时 isScreenOn=" + ScreenLockerUtils.INSTANCE.isScreenOn(MintsApplication.getContext()) +
LogUtil.d(TAG, "应用在锁屏时 isScreenOn=" + WorldUtils.INSTANCE.isScreenOn(MintsApplication.getContext()) +
" isScreenActivityResume=" + ForegroundOrBackground.isScreenForeground());
return false;
}
......@@ -565,7 +565,7 @@ public class AlarmManager implements Handler.Callback {
}
// 横屏
if (ScreenLockerUtils.INSTANCE.isHorizontalScreen(MintsApplication.getContext())) {
if (WorldUtils.INSTANCE.isHorizontalScreen(MintsApplication.getContext())) {
UmengManager.INSTANCE.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_OUT_TIME10_HORIZONTALSCREEN.name());
AdReportManager.INSTANCE.eventScene(
......
......@@ -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.ScreenLockerUtils
import com.mints.mingce.world.utils.WorldUtils
/**
*
......@@ -205,7 +205,7 @@ object OutAppRouter {
fun canPopActivity(carrier: String, remark: String): Boolean {
// 锁屏在前台时,不弹出应用外广告
if (!ScreenLockerUtils.isScreenOn(MintsApplication.getContext()) // 息屏
if (!WorldUtils.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,
" 是否息屏=" + ScreenLockerUtils.isScreenOn(MintsApplication.getContext()) +
" 是否息屏=" + WorldUtils.isScreenOn(MintsApplication.getContext()) +
" 是否是否在锁屏页上方=" + ForegroundOrBackground.isScreenForeground(),
AdReportManager.EVENT_TYPE_SCENCE_CLOSE,
AdReportManager.ERROR_CODE_FOREGROUND,
......@@ -221,7 +221,7 @@ object OutAppRouter {
)
LogUtil.d(
TAG,
"应用在锁屏时 isScreenOn=" + ScreenLockerUtils.isScreenOn(MintsApplication.getContext()) +
"应用在锁屏时 isScreenOn=" + WorldUtils.isScreenOn(MintsApplication.getContext()) +
" isScreenActivityResume=" + ForegroundOrBackground.isScreenForeground()
)
return false
......@@ -296,7 +296,7 @@ object OutAppRouter {
}
// 横屏
if (ScreenLockerUtils.isHorizontalScreen(MintsApplication.getContext())) {
if (WorldUtils.isHorizontalScreen(MintsApplication.getContext())) {
UmengManager.onEvent(AdReportManager.EventType.EVENT_TYPE_SCENCE_HORIZONTALSCREEN.name)
AdReportManager.eventScene(
if (ForegroundOrBackground.isForeground2()) AdReportManager.INNER_IN else AdReportManager.INNER_OUT,
......
......@@ -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()
......
......@@ -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);
......
......@@ -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>>() {
......
......@@ -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>>() {
......
......@@ -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),
......
......@@ -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();
......
......@@ -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
}
......
......@@ -55,7 +55,7 @@ class MainActivity : BaseActivity(), MainView {
}
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
mainPresenter.getNetWorkIp()
TrackManager.getInstance().saveTerminalInfo()
}
showPowerDialog()
......
......@@ -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);
}
}
}
......
......@@ -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.ScreenLockerUtils
import com.mints.mingce.world.utils.WorldUtils
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 (!ScreenLockerUtils.isScreenOn(MintsApplication.getContext())) {
if (!WorldUtils.isScreenOn(MintsApplication.getContext())) {
LogUtil.d(
TAG,
"是否亮屏=${ScreenLockerUtils.isScreenOn(MintsApplication.getContext())}"
"是否亮屏=${WorldUtils.isScreenOn(MintsApplication.getContext())}"
)
return
}
......
......@@ -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.ScreenLockerUtils
import com.mints.mingce.world.utils.WorldUtils
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 (!ScreenLockerUtils.isScreenOn(MintsApplication.getContext())) {
if (!WorldUtils.isScreenOn(MintsApplication.getContext())) {
LogUtil.d(
TAG,
"是否亮屏=${ScreenLockerUtils.isScreenOn(MintsApplication.getContext())}"
"是否亮屏=${WorldUtils.isScreenOn(MintsApplication.getContext())}"
)
return
}
......
......@@ -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;
}
}
......
package com.mints.screen.locker.core
package com.mints.mingce.world.content
object ScreenLockerConstants {
object WorldConstants {
const val INTENT_KEY_FLAGS = "kdd1"
const val INTENT_KEY_MARK = "kdd2"
......
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 ScreenLockerContext {
object WorldContext {
internal var canShowScreenLockerWhenScreenOn = true
internal var lastScreenOffTime = 0L
......
package com.mints.screen.locker.core
package com.mints.mingce.world.content
import com.squareup.module.feature.FeatureConstants
internal object ScreenLockerEvents {
internal object WorldEvents {
private const val BASE = 867_0000
const val USER_UNLOCKED = BASE + 1
const val SCREENLOCKER_UNLOCKED_BY_USER = FeatureConstants.CUSTOM_UNLOCKED
......
package com.mints.screen.locker;
package com.mints.mingce.world.settings;
import android.app.Activity$Intent;
import android.os.Bundle;
......
package com.mints.screen.locker.settings
package com.mints.mingce.world.settings
import net.settings.IRemoteKeys
object ScreenLockerRemoteKeys : IRemoteKeys {
object WorldKeys : 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"
......
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 ScreenLockerSettings {
object WorldSettings {
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(ScreenLockerRemoteKeys.KEY_DISMISS_WITH_SYSTEM_KEYGUARD, ISettings.BOOLEAN_FALSE) == ISettings.BOOLEAN_TRUE
return RemoteProxy.readInt(WorldKeys.KEY_DISMISS_WITH_SYSTEM_KEYGUARD, ISettings.BOOLEAN_FALSE) == ISettings.BOOLEAN_TRUE
}
/**
* 如果广告显示超过一定时长,无论如何我都换一个
*/
fun getAdExpireInterval(): Long {
return RemoteProxy.readLong(ScreenLockerRemoteKeys.KEY_AD_EXPIRE_INTERVAL, 45.minutesMillis())
return RemoteProxy.readLong(WorldKeys.KEY_AD_EXPIRE_INTERVAL, 45.minutesMillis())
}
fun getAdPopulateInterval(): Long {
return RemoteProxy.readLong(ScreenLockerRemoteKeys.KEY_AD_POPULATE_INTERVAL, 1.minutesMillis())
return RemoteProxy.readLong(WorldKeys.KEY_AD_POPULATE_INTERVAL, 1.minutesMillis())
}
fun getRedPacketPopupInterval(): Long {
return RemoteProxy.readLong(ScreenLockerRemoteKeys.KEY_RED_PACKET_POPUP_INTERVAL, 30.minutesMillis())
return RemoteProxy.readLong(WorldKeys.KEY_RED_PACKET_POPUP_INTERVAL, 30.minutesMillis())
}
var lastRedPacketPopupPopupTime: Long
......
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 ScreenLockerUtils {
object WorldUtils {
/**
* 若灭屏状态 或者 是否解锁了
*/
......
package com.mints.screen.locker.ui;
package com.mints.mingce.world.widget;
import android.content.Context;
import android.util.DisplayMetrics;
......
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 SlideToUnLockView extends ScreenLockerRootLayout {
public class SlideWorldView extends WorldRootLayout {
// private RippleBackground mLockRipple;
private View mUnLockContainer;
......@@ -44,7 +44,7 @@ public class SlideToUnLockView extends ScreenLockerRootLayout {
private int moveDistance = 0;
private float unlockDistance = 0;
public SlideToUnLockView(@NonNull Context context, @Nullable AttributeSet attrs) {
public SlideWorldView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init();
}
......
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.ScreenLockerConstants
import com.mints.screen.locker.core.ScreenLockerContext
import com.mints.screen.locker.ui.ScreenLockerComponent
import com.mints.mingce.world.content.WorldConstants
import com.mints.mingce.world.content.WorldContext
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 ScreenLockerActivity : AbstractAbs(), net.analytics.UiPage, LockerActivity,
open class WorldActivity : AbstractAbs(), net.analytics.UiPage, LockerActivity,
OutAppActivity {
init {
@Suppress("LeakingThis")
proxy = ScreenLockerComponent(this)
proxy = WorldComponent(this)
}
override val name: String
get() = ScreenLockerConstants.PAGE_SCREEN_LOCKER
get() = WorldConstants.PAGE_SCREEN_LOCKER
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
when (ev.action) {
MotionEvent.ACTION_DOWN -> {
ScreenLockerContext.observer(this).isTouching = true
WorldContext.observer(this).isTouching = true
}
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
ScreenLockerContext.observer(this).isTouching = false
WorldContext.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 ScreenLockerComponent && intent?.component?.className != null) {
if (proxy1 is WorldComponent && intent?.component?.className != null) {
proxy1.preStartActivity()
// 有的时候广告有可能启动app
if (AdHelper.isAdActivity(
......
package com.mints.mingce.world.widget
import com.mints.mingce.world.widget.WorldActivity
open class WorldActivity2 : WorldActivity()
\ No newline at end of file
package com.mints.mingce.world.widget
import com.mints.mingce.world.widget.WorldActivity2
class WorldActivity3 : WorldActivity2()
\ No newline at end of file
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 ScreenLockerRootLayout(context: Context, attrs: AttributeSet) : RootFrameLayout(context, attrs) {
open class WorldRootLayout(context: Context, attrs: AttributeSet) : RootFrameLayout(context, attrs) {
interface OnWindowVisibilityChangeListener {
fun onWindowVisibilityChanged(visibility: Int)
}
......
package com.mints.screen.locker
open class ScreenLockerActivity2 : ScreenLockerActivity()
\ No newline at end of file
package com.mints.screen.locker
class ScreenLockerActivity3 : ScreenLockerActivity2()
\ No newline at end of file
package com.mints.screen.locker.core
object ScreenLockerAdConfig {
const val AD_NAME_BOTTOM_AD = "dd_ba1"
}
\ No newline at end of file
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
......@@ -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>
<?xml version="1.0" encoding="utf-8"?>
<com.mints.screen.locker.ui.SlideToUnLockView xmlns:android="http://schemas.android.com/apk/res/android"
<com.mints.mingce.world.widget.SlideWorldView 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment