接 Top on 1.0.1(5)

This commit is contained in:
zhouzhijia 2024-07-26 18:27:47 +08:00
parent 4dd698a7ef
commit 63f514e86a
15 changed files with 580 additions and 83 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@
local.properties local.properties
.idea/ .idea/
image.zip image.zip
app/release/SoftWare Lock_v1.0.1(5)_07_26_18_05-release.apk
app/release/SoftWare Lock_v1.0.1(5)_07_26_18_22-release.aab

View File

@ -1,9 +1,14 @@
import java.util.Date
import java.text.SimpleDateFormat
plugins { plugins {
id("com.android.application") id("com.android.application")
id("kotlin-kapt") id("kotlin-kapt")
id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
} }
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android { android {
namespace = "com.example.applock" namespace = "com.example.applock"
compileSdk = 34 compileSdk = 34
@ -13,8 +18,12 @@ android {
applicationId = "com.soft.ware.lock.hd" applicationId = "com.soft.ware.lock.hd"
minSdk = 23 minSdk = 23
targetSdk = 34 targetSdk = 34
versionCode = 4 versionCode = 5
versionName = "1.0.0" versionName = "1.0.1"
setProperty(
"archivesBaseName",
"SoftWare Lock_v" + versionName + "(${versionCode})_$timestamp"
)
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@ -33,8 +42,8 @@ android {
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
} }
dataBinding{ dataBinding {
enable=true; enable = true;
} }
buildFeatures { buildFeatures {
viewBinding = true viewBinding = true
@ -50,9 +59,74 @@ dependencies {
testImplementation(libs.junit) testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit) androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core) androidTestImplementation(libs.espresso.core)
implementation ("androidx.work:work-runtime:2.9.0") implementation("androidx.work:work-runtime:2.9.0")
implementation("androidx.room:room-ktx:2.6.1") implementation("androidx.room:room-ktx:2.6.1")
implementation("androidx.room:room-runtime:2.6.1") implementation("androidx.room:room-runtime:2.6.1")
kapt("androidx.room:room-compiler:2.6.1") kapt("androidx.room:room-compiler:2.6.1")
implementation ("androidx.work:work-runtime:2.9.0") implementation("androidx.work:work-runtime:2.9.0")
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
//-----------------------------------------------TopOn(pangle、IronSource、mintegral、unityads、liftoff(vungle)、Bigo)
//Anythink (Necessary)
implementation("com.anythink.sdk:core-tpn:6.3.68")
implementation("com.anythink.sdk:nativead-tpn:6.3.68")
implementation("com.anythink.sdk:banner-tpn:6.3.68")
implementation("com.anythink.sdk:interstitial-tpn:6.3.68")
implementation("com.anythink.sdk:rewardedvideo-tpn:6.3.68")
implementation("com.anythink.sdk:splash-tpn:6.3.68")
//Androidx (Necessary)
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.browser:browser:1.4.0")
//Vungle
implementation("com.anythink.sdk:adapter-tpn-vungle:6.3.68")
implementation("com.vungle:vungle-ads:7.3.2")
implementation("com.google.android.gms:play-services-basement:18.1.0")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//UnityAds
implementation("com.anythink.sdk:adapter-tpn-unityads:6.3.68")
implementation("com.unity3d.ads:unity-ads:4.9.3")
//Ironsource
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.3.68")
implementation("com.ironsource.sdk:mediationsdk:8.1.0")
implementation("com.google.android.gms:play-services-appset:16.0.2")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
implementation("com.google.android.gms:play-services-basement:18.1.0")
//Bigo
implementation("com.anythink.sdk:adapter-tpn-bigo:6.3.68")
implementation("com.bigossp:bigo-ads:4.7.4")
//Pangle
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.3.68.1")
implementation("com.pangle.global:ads-sdk:6.0.0.3")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//Mintegral
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.3.68")
implementation("com.mbridge.msdk.oversea:reward:16.7.51")
implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
implementation("com.mbridge.msdk.oversea:mbnative:16.7.51")
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.7.51")
implementation("com.mbridge.msdk.oversea:mbsplash:16.7.51")
implementation("com.mbridge.msdk.oversea:mbbanner:16.7.51")
implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
implementation("androidx.recyclerview:recyclerview:1.1.0")
//Tramini
implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68")
// Debugger UI Tools
// implementation ("com.anythink.sdk:debugger-ui:1.0.7")
//----------------------------------------------TopOn
} }

View File

@ -19,3 +19,95 @@
# If you keep the line number information, uncomment this to # If you keep the line number information, uncomment this to
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
#---------------------------------------------Topon
# Vungle
-dontwarn com.vungle.ads.**
-keepclassmembers class com.vungle.ads.** {
*;
}
# Google
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
# START OkHttp + Okio
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# END OkHttp + Okio
# START Protobuf
-dontwarn com.google.protobuf.**
-keepclassmembers class com.google.protobuf.** {
*;
}
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
# END Protobuf
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
public *;
}
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keep public class com.google.android.gms.ads.** {
public *;
}
-keep class com.ironsource.adapters.** { *;
}
-dontwarn com.ironsource.mediationsdk.**
-dontwarn com.ironsource.adapters.**
-keepattributes JavascriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-keep class com.bytedance.sdk.** { *; }
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.mbridge.** {*; }
-keep interface com.mbridge.** {*; }
-keep class android.support.v4.** { *; }
-dontwarn com.mbridge.**
-keep class **.R$* { public static final int mbridge*; }
-keep public class com.mbridge.* extends androidx.** { *; }
-keep public class androidx.viewpager.widget.PagerAdapter{ *; }
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{ *; }
-keep interface androidx.annotation.IntDef{ *; }
-keep interface androidx.annotation.Nullable{ *; }
-keep interface androidx.annotation.CheckResult{ *; }
-keep interface androidx.annotation.NonNull{ *; }
-keep public class androidx.fragment.app.Fragment{ *; }
-keep public class androidx.core.content.FileProvider{ *; }
-keep public class androidx.core.app.NotificationCompat{ *; }
-keep public class androidx.appcompat.widget.AppCompatImageView { *; }
-keep public class androidx.recyclerview.*{ *; }
#---------------------------------------------Topon

View File

@ -11,9 +11,9 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 4, "versionCode": 5,
"versionName": "1.0.0", "versionName": "1.0.1",
"outputFile": "app-release.apk" "outputFile": "SoftWare Lock_v1.0.1(5)_07_26_18_05-release.apk"
} }
], ],
"elementType": "File" "elementType": "File"

View File

@ -1,4 +1,4 @@
package com.key.coolkeyboard.tool package com.example.applock.DrawView
import android.content.Context import android.content.Context
import android.graphics.Canvas import android.graphics.Canvas
@ -15,7 +15,7 @@ class CustomProgressBar(context: Context, attrs: AttributeSet?) : View(context,
private val maxProgress = 100f // 最大进度 private val maxProgress = 100f // 最大进度
private val progressBarHeight = 20f // 进度条高度 private val progressBarHeight = 20f // 进度条高度
private val cornerRadius = 10f // 圆角半径 private val cornerRadius = 10f // 圆角半径
private val backgroundColor = Color.parseColor("#26FFFFFF") private val backgroundColor = Color.parseColor("#40000000")
private val startColor = Color.parseColor("#FF9ce8ff") // 起始颜色 private val startColor = Color.parseColor("#FF9ce8ff") // 起始颜色
private val middleColor = Color.parseColor("#FFa4c4fb") // 中间颜色 private val middleColor = Color.parseColor("#FFa4c4fb") // 中间颜色
private val endColor = Color.parseColor("#FFbfa4ee") // 结束颜色 private val endColor = Color.parseColor("#FFbfa4ee") // 结束颜色

View File

@ -1,53 +1,116 @@
package com.example.applock.activity; package com.example.applock.activity;
import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.anythink.core.api.AdError;
import com.anythink.interstitial.api.ATInterstitial;
import com.example.applock.DrawView.CustomProgressBar;
import com.example.applock.R; import com.example.applock.R;
import com.example.applock.allmanager.Datamanager; import com.example.applock.allmanager.Datamanager;
import com.example.applock.application.SoftWareLockApplication;
import com.example.applock.value.Adcallback;
import com.example.applock.value.Mytool;
import java.util.List;
public class IntoActivity extends AppCompatActivity { public class IntoActivity extends AppCompatActivity {
private CountDownTimer countDownTimer; private CountDownTimer countDownTimer;
private List<ATInterstitial> ads;
private boolean isAlreadyShow = false;
private float i = 0;
private CustomProgressBar customProgressBar;
@SuppressLint("MissingInflatedId")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_into); setContentView(R.layout.activity_into);
countDownTimer = new CountDownTimer(1000,500) {
customProgressBar = findViewById(R.id.splash_pg);
ads = SoftWareLockApplication.lodAd();
countDownTimer = new CountDownTimer(10100, 100) {
@Override @Override
public void onTick(long millisUntilFinished) { public void onTick(long millisUntilFinished) {
i++;
customProgressBar.setProgress(i);
if (!isAlreadyShow) {
showAd(false);
}
} }
@Override @Override
public void onFinish() { public void onFinish() {
intoActivity(); if (!isAlreadyShow) {
showAd(true);
}
} }
}; };
gocount(); gocount();
} }
private void showAd(boolean go) {
ATInterstitial mInterstitialAd = Mytool.onCache(ads);
if (mInterstitialAd == null) {
isAlreadyShow = false;
if (go) {
intoActivity();
}
} else {
isAlreadyShow = true;
Mytool.setCallback(mInterstitialAd, new Adcallback() {
@Override
public void onShowFail(AdError ad) {
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
intoActivity();
}
@Override
public void onAdHidden() {
isAlreadyShow = true;
intoActivity();
}
});
mInterstitialAd.show(this);
}
}
private void gocount() { private void gocount() {
countDownTimer.start(); countDownTimer.start();
} }
public void intoActivity() { public void intoActivity() {
String firstkey = Datamanager.getTopKey(); String firstkey = Datamanager.getTopKey();
if (firstkey.isEmpty()) { if (firstkey.isEmpty()) {
Intent intent = new Intent(IntoActivity.this, KeyWordActivity.class); Intent intent = new Intent(IntoActivity.this, KeyWordActivity.class);
startActivity(intent); startActivity(intent);
} else { } else {
startActivity(new Intent(IntoActivity.this, MainActivity.class)); startActivity(new Intent(IntoActivity.this, MainActivity.class));
} }
finish(); finish();
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
// isAlreadyShow = false;
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
} }
} }

View File

@ -16,12 +16,18 @@ import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsCompat;
import com.anythink.core.api.AdError;
import com.anythink.interstitial.api.ATInterstitial;
import com.example.applock.DrawView.InPutKeyView; import com.example.applock.DrawView.InPutKeyView;
import com.example.applock.R; import com.example.applock.R;
import com.example.applock.allmanager.Datamanager; import com.example.applock.allmanager.Datamanager;
import com.example.applock.application.SoftWareLockApplication;
import com.example.applock.listener.InputKeyListener; import com.example.applock.listener.InputKeyListener;
import com.example.applock.value.Adcallback;
import com.example.applock.value.MyAllValues; import com.example.applock.value.MyAllValues;
import com.example.applock.value.Mytool;
import java.util.List;
import java.util.Objects; import java.util.Objects;
public class KeyWordActivity extends AppCompatActivity { public class KeyWordActivity extends AppCompatActivity {
@ -32,11 +38,16 @@ public class KeyWordActivity extends AppCompatActivity {
private String fistkey; private String fistkey;
private InPutKeyView inPutKeyView; private InPutKeyView inPutKeyView;
private int MyKeyPage; private int MyKeyPage;
private List<ATInterstitial> ads;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
MyKeyPage = getIntent().getIntExtra(MyAllValues.PASS_KEY_WORD,0); MyKeyPage = getIntent().getIntExtra(MyAllValues.PASS_KEY_WORD, 0);
setContentView(R.layout.activity_key_word); setContentView(R.layout.activity_key_word);
ads = SoftWareLockApplication.lodAd();
text_page = findViewById(R.id.text_page); text_page = findViewById(R.id.text_page);
text_key_btn = findViewById(R.id.text_key_btn); text_key_btn = findViewById(R.id.text_key_btn);
image_back = findViewById(R.id.image_back); image_back = findViewById(R.id.image_back);
@ -45,7 +56,7 @@ public class KeyWordActivity extends AppCompatActivity {
} }
private void gotoKyePage() { private void gotoKyePage() {
if(MyKeyPage == 0){ if (MyKeyPage == 0) {
image_back.setOnClickListener(new View.OnClickListener() { image_back.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -82,7 +93,7 @@ public class KeyWordActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} }
}); });
}else if(MyKeyPage == 1) { } else if (MyKeyPage == 1) {
text_page.setText(getString(R.string.confirm)); text_page.setText(getString(R.string.confirm));
text_key_btn.setText(getString(R.string.go_on)); text_key_btn.setText(getString(R.string.go_on));
image_back.setVisibility(View.VISIBLE); image_back.setVisibility(View.VISIBLE);
@ -142,10 +153,32 @@ public class KeyWordActivity extends AppCompatActivity {
} }
}); });
} }
private void resetPin(){
private void resetPin() {
Datamanager.setTopKey(fistkey); Datamanager.setTopKey(fistkey);
Toast.makeText(KeyWordActivity.this, getString(R.string.reset_success), Toast.LENGTH_SHORT).show(); Toast.makeText(KeyWordActivity.this, getString(R.string.reset_success), Toast.LENGTH_SHORT).show();
finish(); showAd();
}
private void showAd() {
ATInterstitial mInterstitialAd = Mytool.onCache(ads);
if (mInterstitialAd == null) {
finish();
} else {
Mytool.setCallback(mInterstitialAd, new Adcallback() {
@Override
public void onShowFail(AdError ad) {
finish();
}
@Override
public void onAdHidden() {
finish();
}
});
mInterstitialAd.show(this);
}
} }
} }

View File

@ -1,26 +1,65 @@
package com.example.applock.application; package com.example.applock.application;
import static android.content.ContentValues.TAG;
import android.app.Application; import android.app.Application;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.anythink.core.api.ATSDK;
import com.anythink.core.api.NetTrafficeCallback;
import com.anythink.interstitial.api.ATInterstitial;
import com.example.applock.allmanager.Datamanager; import com.example.applock.allmanager.Datamanager;
import com.example.applock.roombase.AppEntity; import com.example.applock.roombase.AppEntity;
import com.example.applock.roombase.SoftWareLockRoom; import com.example.applock.roombase.SoftWareLockRoom;
import com.example.applock.value.MyAllValues; import com.example.applock.value.MyAllValues;
import com.example.applock.allmanager.AppManager; import com.example.applock.allmanager.AppManager;
import com.example.applock.value.Mytool;
import org.w3c.dom.Entity; import org.w3c.dom.Entity;
import java.util.List;
import java.util.Set; import java.util.Set;
public class SoftWareLockApplication extends Application { public class SoftWareLockApplication extends Application {
public static boolean isPass = false; public static boolean isPass = false;
private static final String TOP_ID = "h66a2480dd8ead";
private static final String TOP_KEY = "aa0d3c0bc4f1109593d30d5c1f3a32120";
private static final String TOP_DEBUG = "d2f08ee302fdd0741819983376817c0bf71bfe67";
public static List<ATInterstitial> ads;
public static SoftWareLockApplication app;
private static Context context;
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
app = this;
context = getApplicationContext();
ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
@Override
public void onResultCallback(boolean isEU) {
Log.e(TAG, "onResultCallback:" + isEU);
if (isEU && ATSDK.getGDPRDataLevel(context) == ATSDK.UNKNOWN) {
ATSDK.showGdprAuth(context);
}
}
@Override
public void onErrorCallback(String errorMsg) {
Log.e(TAG, "onErrorCallback:" + errorMsg);
}
});
initSdk();
MyAllValues.softWareLockApplication = this; MyAllValues.softWareLockApplication = this;
isPass = true; isPass = true;
Datamanager.init(this); Datamanager.init(this);
@ -28,4 +67,21 @@ public class SoftWareLockApplication extends Application {
Set<AppEntity> entityApps = AppManager.QueryPhoneApp(this); Set<AppEntity> entityApps = AppManager.QueryPhoneApp(this);
SoftWareLockRoom.insertRoom(entityApps); SoftWareLockRoom.insertRoom(entityApps);
} }
private void initSdk() {
// ATSDK.integrationChecking(context);
ATSDK.init(context, TOP_ID, TOP_KEY);
ads = Mytool.getAllAd();
// ATSDK.setNetworkLogDebug(true);
// ATDebuggerUITest.showDebuggerUI(context,TOP_DEBUG);
}
public static List<ATInterstitial> lodAd() {
return ads;
}
} }

View File

@ -77,7 +77,7 @@ public class SoftWareLockFragment extends Fragment {
} }
private void initAppRecycle() { private void initAppRecycle() {
softAdapter = new SoftWareAdapter(requireContext(), isLocked); softAdapter = new SoftWareAdapter(requireActivity(), isLocked);
softAdapter.setLockListener(new LockListener() { softAdapter.setLockListener(new LockListener() {
@Override @Override
public void onSwitch(String msg) { public void onSwitch(String msg) {

View File

@ -1,8 +1,10 @@
package com.example.applock.lockadapter; package com.example.applock.lockadapter;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -14,9 +16,12 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.anythink.core.api.AdError;
import com.anythink.interstitial.api.ATInterstitial;
import com.example.applock.activity.KeyWordActivity; import com.example.applock.activity.KeyWordActivity;
import com.example.applock.allmanager.AppManager; import com.example.applock.allmanager.AppManager;
import com.example.applock.allmanager.Datamanager; import com.example.applock.allmanager.Datamanager;
import com.example.applock.application.SoftWareLockApplication;
import com.example.applock.databinding.ItemAppBinding; import com.example.applock.databinding.ItemAppBinding;
import com.example.applock.listener.InputKeyListener; import com.example.applock.listener.InputKeyListener;
import com.example.applock.listener.LockListener; import com.example.applock.listener.LockListener;
@ -26,26 +31,37 @@ import com.example.applock.roombase.SoftWareLockRoom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.example.applock.R;
public class SoftWareAdapter extends RecyclerView.Adapter<SoftWareAdapter.SoftWareViewHolder> { import com.example.applock.R;
import com.example.applock.value.Adcallback;
import com.example.applock.value.Mytool;
public class SoftWareAdapter extends RecyclerView.Adapter<SoftWareAdapter.SoftWareViewHolder> {
private List<AppEntity> entityApp1 = new ArrayList<>(); private List<AppEntity> entityApp1 = new ArrayList<>();
private Context mCon; private Activity mCon;
private boolean mLockList; private boolean mLockList;
private boolean lock; private boolean lock;
private LockListener lockListener; private LockListener lockListener;
private SwitchListener switchListener; private SwitchListener switchListener;
public static SharedPreferences keysp;
public static SharedPreferences.Editor keyeditor;
private int keyid;
private List<ATInterstitial> ads;
public SoftWareAdapter(Context context, boolean lock) { public SoftWareAdapter(Activity context, boolean lock) {
this.mCon = context; this.mCon = context;
this.mLockList = lock; this.mLockList = lock;
keysp = mCon.getSharedPreferences("key", Context.MODE_PRIVATE);
ads = SoftWareLockApplication.lodAd();
} }
public void setLockListener(LockListener lockListener) { public void setLockListener(LockListener lockListener) {
this.lockListener = lockListener; this.lockListener = lockListener;
} }
public void setSwitchListener(SwitchListener switchListener){
public void setSwitchListener(SwitchListener switchListener) {
this.switchListener = switchListener; this.switchListener = switchListener;
} }
@ -69,56 +85,94 @@ public class SoftWareAdapter extends RecyclerView.Adapter<SoftWareAdapter.SoftWa
holder.itemAppBinding.appLocked.setOnClickListener(new View.OnClickListener() { holder.itemAppBinding.appLocked.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Datamanager.setOpCount(); keyid = getkey();
AlertDialog alertDialog2 = new AlertDialog.Builder(mCon) keyid++;
.setTitle("Prompt") keyeditor = keysp.edit();
.setMessage("Are you sure "+label+"?") if (keyid % 5 == 0) {
.setIcon(R.mipmap.intologo) keyeditor.putInt("key", keyid);
.setPositiveButton("Sure", new DialogInterface.OnClickListener() { keyeditor.apply();
ATInterstitial mInterstitialAd = Mytool.onCache(ads);
if (mInterstitialAd == null) {
initEvent(label, entityApp, position, holder.itemAppBinding.appLocked);
} else {
Mytool.setCallback(mInterstitialAd, new Adcallback() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onShowFail(AdError ad) {
boolean selected = holder.itemAppBinding.appLocked.isSelected(); initEvent(label, entityApp, position, holder.itemAppBinding.appLocked);
holder.itemAppBinding.appLocked.setSelected(!selected); }
boolean selectedNew = holder.itemAppBinding.appLocked.isSelected();
entityApp.setApplocked(selectedNew);
SoftWareLockRoom.updateRoom(entityApp);
String name2;
if (selectedNew) {
if (!mLockList) {
entityApp1.remove(entityApp);
notifyItemRemoved(position);
}else {
}
name2 = String.format(mCon.getString(R.string.lock_app), label);
setbacklistener(name2);
} else {
name2 = String.format(mCon.getString(R.string.unlock_app), label);
setbacklistener(name2);
if (mLockList) {
entityApp1.remove(entityApp);
notifyItemRemoved(position);
}
}
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onAdHidden() {
//holder.itemAppBinding.appLocked.setSelected(!selected); initEvent(label, entityApp, position, holder.itemAppBinding.appLocked);
} }
}) });
.create(); mInterstitialAd.show(mCon);
alertDialog2.show(); }
} else {
keyeditor.putInt("key", keyid);
keyeditor.apply();
initEvent(label, entityApp, position, holder.itemAppBinding.appLocked);
}
} }
}); });
} }
private void initEvent(String label, AppEntity entityApp, int position, View view) {
Datamanager.setOpCount();
AlertDialog alertDialog2 = new AlertDialog.Builder(mCon)
.setTitle("Prompt")
.setMessage("Are you sure " + label + "?")
.setIcon(R.mipmap.intologo)
.setPositiveButton("Sure", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
boolean selected = view.isSelected();
view.setSelected(!selected);
boolean selectedNew = view.isSelected();
entityApp.setApplocked(selectedNew);
SoftWareLockRoom.updateRoom(entityApp);
String name2;
if (selectedNew) {
if (!mLockList) {
entityApp1.remove(entityApp);
notifyItemRemoved(position);
} else {
}
name2 = String.format(mCon.getString(R.string.lock_app), label);
setbacklistener(name2);
} else {
name2 = String.format(mCon.getString(R.string.unlock_app), label);
setbacklistener(name2);
if (mLockList) {
entityApp1.remove(entityApp);
notifyItemRemoved(position);
}
}
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//holder.itemAppBinding.appLocked.setSelected(!selected);
}
})
.create();
alertDialog2.show();
}
public static int getkey() {
return keysp.getInt("key", 0);
}
private void setbacklistener(String softname) { private void setbacklistener(String softname) {
if(lockListener!= null){ if (lockListener != null) {
lockListener.onSwitch(softname); lockListener.onSwitch(softname);
} }
} }
@ -126,11 +180,13 @@ public class SoftWareAdapter extends RecyclerView.Adapter<SoftWareAdapter.SoftWa
public int getItemCount() { public int getItemCount() {
return entityApp1.size(); return entityApp1.size();
} }
public void setEntityApps(List<AppEntity> apps) { public void setEntityApps(List<AppEntity> apps) {
entityApp1 = apps; entityApp1 = apps;
notifyDataSetChanged(); notifyDataSetChanged();
} }
static class SoftWareViewHolder extends RecyclerView.ViewHolder { static class SoftWareViewHolder extends RecyclerView.ViewHolder {
private ItemAppBinding itemAppBinding; private ItemAppBinding itemAppBinding;

View File

@ -1,4 +1,4 @@
package com.key.coolkeyboard.tool; package com.example.applock.value;
import com.anythink.core.api.AdError; import com.anythink.core.api.AdError;

View File

@ -1,2 +1,108 @@
package com.example.applock.value;public class Mytool { package com.example.applock.value;
import android.content.Context;
import android.util.Log;
import com.anythink.core.api.ATAdInfo;
import com.anythink.core.api.AdError;
import com.anythink.interstitial.api.ATInterstitial;
import com.anythink.interstitial.api.ATInterstitialListener;
import com.example.applock.application.SoftWareLockApplication;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Mytool {
private static final String one_AD = "n66a248aa03c0e";
private static final String two_Ad = "n66a24886778dc";
private static final String three_ad = "n66a2485a4f7d4";
private static ArrayList<ATInterstitial> adArrayList;
public static void setCallback(ATInterstitial ad, Adcallback adcallback) {
ad.setAdListener(new ATInterstitialListener() {
@Override
public void onInterstitialAdLoaded() {
Log.e("zzj", "---------onInterstitialAdLoaded--------" + ad.mPlacementId);
}
@Override
public void onInterstitialAdLoadFail(AdError adError) {
Log.e("zzj", "---------onInterstitialAdLoadFail--------" + adError.getFullErrorInfo());
adcallback.onShowFail(adError);
}
@Override
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {
}
@Override
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
ad.load();
}
@Override
public void onInterstitialAdClose(ATAdInfo atAdInfo) {
adcallback.onAdHidden();
}
@Override
public void onInterstitialAdVideoStart(ATAdInfo atAdInfo) {
}
@Override
public void onInterstitialAdVideoEnd(ATAdInfo atAdInfo) {
}
@Override
public void onInterstitialAdVideoError(AdError adError) {
}
});
}
public static ATInterstitial onCache(List<ATInterstitial> list) {
Collections.shuffle(list);
for (ATInterstitial ad : list) {
if (ad.isAdReady()) {
return ad;
}
}
return null;
}
public static List<ATInterstitial> getAllAd() {
if (adArrayList == null) {
adArrayList = new ArrayList<>();
adArrayList.add(createAd(one_AD, SoftWareLockApplication.app));
adArrayList.add(createAd(two_Ad, SoftWareLockApplication.app));
adArrayList.add(createAd(three_ad, SoftWareLockApplication.app));
}
for (ATInterstitial ad : adArrayList) {
if (!ad.isAdReady()) {
setCallback(ad, new Adcallback() {
@Override
public void onShowFail(AdError ad) {
}
@Override
public void onAdHidden() {
}
});
ad.load();
}
}
return adArrayList;
}
private static ATInterstitial createAd(String adUnitId, Context context) {
ATInterstitial ad = new ATInterstitial(context, adUnitId);
return ad;
}
} }

View File

@ -25,12 +25,13 @@
android:textColor="@color/text" android:textColor="@color/text"
android:layout_marginTop="30dp"/> android:layout_marginTop="30dp"/>
<ProgressBar <com.example.applock.DrawView.CustomProgressBar
android:layout_width="match_parent" android:layout_width="300dp"
android:layout_height="30dp" android:layout_height="20dp"
android:layout_below="@id/lock_name" android:layout_below="@id/lock_name"
android:layout_marginTop="36dp" android:layout_centerHorizontal="true"
android:indeterminateTint="@color/text" /> android:layout_marginTop="20dp"
android:id="@+id/splash_pg"/>
</RelativeLayout> </RelativeLayout>

View File

@ -2,4 +2,6 @@
plugins { plugins {
id("com.android.application") version "8.1.3" apply false id("com.android.application") version "8.1.3" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("com.google.gms.google-services") version "4.3.15" apply false
id ("com.google.firebase.crashlytics") version "2.9.2" apply false
} }

View File

@ -16,6 +16,18 @@ dependencyResolutionManagement {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven("https://jitpack.io")
//Anythink(Core)
maven("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
//Ironsource
maven("https://android-sdk.is.com/")
//Mintegral
maven("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
//Pangle
maven ( "https://artifact.bytedance.com/repository/pangle")
//TopOn集成测试工具
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
} }
} }