diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14e5aca --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.idea/ +/.gradle/ +/build/ diff --git a/76Pokies/.gitignore b/76Pokies/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/76Pokies/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/76Pokies/76pokies.jks b/76Pokies/76pokies.jks new file mode 100644 index 0000000..5105df7 Binary files /dev/null and b/76Pokies/76pokies.jks differ diff --git a/76Pokies/build.gradle b/76Pokies/build.gradle new file mode 100644 index 0000000..b8dcce7 --- /dev/null +++ b/76Pokies/build.gradle @@ -0,0 +1,84 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.pokies76" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 100 + versionName "v1.0.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('76pokies.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('76pokies.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + implementation project(path: ':base') + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + // implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") +} \ No newline at end of file diff --git a/76Pokies/google-services.json b/76Pokies/google-services.json new file mode 100644 index 0000000..b884b43 --- /dev/null +++ b/76Pokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "377488126355", + "project_id": "pokies-b1a7d", + "storage_bucket": "pokies-b1a7d.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:377488126355:android:14b32fea378a2d1e89f866", + "android_client_info": { + "package_name": "com.web.pokies76" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAfPWXu02324YRAnqepyGFHpofigTOMM7U" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/76Pokies/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/76Pokies/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/76Pokies/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/76Pokies/proguard-rules.pro b/76Pokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/76Pokies/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/76Pokies/release/76pokies.apk b/76Pokies/release/76pokies.apk new file mode 100644 index 0000000..7d7ca08 Binary files /dev/null and b/76Pokies/release/76pokies.apk differ diff --git a/76Pokies/release/output-metadata.json b/76Pokies/release/output-metadata.json new file mode 100644 index 0000000..0cecd7e --- /dev/null +++ b/76Pokies/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.pokies76", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 100, + "versionName": "v1.0.0", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/76Pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/76Pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/76Pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/76Pokies/src/main/AndroidManifest.xml b/76Pokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1737d8f --- /dev/null +++ b/76Pokies/src/main/AndroidManifest.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/java/com/web/pokies76/MainActivity2.java b/76Pokies/src/main/java/com/web/pokies76/MainActivity2.java new file mode 100644 index 0000000..b7816c2 --- /dev/null +++ b/76Pokies/src/main/java/com/web/pokies76/MainActivity2.java @@ -0,0 +1,33 @@ +package com.web.pokies76; + + +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 110; + com.web.base.MainActivity2.saveInt(MainActivity2.this,"user_code",userId); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + +} diff --git a/76Pokies/src/main/java/com/web/pokies76/MyFirebaseMessageingService.java b/76Pokies/src/main/java/com/web/pokies76/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ffe710c --- /dev/null +++ b/76Pokies/src/main/java/com/web/pokies76/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.pokies76; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/76Pokies/src/main/java/com/web/pokies76/WebApplication.java b/76Pokies/src/main/java/com/web/pokies76/WebApplication.java new file mode 100644 index 0000000..fbb8f36 --- /dev/null +++ b/76Pokies/src/main/java/com/web/pokies76/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.pokies76; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/76Pokies/src/main/res/drawable-anydpi/ic_action_back.xml b/76Pokies/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/76Pokies/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/76Pokies/src/main/res/drawable-hdpi/ic_action_back.png b/76Pokies/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/76Pokies/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/76Pokies/src/main/res/drawable-mdpi/ic_action_back.png b/76Pokies/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/76Pokies/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/76Pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml b/76Pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/76Pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable-xhdpi/ic_action_back.png b/76Pokies/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/76Pokies/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/76Pokies/src/main/res/drawable-xxhdpi/ic_action_back.png b/76Pokies/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/76Pokies/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/76Pokies/src/main/res/drawable/ic_launcher_background.xml b/76Pokies/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/76Pokies/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/76Pokies/src/main/res/drawable/input_bg.xml b/76Pokies/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/76Pokies/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/76Pokies/src/main/res/drawable/pass_word_bg.xml b/76Pokies/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/76Pokies/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/76Pokies/src/main/res/drawable/pass_word_bg1.xml b/76Pokies/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/76Pokies/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/pass_word_bg2.xml b/76Pokies/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/76Pokies/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/shape_btn_bg.xml b/76Pokies/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/76Pokies/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/shape_dialog_bg2.xml b/76Pokies/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/76Pokies/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/shape_dialog_bg3.xml b/76Pokies/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/76Pokies/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/shape_dialog_bg_new.xml b/76Pokies/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/76Pokies/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/drawable/shape_notify_typebg.xml b/76Pokies/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/76Pokies/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/76Pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/mipmap-hdpi/ic_empty.png b/76Pokies/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/76Pokies/src/main/res/mipmap-hdpi/ic_pull_down.png b/76Pokies/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_close.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_email.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..aaacc68 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_facebook.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_hometo.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_link.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_menu.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_email.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_shousuo.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_tel.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/76Pokies/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/76Pokies/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/76Pokies/src/main/res/mipmap-xxhdpi/app_logo.png b/76Pokies/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..bba00a8 Binary files /dev/null and b/76Pokies/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/76Pokies/src/main/res/values-en/strings.xml b/76Pokies/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c0413e5 --- /dev/null +++ b/76Pokies/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + 76POKIES + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/76Pokies/src/main/res/values-night/themes.xml b/76Pokies/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/76Pokies/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/values/colors.xml b/76Pokies/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/76Pokies/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/76Pokies/src/main/res/values/strings.xml b/76Pokies/src/main/res/values/strings.xml new file mode 100644 index 0000000..a84877f --- /dev/null +++ b/76Pokies/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + 76POKIES + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/values/themes.xml b/76Pokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/76Pokies/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/xml/app_updater_paths.xml b/76Pokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/76Pokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/xml/network_security_config.xml b/76Pokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/76Pokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/76Pokies/src/main/res/xml/provider_paths.xml b/76Pokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/76Pokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/76Pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/76Pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/76Pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/9kelab/.gitignore b/9kelab/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/9kelab/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/9kelab/9kelab.jks b/9kelab/9kelab.jks new file mode 100644 index 0000000..4b7513f Binary files /dev/null and b/9kelab/9kelab.jks differ diff --git a/9kelab/build.gradle b/9kelab/build.gradle new file mode 100644 index 0000000..9bca7c1 --- /dev/null +++ b/9kelab/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.kelab9" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('9kelab.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('9kelab.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + + + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') +} \ No newline at end of file diff --git a/9kelab/google-services.json b/9kelab/google-services.json new file mode 100644 index 0000000..bef2e76 --- /dev/null +++ b/9kelab/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "60742868930", + "project_id": "kelab-e3c2b", + "storage_bucket": "kelab-e3c2b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:60742868930:android:9d21cad56205c33b1dc05b", + "android_client_info": { + "package_name": "com.web.kelab9" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDP2CKI721IENCj6ux4PBUyJftt7s8QsGI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/9kelab/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/9kelab/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/9kelab/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/9kelab/proguard-rules.pro b/9kelab/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/9kelab/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/9kelab/release/9kelab.apk b/9kelab/release/9kelab.apk new file mode 100644 index 0000000..762bc56 Binary files /dev/null and b/9kelab/release/9kelab.apk differ diff --git a/9kelab/release/output-metadata.json b/9kelab/release/output-metadata.json new file mode 100644 index 0000000..c7da538 --- /dev/null +++ b/9kelab/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.kelab9", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "9kelab-release.apk" + } + ] +} \ No newline at end of file diff --git a/9kelab/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/9kelab/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/9kelab/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/9kelab/src/main/AndroidManifest.xml b/9kelab/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4c72acb --- /dev/null +++ b/9kelab/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/java/com/web/kelab9/MainActivity2.java b/9kelab/src/main/java/com/web/kelab9/MainActivity2.java new file mode 100644 index 0000000..c6aaeb0 --- /dev/null +++ b/9kelab/src/main/java/com/web/kelab9/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.kelab9; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 86; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://9kelab1.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/9kelab/src/main/java/com/web/kelab9/MyFirebaseMessageingService.java b/9kelab/src/main/java/com/web/kelab9/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0b758e2 --- /dev/null +++ b/9kelab/src/main/java/com/web/kelab9/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.kelab9; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/9kelab/src/main/java/com/web/kelab9/WebApplication.java b/9kelab/src/main/java/com/web/kelab9/WebApplication.java new file mode 100644 index 0000000..550fbf1 --- /dev/null +++ b/9kelab/src/main/java/com/web/kelab9/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.kelab9; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/9kelab/src/main/res/drawable-anydpi/ic_action_back.xml b/9kelab/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/9kelab/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/9kelab/src/main/res/drawable-hdpi/ic_action_back.png b/9kelab/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/9kelab/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/9kelab/src/main/res/drawable-mdpi/ic_action_back.png b/9kelab/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/9kelab/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/9kelab/src/main/res/drawable-v24/ic_launcher_foreground.xml b/9kelab/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/9kelab/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/drawable-xhdpi/ic_action_back.png b/9kelab/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/9kelab/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/9kelab/src/main/res/drawable-xxhdpi/ic_action_back.png b/9kelab/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/9kelab/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/9kelab/src/main/res/drawable/ic_launcher_background.xml b/9kelab/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/9kelab/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/9kelab/src/main/res/drawable/input_bg.xml b/9kelab/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/9kelab/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/9kelab/src/main/res/drawable/pass_word_bg.xml b/9kelab/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/9kelab/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/9kelab/src/main/res/drawable/pass_word_bg1.xml b/9kelab/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/9kelab/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/drawable/pass_word_bg2.xml b/9kelab/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/9kelab/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/drawable/shape_btn_bg.xml b/9kelab/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/9kelab/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/drawable/shape_dialog_bg2.xml b/9kelab/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/9kelab/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/drawable/shape_dialog_bg3.xml b/9kelab/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/9kelab/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/9kelab/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/mipmap-hdpi/ic_empty.png b/9kelab/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/9kelab/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/9kelab/src/main/res/mipmap-hdpi/ic_pull_down.png b/9kelab/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/9kelab/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_close.png b/9kelab/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_facebook.png b/9kelab/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_hometo.png b/9kelab/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_link.png b/9kelab/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_menu.png b/9kelab/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_shousuo.png b/9kelab/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_tel.png b/9kelab/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/9kelab/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/9kelab/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/9kelab/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/9kelab/src/main/res/mipmap-xxhdpi/app_logo.png b/9kelab/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..55f3e59 Binary files /dev/null and b/9kelab/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/9kelab/src/main/res/values-en/strings.xml b/9kelab/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c27f23e --- /dev/null +++ b/9kelab/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + 9KELAB + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/9kelab/src/main/res/values-night/themes.xml b/9kelab/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/9kelab/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/values/colors.xml b/9kelab/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/9kelab/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/9kelab/src/main/res/values/strings.xml b/9kelab/src/main/res/values/strings.xml new file mode 100644 index 0000000..5bf9647 --- /dev/null +++ b/9kelab/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + 9KELAB + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/values/style.xml b/9kelab/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/9kelab/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/values/themes.xml b/9kelab/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/9kelab/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/xml/app_updater_paths.xml b/9kelab/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/9kelab/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/xml/network_security_config.xml b/9kelab/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/9kelab/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/xml/provider_paths.xml b/9kelab/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/9kelab/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/9kelab/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/9kelab/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/9kelab/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Bbj/.gitignore b/Bbj/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Bbj/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Bbj/agn.jks b/Bbj/agn.jks new file mode 100644 index 0000000..7d66cac Binary files /dev/null and b/Bbj/agn.jks differ diff --git a/Bbj/bbj.jks b/Bbj/bbj.jks new file mode 100644 index 0000000..2c94a12 Binary files /dev/null and b/Bbj/bbj.jks differ diff --git a/Bbj/build.gradle b/Bbj/build.gradle new file mode 100644 index 0000000..21d9440 --- /dev/null +++ b/Bbj/build.gradle @@ -0,0 +1,105 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.bbj" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { +// debug { +// storeFile file('bbj.jks') +// storePassword "android2014" +// keyAlias 'key0' +// keyPassword "android2014" +// } +// release { +// storeFile file('bbj.jks') +// storePassword "android2014" +// keyAlias 'key0' +// keyPassword "android2014" +// } + + debug { + storeFile file('agn.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('agn.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Bbj/google-services.json b/Bbj/google-services.json new file mode 100644 index 0000000..9164786 --- /dev/null +++ b/Bbj/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "689386681720", + "project_id": "bbj1-283eb", + "storage_bucket": "bbj1-283eb.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:689386681720:android:a83b2b83f6b57066e5848d", + "android_client_info": { + "package_name": "com.web.bbj" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAa9G5cKqC0FPm15EHg9b-ZK7OjliRvNi8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Bbj/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Bbj/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Bbj/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Bbj/proguard-rules.pro b/Bbj/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Bbj/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Bbj/release/bbj.apk b/Bbj/release/bbj.apk new file mode 100644 index 0000000..796a064 Binary files /dev/null and b/Bbj/release/bbj.apk differ diff --git a/Bbj/release/output-metadata.json b/Bbj/release/output-metadata.json new file mode 100644 index 0000000..3a421f0 --- /dev/null +++ b/Bbj/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.bbj", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Bbj-release.apk" + } + ] +} \ No newline at end of file diff --git a/Bbj/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Bbj/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Bbj/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Bbj/src/main/AndroidManifest.xml b/Bbj/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4549415 --- /dev/null +++ b/Bbj/src/main/AndroidManifest.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/java/com/web/bbj/MainActivity2.java b/Bbj/src/main/java/com/web/bbj/MainActivity2.java new file mode 100644 index 0000000..0617f67 --- /dev/null +++ b/Bbj/src/main/java/com/web/bbj/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.bbj; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 87; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://bigbossjudi.online/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Bbj/src/main/java/com/web/bbj/MyFirebaseMessageingService.java b/Bbj/src/main/java/com/web/bbj/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ed1ba44 --- /dev/null +++ b/Bbj/src/main/java/com/web/bbj/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.bbj; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Bbj/src/main/java/com/web/bbj/WebApplication.java b/Bbj/src/main/java/com/web/bbj/WebApplication.java new file mode 100644 index 0000000..331d92b --- /dev/null +++ b/Bbj/src/main/java/com/web/bbj/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.bbj; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Bbj/src/main/res/drawable-anydpi/ic_action_back.xml b/Bbj/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Bbj/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Bbj/src/main/res/drawable-hdpi/ic_action_back.png b/Bbj/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Bbj/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Bbj/src/main/res/drawable-mdpi/ic_action_back.png b/Bbj/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Bbj/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Bbj/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Bbj/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Bbj/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/drawable-xhdpi/ic_action_back.png b/Bbj/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Bbj/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Bbj/src/main/res/drawable-xxhdpi/ic_action_back.png b/Bbj/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Bbj/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Bbj/src/main/res/drawable/ic_launcher_background.xml b/Bbj/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Bbj/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bbj/src/main/res/drawable/input_bg.xml b/Bbj/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Bbj/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Bbj/src/main/res/drawable/pass_word_bg.xml b/Bbj/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Bbj/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Bbj/src/main/res/drawable/pass_word_bg1.xml b/Bbj/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Bbj/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/drawable/pass_word_bg2.xml b/Bbj/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Bbj/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/drawable/shape_btn_bg.xml b/Bbj/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Bbj/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/drawable/shape_dialog_bg2.xml b/Bbj/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Bbj/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/drawable/shape_dialog_bg3.xml b/Bbj/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Bbj/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Bbj/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/mipmap-hdpi/ic_empty.png b/Bbj/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Bbj/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Bbj/src/main/res/mipmap-hdpi/ic_pull_down.png b/Bbj/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Bbj/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_close.png b/Bbj/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_facebook.png b/Bbj/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_hometo.png b/Bbj/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_link.png b/Bbj/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_menu.png b/Bbj/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Bbj/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_tel.png b/Bbj/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Bbj/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Bbj/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Bbj/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Bbj/src/main/res/mipmap-xxhdpi/app_logo.jpg b/Bbj/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..076f606 Binary files /dev/null and b/Bbj/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/Bbj/src/main/res/values-en/strings.xml b/Bbj/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..6aa0575 --- /dev/null +++ b/Bbj/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + BBJ + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Bbj/src/main/res/values-night/themes.xml b/Bbj/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Bbj/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/values/colors.xml b/Bbj/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Bbj/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Bbj/src/main/res/values/strings.xml b/Bbj/src/main/res/values/strings.xml new file mode 100644 index 0000000..bce5c3e --- /dev/null +++ b/Bbj/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + BBJ + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/values/style.xml b/Bbj/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Bbj/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/values/themes.xml b/Bbj/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Bbj/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/xml/app_updater_paths.xml b/Bbj/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Bbj/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/xml/network_security_config.xml b/Bbj/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Bbj/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Bbj/src/main/res/xml/provider_paths.xml b/Bbj/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Bbj/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Bbj/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Bbj/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Bbj/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Bintang918/.gitignore b/Bintang918/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Bintang918/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Bintang918/agn.jks b/Bintang918/agn.jks new file mode 100644 index 0000000..7d66cac Binary files /dev/null and b/Bintang918/agn.jks differ diff --git a/Bintang918/bintang.jks b/Bintang918/bintang.jks new file mode 100644 index 0000000..4c29021 Binary files /dev/null and b/Bintang918/bintang.jks differ diff --git a/Bintang918/build.gradle b/Bintang918/build.gradle new file mode 100644 index 0000000..2337db3 --- /dev/null +++ b/Bintang918/build.gradle @@ -0,0 +1,98 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.bintang918" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 109 + versionName "v1.0.9" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { +// debug { +// storeFile file('test.jks') +// storePassword "android2025" +// keyAlias 'key0' +// keyPassword "android2025" +// } +// release { +// storeFile file('test.jks') +// storePassword "android2025" +// keyAlias 'key0' +// keyPassword "android2025" +// } + + debug { + storeFile file('bintang.jks') + storePassword "dskj123456" + keyAlias 'key0' + keyPassword "dskj123456" + } + release { + storeFile file('bintang.jks') + storePassword "dskj123456" + keyAlias 'key0' + keyPassword "dskj123456" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + // implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Bintang918/google-services.json b/Bintang918/google-services.json new file mode 100644 index 0000000..508bc9a --- /dev/null +++ b/Bintang918/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "985316013410", + "project_id": "bintang918-ios", + "storage_bucket": "bintang918-ios.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:985316013410:android:1af4f1fec28e354cc6e83b", + "android_client_info": { + "package_name": "com.web.bintang918" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAhLRvWS13LTqexIcRVWptbPSXwcLmmLzM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Bintang918/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Bintang918/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Bintang918/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Bintang918/proguard-rules.pro b/Bintang918/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Bintang918/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Bintang918/release/Bintang918.apk b/Bintang918/release/Bintang918.apk new file mode 100644 index 0000000..eba46c8 Binary files /dev/null and b/Bintang918/release/Bintang918.apk differ diff --git a/Bintang918/release/output-metadata.json b/Bintang918/release/output-metadata.json new file mode 100644 index 0000000..e668e4e --- /dev/null +++ b/Bintang918/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.bintang918", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 109, + "versionName": "v1.0.9", + "outputFile": "Bintang918-release.apk" + } + ] +} \ No newline at end of file diff --git a/Bintang918/release/testweb.apk b/Bintang918/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/Bintang918/release/testweb.apk differ diff --git a/Bintang918/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Bintang918/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Bintang918/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Bintang918/src/main/AndroidManifest.xml b/Bintang918/src/main/AndroidManifest.xml new file mode 100644 index 0000000..31659d9 --- /dev/null +++ b/Bintang918/src/main/AndroidManifest.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/ic_launcher-playstore.png b/Bintang918/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..42ac644 Binary files /dev/null and b/Bintang918/src/main/ic_launcher-playstore.png differ diff --git a/Bintang918/src/main/java/com/web/bintang918/MainActivity2.java b/Bintang918/src/main/java/com/web/bintang918/MainActivity2.java new file mode 100644 index 0000000..ce5bb2e --- /dev/null +++ b/Bintang918/src/main/java/com/web/bintang918/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.bintang918; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 112; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://m.bintang918.net/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Bintang918/src/main/java/com/web/bintang918/MyFirebaseMessageingService.java b/Bintang918/src/main/java/com/web/bintang918/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ff98d8f --- /dev/null +++ b/Bintang918/src/main/java/com/web/bintang918/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.bintang918; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Bintang918/src/main/java/com/web/bintang918/WebApplication.java b/Bintang918/src/main/java/com/web/bintang918/WebApplication.java new file mode 100644 index 0000000..02531d6 --- /dev/null +++ b/Bintang918/src/main/java/com/web/bintang918/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.bintang918; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Bintang918/src/main/res/drawable-anydpi/ic_action_back.xml b/Bintang918/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Bintang918/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Bintang918/src/main/res/drawable-hdpi/ic_action_back.png b/Bintang918/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Bintang918/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Bintang918/src/main/res/drawable-mdpi/ic_action_back.png b/Bintang918/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Bintang918/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Bintang918/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Bintang918/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Bintang918/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable-xhdpi/ic_action_back.png b/Bintang918/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Bintang918/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Bintang918/src/main/res/drawable-xxhdpi/ic_action_back.png b/Bintang918/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Bintang918/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Bintang918/src/main/res/drawable/ic_launcher_background.xml b/Bintang918/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Bintang918/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bintang918/src/main/res/drawable/input_bg.xml b/Bintang918/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Bintang918/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Bintang918/src/main/res/drawable/pass_word_bg.xml b/Bintang918/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Bintang918/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Bintang918/src/main/res/drawable/pass_word_bg1.xml b/Bintang918/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..809aa87 --- /dev/null +++ b/Bintang918/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/pass_word_bg2.xml b/Bintang918/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Bintang918/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/shape_btn_bg.xml b/Bintang918/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Bintang918/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/shape_dialog_bg2.xml b/Bintang918/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Bintang918/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/shape_dialog_bg3.xml b/Bintang918/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Bintang918/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/shape_dialog_bg_new.xml b/Bintang918/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/Bintang918/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/drawable/shape_notify_typebg.xml b/Bintang918/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/Bintang918/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/Bintang918/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/mipmap-hdpi/ic_empty.png b/Bintang918/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Bintang918/src/main/res/mipmap-hdpi/ic_launcher.webp b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..fffc6ae Binary files /dev/null and b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..18174bf Binary files /dev/null and b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..e3a74ff Binary files /dev/null and b/Bintang918/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/Bintang918/src/main/res/mipmap-hdpi/ic_pull_down.png b/Bintang918/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Bintang918/src/main/res/mipmap-mdpi/ic_launcher.webp b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..1f4200b Binary files /dev/null and b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..96c8a3a Binary files /dev/null and b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..041adfd Binary files /dev/null and b/Bintang918/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_close.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_email.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..aaacc68 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_facebook.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_hometo.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher.webp b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..d36aef9 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..bb5aeb7 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..3a1083b Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_link.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_menu.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_email.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_tel.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Bintang918/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Bintang918/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Bintang918/src/main/res/mipmap-xxhdpi/app_logo.png b/Bintang918/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e5865c4 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..1f490fe Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..f9f2593 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..7c658d7 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..2dabbb7 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..eff72b9 Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..004580e Binary files /dev/null and b/Bintang918/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/Bintang918/src/main/res/values-en/strings.xml b/Bintang918/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..4528309 --- /dev/null +++ b/Bintang918/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Bintang918 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/Bintang918/src/main/res/values-night/themes.xml b/Bintang918/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Bintang918/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/values/colors.xml b/Bintang918/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/Bintang918/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/Bintang918/src/main/res/values/ic_launcher_background.xml b/Bintang918/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..ce076ff --- /dev/null +++ b/Bintang918/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #4B007F + \ No newline at end of file diff --git a/Bintang918/src/main/res/values/strings.xml b/Bintang918/src/main/res/values/strings.xml new file mode 100644 index 0000000..9606ff9 --- /dev/null +++ b/Bintang918/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + Bintang918 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/values/themes.xml b/Bintang918/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/Bintang918/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/xml/app_updater_paths.xml b/Bintang918/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Bintang918/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/xml/network_security_config.xml b/Bintang918/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Bintang918/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Bintang918/src/main/res/xml/provider_paths.xml b/Bintang918/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Bintang918/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Bintang918/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Bintang918/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Bintang918/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Bintang918/test.jks b/Bintang918/test.jks new file mode 100644 index 0000000..42f20c8 Binary files /dev/null and b/Bintang918/test.jks differ diff --git a/Candy916/.gitignore b/Candy916/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Candy916/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Candy916/build.gradle b/Candy916/build.gradle new file mode 100644 index 0000000..c4a8824 --- /dev/null +++ b/Candy916/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.candy916" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('candy916.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('candy916.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Candy916/candy916.jks b/Candy916/candy916.jks new file mode 100644 index 0000000..55a693b Binary files /dev/null and b/Candy916/candy916.jks differ diff --git a/Candy916/google-services.json b/Candy916/google-services.json new file mode 100644 index 0000000..fb6b775 --- /dev/null +++ b/Candy916/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "781378266710", + "project_id": "candy916-c855f", + "storage_bucket": "candy916-c855f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:781378266710:android:f3e21536744371fef37df7", + "android_client_info": { + "package_name": "com.web.candy916" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCkuJb0casxAIwDznLfbuUpnHytxPyvRxs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Candy916/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Candy916/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Candy916/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Candy916/proguard-rules.pro b/Candy916/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Candy916/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Candy916/release/candy916.apk b/Candy916/release/candy916.apk new file mode 100644 index 0000000..1752eb7 Binary files /dev/null and b/Candy916/release/candy916.apk differ diff --git a/Candy916/release/output-metadata.json b/Candy916/release/output-metadata.json new file mode 100644 index 0000000..ce2adce --- /dev/null +++ b/Candy916/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.candy916", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Candy916-release.apk" + } + ] +} \ No newline at end of file diff --git a/Candy916/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Candy916/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Candy916/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Candy916/src/main/AndroidManifest.xml b/Candy916/src/main/AndroidManifest.xml new file mode 100644 index 0000000..41b3f26 --- /dev/null +++ b/Candy916/src/main/AndroidManifest.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/java/com/web/candy916/MainActivity2.java b/Candy916/src/main/java/com/web/candy916/MainActivity2.java new file mode 100644 index 0000000..2217e29 --- /dev/null +++ b/Candy916/src/main/java/com/web/candy916/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.candy916; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 84; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://candy916.co/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Candy916/src/main/java/com/web/candy916/MyFirebaseMessageingService.java b/Candy916/src/main/java/com/web/candy916/MyFirebaseMessageingService.java new file mode 100644 index 0000000..9959e04 --- /dev/null +++ b/Candy916/src/main/java/com/web/candy916/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.candy916; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Candy916/src/main/java/com/web/candy916/WebApplication.java b/Candy916/src/main/java/com/web/candy916/WebApplication.java new file mode 100644 index 0000000..6504ff4 --- /dev/null +++ b/Candy916/src/main/java/com/web/candy916/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.candy916; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Candy916/src/main/res/drawable-anydpi/ic_action_back.xml b/Candy916/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Candy916/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Candy916/src/main/res/drawable-hdpi/ic_action_back.png b/Candy916/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Candy916/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Candy916/src/main/res/drawable-mdpi/ic_action_back.png b/Candy916/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Candy916/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Candy916/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Candy916/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Candy916/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/drawable-xhdpi/ic_action_back.png b/Candy916/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Candy916/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Candy916/src/main/res/drawable-xxhdpi/ic_action_back.png b/Candy916/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Candy916/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Candy916/src/main/res/drawable/ic_launcher_background.xml b/Candy916/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Candy916/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Candy916/src/main/res/drawable/input_bg.xml b/Candy916/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Candy916/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Candy916/src/main/res/drawable/pass_word_bg.xml b/Candy916/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Candy916/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Candy916/src/main/res/drawable/pass_word_bg1.xml b/Candy916/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Candy916/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/drawable/pass_word_bg2.xml b/Candy916/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Candy916/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/drawable/shape_btn_bg.xml b/Candy916/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Candy916/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/drawable/shape_dialog_bg2.xml b/Candy916/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Candy916/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/drawable/shape_dialog_bg3.xml b/Candy916/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Candy916/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Candy916/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/mipmap-hdpi/ic_empty.png b/Candy916/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Candy916/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Candy916/src/main/res/mipmap-hdpi/ic_pull_down.png b/Candy916/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Candy916/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_close.png b/Candy916/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_facebook.png b/Candy916/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_hometo.png b/Candy916/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_link.png b/Candy916/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_menu.png b/Candy916/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Candy916/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_tel.png b/Candy916/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Candy916/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Candy916/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Candy916/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Candy916/src/main/res/mipmap-xxhdpi/app_logo.png b/Candy916/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e8df001 Binary files /dev/null and b/Candy916/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Candy916/src/main/res/values-en/strings.xml b/Candy916/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..30f009b --- /dev/null +++ b/Candy916/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + CANDY916 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Candy916/src/main/res/values-night/themes.xml b/Candy916/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Candy916/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/values/colors.xml b/Candy916/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Candy916/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Candy916/src/main/res/values/strings.xml b/Candy916/src/main/res/values/strings.xml new file mode 100644 index 0000000..3ab88b4 --- /dev/null +++ b/Candy916/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + CANDY916 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/values/style.xml b/Candy916/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Candy916/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/values/themes.xml b/Candy916/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Candy916/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/xml/app_updater_paths.xml b/Candy916/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Candy916/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/xml/network_security_config.xml b/Candy916/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Candy916/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Candy916/src/main/res/xml/provider_paths.xml b/Candy916/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Candy916/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Candy916/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Candy916/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Candy916/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Cashsweep/.gitignore b/Cashsweep/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Cashsweep/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Cashsweep/build.gradle b/Cashsweep/build.gradle new file mode 100644 index 0000000..5f92a89 --- /dev/null +++ b/Cashsweep/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.cashsweep" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('cashsweep.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('cashsweep.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Cashsweep/cashsweep.jks b/Cashsweep/cashsweep.jks new file mode 100644 index 0000000..459fbbd Binary files /dev/null and b/Cashsweep/cashsweep.jks differ diff --git a/Cashsweep/google-services.json b/Cashsweep/google-services.json new file mode 100644 index 0000000..f828a48 --- /dev/null +++ b/Cashsweep/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1031748028680", + "project_id": "cashsweep-beb4b", + "storage_bucket": "cashsweep-beb4b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1031748028680:android:a1a4f6c28e4a8154b904bd", + "android_client_info": { + "package_name": "com.web.cashsweep" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDh-TxSgmb0mESS7ge9knRaePZgyJWmx4w" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Cashsweep/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Cashsweep/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Cashsweep/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Cashsweep/proguard-rules.pro b/Cashsweep/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Cashsweep/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Cashsweep/release/Cashsweep.apk b/Cashsweep/release/Cashsweep.apk new file mode 100644 index 0000000..4ac5184 Binary files /dev/null and b/Cashsweep/release/Cashsweep.apk differ diff --git a/Cashsweep/release/output-metadata.json b/Cashsweep/release/output-metadata.json new file mode 100644 index 0000000..ad79b01 --- /dev/null +++ b/Cashsweep/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.cashsweep", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Cashsweep-release.apk" + } + ] +} \ No newline at end of file diff --git a/Cashsweep/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Cashsweep/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Cashsweep/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Cashsweep/src/main/AndroidManifest.xml b/Cashsweep/src/main/AndroidManifest.xml new file mode 100644 index 0000000..537aea1 --- /dev/null +++ b/Cashsweep/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/java/com/web/cashsweep/MainActivity2.java b/Cashsweep/src/main/java/com/web/cashsweep/MainActivity2.java new file mode 100644 index 0000000..6cad8c2 --- /dev/null +++ b/Cashsweep/src/main/java/com/web/cashsweep/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.cashsweep; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 88; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.cashsweep3.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java b/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java new file mode 100644 index 0000000..67f2eca --- /dev/null +++ b/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.cashsweep; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Cashsweep/src/main/java/com/web/cashsweep/WebApplication.java b/Cashsweep/src/main/java/com/web/cashsweep/WebApplication.java new file mode 100644 index 0000000..381358b --- /dev/null +++ b/Cashsweep/src/main/java/com/web/cashsweep/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.cashsweep; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Cashsweep/src/main/res/drawable-anydpi/ic_action_back.xml b/Cashsweep/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Cashsweep/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Cashsweep/src/main/res/drawable-hdpi/ic_action_back.png b/Cashsweep/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Cashsweep/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Cashsweep/src/main/res/drawable-mdpi/ic_action_back.png b/Cashsweep/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Cashsweep/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Cashsweep/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Cashsweep/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Cashsweep/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/drawable-xhdpi/ic_action_back.png b/Cashsweep/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Cashsweep/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Cashsweep/src/main/res/drawable-xxhdpi/ic_action_back.png b/Cashsweep/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Cashsweep/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Cashsweep/src/main/res/drawable/ic_launcher_background.xml b/Cashsweep/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Cashsweep/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Cashsweep/src/main/res/drawable/input_bg.xml b/Cashsweep/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Cashsweep/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Cashsweep/src/main/res/drawable/pass_word_bg.xml b/Cashsweep/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Cashsweep/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Cashsweep/src/main/res/drawable/pass_word_bg1.xml b/Cashsweep/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Cashsweep/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/drawable/pass_word_bg2.xml b/Cashsweep/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Cashsweep/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/drawable/shape_btn_bg.xml b/Cashsweep/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Cashsweep/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/drawable/shape_dialog_bg2.xml b/Cashsweep/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Cashsweep/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/drawable/shape_dialog_bg3.xml b/Cashsweep/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Cashsweep/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Cashsweep/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/mipmap-hdpi/ic_empty.png b/Cashsweep/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Cashsweep/src/main/res/mipmap-hdpi/ic_pull_down.png b/Cashsweep/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_close.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_facebook.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_hometo.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_link.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_menu.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_tel.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Cashsweep/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Cashsweep/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Cashsweep/src/main/res/mipmap-xxhdpi/app_logo.png b/Cashsweep/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a5c27f1 Binary files /dev/null and b/Cashsweep/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Cashsweep/src/main/res/values-en/strings.xml b/Cashsweep/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..fb54144 --- /dev/null +++ b/Cashsweep/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + CashSweep888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/values-night/themes.xml b/Cashsweep/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Cashsweep/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/values/colors.xml b/Cashsweep/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Cashsweep/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/values/strings.xml b/Cashsweep/src/main/res/values/strings.xml new file mode 100644 index 0000000..23773a7 --- /dev/null +++ b/Cashsweep/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + CashSweep888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/values/style.xml b/Cashsweep/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Cashsweep/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/values/themes.xml b/Cashsweep/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Cashsweep/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/xml/app_updater_paths.xml b/Cashsweep/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Cashsweep/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/xml/network_security_config.xml b/Cashsweep/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Cashsweep/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Cashsweep/src/main/res/xml/provider_paths.xml b/Cashsweep/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Cashsweep/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Cashsweep/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Cashsweep/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Cashsweep/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Dmcslot/.gitignore b/Dmcslot/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Dmcslot/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Dmcslot/build.gradle b/Dmcslot/build.gradle new file mode 100644 index 0000000..c55c531 --- /dev/null +++ b/Dmcslot/build.gradle @@ -0,0 +1,83 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.dmcslot" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 100 + versionName "v1.0.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('dmcslot.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('dmcslot.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + // implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") +} \ No newline at end of file diff --git a/Dmcslot/dmcslot.jks b/Dmcslot/dmcslot.jks new file mode 100644 index 0000000..6dff33b Binary files /dev/null and b/Dmcslot/dmcslot.jks differ diff --git a/Dmcslot/google-services.json b/Dmcslot/google-services.json new file mode 100644 index 0000000..e31f128 --- /dev/null +++ b/Dmcslot/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "184962620137", + "project_id": "dmcslot-edbc0", + "storage_bucket": "dmcslot-edbc0.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:184962620137:android:3d0ae8c24859e74df8ae78", + "android_client_info": { + "package_name": "com.web.dmcslot" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB8-HvXapf4L-yB16Kmun17j3PlYMcbh5w" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Dmcslot/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Dmcslot/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Dmcslot/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Dmcslot/proguard-rules.pro b/Dmcslot/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Dmcslot/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Dmcslot/release/dmcslot.apk b/Dmcslot/release/dmcslot.apk new file mode 100644 index 0000000..7437894 Binary files /dev/null and b/Dmcslot/release/dmcslot.apk differ diff --git a/Dmcslot/release/output-metadata.json b/Dmcslot/release/output-metadata.json new file mode 100644 index 0000000..285ec65 --- /dev/null +++ b/Dmcslot/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.dmcslot", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 100, + "versionName": "v1.0.0", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/Dmcslot/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Dmcslot/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Dmcslot/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Dmcslot/src/main/AndroidManifest.xml b/Dmcslot/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fe88ffb --- /dev/null +++ b/Dmcslot/src/main/AndroidManifest.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java new file mode 100644 index 0000000..90e7e3c --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java @@ -0,0 +1,214 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyBankListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + } + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } +// if (o.data != null && o.data.size() > 0) { +// listdata.clear(); +// listdata.addAll(o.data); +// adapter.setListdata(listdata); +// recyclerView.setVisibility(View.VISIBLE); +// } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java new file mode 100644 index 0000000..3c812d6 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java new file mode 100644 index 0000000..62ae5cf --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java @@ -0,0 +1,105 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..e7fa52c --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java @@ -0,0 +1,129 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.database.DataSetObserver; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.ListAdapter; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.web.dmcslot.R; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java new file mode 100644 index 0000000..ea0b6e9 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java @@ -0,0 +1,119 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + +// private void fullScreenImmersive(View view) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { +// int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE +// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION +// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION +// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY +// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN +// | View.SYSTEM_UI_FLAG_FULLSCREEN; +// view.setSystemUiVisibility(uiOptions); +// } +// } +// +// @Override +// public void show() { +// this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); +// super.show(); +// fullScreenImmersive(getWindow().getDecorView()); +// this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); +// } + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..8dff527 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java @@ -0,0 +1,114 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java b/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..536a7a4 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.dmcslot; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Api.java b/Dmcslot/src/main/java/com/web/dmcslot/Api.java new file mode 100644 index 0000000..ce9ec53 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/Api.java @@ -0,0 +1,68 @@ +package com.web.dmcslot; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ApiService.java b/Dmcslot/src/main/java/com/web/dmcslot/ApiService.java new file mode 100644 index 0000000..3598ab6 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ApiService.java @@ -0,0 +1,109 @@ +package com.web.dmcslot; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Path; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + public static final String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java new file mode 100644 index 0000000..ec9102f --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.dmcslot; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java b/Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java new file mode 100644 index 0000000..7e50f30 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.dmcslot; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java b/Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java new file mode 100644 index 0000000..9effb6d --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java @@ -0,0 +1,115 @@ +package com.web.dmcslot; + +import android.text.TextUtils; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java b/Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java new file mode 100644 index 0000000..6cc10bd --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.dmcslot; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java b/Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java new file mode 100644 index 0000000..5e583f6 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.dmcslot; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java new file mode 100644 index 0000000..7f83a46 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java @@ -0,0 +1,126 @@ +package com.web.dmcslot; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java b/Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java new file mode 100644 index 0000000..da5e994 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java @@ -0,0 +1,57 @@ +package com.web.dmcslot; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java new file mode 100644 index 0000000..025b921 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.dmcslot; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java new file mode 100644 index 0000000..c1d6448 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.dmcslot; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java new file mode 100644 index 0000000..eb4f7bd --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.dmcslot; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java new file mode 100644 index 0000000..d6a8966 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.dmcslot; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java new file mode 100644 index 0000000..9943c14 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.dmcslot; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity.java b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity.java new file mode 100644 index 0000000..f83673a --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity.java @@ -0,0 +1,385 @@ +package com.web.dmcslot; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import org.w3c.dom.Text; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + +// if(getIntent().getBooleanExtra("isChange",false)){ +// toNextActivity(); +// }else{ +// findViewById(R.id.big_v).setVisibility(View.VISIBLE); +// } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.btn_0: + addInput("0"); + break; + case R.id.btn_1: + addInput("1"); + break; + case R.id.btn_2: + addInput("2"); + break; + case R.id.btn_3: + addInput("3"); + break; + case R.id.btn_4: + addInput("4"); + break; + case R.id.btn_5: + addInput("5"); + break; + case R.id.btn_6: + addInput("6"); + break; + case R.id.btn_7: + addInput("7"); + break; + case R.id.btn_8: + addInput("8"); + break; + case R.id.btn_9: + addInput("9"); + break; + case R.id.btn_point: + addInput("."); + break; + case R.id.btn_add: + addInput("+"); + break; + case R.id.btn_subtract: + addInput("-"); + break; + case R.id.btn_multiply: + addInput("*"); + break; + case R.id.btn_divide: + addInput("/"); + break; + case R.id.btn_backspace: + if (currentInput.length() > 0) { + currentInput.deleteCharAt(currentInput.length() - 1); + } + displayInput(); + break; + case R.id.btn_clear: + currentInput = new StringBuilder(""); + displayInput(); + outputTextView.setText(""); + break; + case R.id.btn_equal: + StringBuilder result = compute(currentInput); + displayAnswer(result); + hasCount = true; + break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java new file mode 100644 index 0000000..6c1201a --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java @@ -0,0 +1,1728 @@ +package com.web.dmcslot; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.NotificationManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.database.Cursor; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import androidx.core.view.WindowCompat; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.firebase.messaging.FirebaseMessaging; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import com.web.dmcslot.appdown.AppUpdater; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import com.web.dmcslot.appdown.constant.Constants; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + //https://m.xiannvtu.com/ + //https://m.xiannvtu.com/ + public static String url = "https://dmcslot1.com/"; + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private int userId = 110; + private int notifyVisible = View.GONE; + + private String shareUrl; + private String myInviteCode; + private int myInviteNum; + + private int contactApply = 1; + private int notifyApply = 1; + + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + startNotify(messageInfo); + } + } + + public void startNotify(MessageInfo messageInfo) { + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } +// if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) { +// startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo)); +// } else { +// recordNotify(messageInfo.getPushId()); +// } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { +// if (Build.VERSION.SDK_INT >= 30) { +// } else { +// setTheme(R.style.AppThemeStart1); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); +// getWindow().setStatusBarColor(Color.TRANSPARENT); +// } +// if (Build.VERSION.SDK_INT >= 33) { +// getWindow().setDecorFitsSystemWindows(false); +// } else { +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// } +// super.onCreate(savedInstanceState); + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); +// View bottomV = findViewById(R.id.bottom_v); +// if (Build.VERSION.SDK_INT >= 30) { +// ViewGroup.LayoutParams layoutParams = bottomV.getLayoutParams(); +// layoutParams.height = getNavigationBarHeight(this); +// bottomV.setLayoutParams(layoutParams); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); +// } + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + startNotify(messageInfo); + } + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); +// FirebaseMessaging.getInstance().getToken() +// .addOnCompleteListener(new OnCompleteListener() { +// @Override +// public void onComplete(@NonNull Task task) { +// if (!task.isSuccessful()) { +// LogUtils.d("Fetching FCM registration token failed" + task.getException()); +// return; +// } +// +// // Get new FCM registration token +// String token = task.getResult(); +// +// // Log and toast +// +// LogUtils.d("token=="+token); +// } +// }); + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); +// List telpacks = new ArrayList<>(); +// telpacks.add("org.telegram.messenger"); +// telpacks.add("org.telegram.messenger.web"); + ivNotify.setOnClickListener(view -> { + notifyclick(); + }); + ivFaceBook.setOnClickListener(view -> { + //isLuncher = false; + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + // isLuncher = false; + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + //isLuncher = false; + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); + ivLink.setOnClickListener(view -> { + //isLuncher = false; + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + }); + ivHome.setOnClickListener(view -> { + //isLuncher = false; + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + notifyCardView.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + // getMyInvite(false); + setTotalTongJi(); //每日活跃统计 + +// findViewById(R.id.home).setOnClickListener(view -> { +// webView.loadUrl(url); +// }); +// findViewById(R.id.tv_other).setOnClickListener(view -> { +// if (TextUtils.isEmpty(linkconfig)) { +// linkconfig = "https://missav.com/dm37"; +// } +// webView.loadUrl(linkconfig); +// }); + + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + +// if (type == 1) { +// try { +// // 跳转到 Facebook 应用的页面(使用 URI 的页面 ID 或用户名) +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<" + uri + ">")); // 替换 +// startActivity(intent); +// } catch (Exception e) { +// // 如果没有安装 Facebook 应用,跳转到网页 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<" + uri + ">")); // 替换 +// startActivity(intent); +// } +// } +// if (type == 2) { +// try { +// // 跳转到 Telegram 应用中的特定用户 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=<" + uri + ">")); // 替换 +// startActivity(intent); +// } catch (Exception e) { +// // 如果 Telegram 未安装,跳转到网页版 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/<" + uri + ">")); // 替换 +// startActivity(intent); +// } +// +// } +// +// if (type == 3) { +// Intent intent = getPackageManager().getLaunchIntentForPackage("com.whatsapp"); +// if (intent != null) { +// startActivity(intent); +// } else { +// // WhatsApp 未安装,跳转到 Google Play 商店 +// Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.whatsapp")); +// startActivity(playStoreIntent); +// } +// +// } + //https://www.facebook.com/profile.php?id=61568556460025 + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + layoutOtherApp.setVisibility(View.GONE); + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + + private boolean isLuncher = false; + + //多个APPName + private void toOtherApps(String uri, List packagenames) { + int i = 0; + while (i < packagenames.size() && !isLuncher) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames.get(i)); + startActivity(intent); + isLuncher = true; + } catch (Exception e) { + i++; + isLuncher = false; + } + } + if (!isLuncher) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + +// if (intent.resolveActivity(getPackageManager()) != null) { +// startActivity(intent); +// } else { +// Toast.makeText(this, getString(R.string.app_notinstall), Toast.LENGTH_SHORT).show(); +// } + } + + public int getNavigationBarHeight(Context context) { + Resources resources = context.getResources(); + int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); + return resources.getDimensionPixelSize(resourceId); + } + + private boolean isAppInstall(String packagename) { + PackageManager packageManager = getPackageManager(); + try { + PackageInfo packageInfo = packageManager.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES); + if (packageInfo != null) { + return true; + } + } catch (Exception e) { + return false; + } + return false; + } + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + +// // Declare the launcher at the top of your Activity/Fragment: +// private final ActivityResultLauncher requestPermissionLauncher = +// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { +// if (isGranted) { +// // FCM SDK (and your app) can post notifications. +// } else { +// // TODO: Inform user that that your app will not show notifications. +// } +// }); + +// private void askNotificationPermission() { +// // This is only necessary for API level >= 33 (TIRAMISU) +// if (Build.VERSION.SDK_INT >= 33) { +// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) == +// PackageManager.PERMISSION_GRANTED) { +// // FCM SDK (and your app) can post notifications. +// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { +// // TODO: display an educational UI explaining to the user the features that will be enabled +// // by them granting the POST_NOTIFICATION permission. This UI should provide the user +// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission. +// // If the user selects "No thanks," allow the user to continue without notifications. +// } else { +// // Directly ask for the permission +// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); +// } +// } +// } + + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + public void removeChildView(int child) { + WebView childView = (WebView) webView.getChildAt(child - 1); + webView.removeView(childView); + if (webView.canGoBack()) { + webView.goBack(); + } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.dmcslot.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.dmcslot.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + // notifyVisible = View.VISIBLE; + otherApp.setVisibility(View.VISIBLE); + ivNotify.setVisibility(View.VISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > BuildConfig.VERSION_CODE) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { + readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivWhatsApp.setVisibility(View.VISIBLE); + } +// if (linkconfiglist != null && linkconfiglist.size() > 0) { +// otherApp.setVisibility(View.VISIBLE); +// ivLink.setVisibility(View.VISIBLE); +// tvLink.setText(linkconfiglist.get(0).getName()); +// ivHome.setVisibility(View.VISIBLE); +// Glide.with(MainActivity2.this).load(linkconfiglist.get(0).getIcon()).error(R.color.dialog_bg).into(ivLinkBg); +// } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); +// Api.getInstance().geUrlNew(userId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:" + o.url); +// if (!TextUtils.isEmpty(o.url)) { +// MainActivity.saveString(MainActivity2.this, "base_url", o.url); +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); + } + + public void getVersionUrl() { +// Api.getInstance().getVersion(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// if (!TextUtils.isEmpty(o.version_code)) { +// if (Integer.parseInt(o.version_code) > com.web.dmcslot.BuildConfig.VERSION_CODE) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(o.url); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// actionDialog.show(); +// } +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + private void checkUpdate(String url) { + Constants.isUpdate = true; + new AppUpdater(this, url).start(); + + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(new Runnable() { + @Override + public void run() { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + } + }).start(); + + + } + } + + public List removeSameContact(List contents) { + List contactBeans = new ArrayList(); + for (int i = 0; i < contents.size(); i++) { + String phone = contents.get(i).getPhone(); + if (contactBeans.contains(phone)) { + contents.remove(i); + } else { + contactBeans.add(phone); + } + } + return contents; + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + ActionInviteDialog invitedDialog; + + //展示邀请码 + public void showInviteCode() { + invitedDialog = new ActionInviteDialog(MainActivity2.this, + false); + invitedDialog.setOnToActionListener(new ActionInviteDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + checkInvited(content); + } + + @Override + public void toCancel() { + + } + }); + invitedDialog.setCanceledOnTouchOutside(false); + invitedDialog.setCancelable(false); + invitedDialog.show(); + + } + + public void checkInvited(String code) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("code", code); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().checkInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.isSuccessful() && invitedDialog != null) { + invitedDialog.dismiss(); + MainActivity.saveBoolean(MainActivity2.this, "invited", true); + MainActivity.saveString(MainActivity2.this, "code", code); + } + + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(MainActivity2.this, msg + "", Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + if (o.code == 40001) { + invitedDialog.dismiss(); + MainActivity.saveBoolean(MainActivity2.this, "invited", true); + MainActivity.saveString(MainActivity2.this, "code", o.data.getInviteCode()); + } + Toast.makeText(MainActivity2.this, TextUtils.isEmpty(o.message) ? o.error : o.message, Toast.LENGTH_SHORT).show(); + } + }); + } + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); + myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); +// notifyCardView.setVisibility(notifyVisible); + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + +// if (isNetError&&isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// try { +// startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); +// } catch (ActivityNotFoundException e) { +//// mUploadCallbackForHighApi = null; +//// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); +// // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); +// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// return true; +// } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + getNotifyList(); + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java new file mode 100644 index 0000000..b30a886 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java @@ -0,0 +1,568 @@ +package com.web.dmcslot; + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.DownloadManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.DownloadListener; +import android.webkit.ValueCallback; +import com.just.agentweb.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import com.just.agentweb.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import com.just.agentweb.AgentWeb; +//import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +//import com.tencent.smtt.sdk.DownloadListener; +//import com.tencent.smtt.sdk.URLUtil; +//import com.tencent.smtt.sdk.ValueCallback; +//import com.tencent.smtt.sdk.WebChromeClient; +//import com.tencent.smtt.sdk.WebSettings; +//import com.tencent.smtt.sdk.WebView; +//import com.tencent.smtt.sdk.WebViewClient; + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.dmcslot.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.dmcslot.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java new file mode 100644 index 0000000..c8988a3 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.dmcslot; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java b/Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java new file mode 100644 index 0000000..315d687 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.dmcslot; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java b/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e426ed0 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java @@ -0,0 +1,174 @@ +package com.web.dmcslot; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.Uri; +import android.os.Build; +import android.text.TextUtils; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java b/Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java new file mode 100644 index 0000000..33bdccb --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.dmcslot; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java b/Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java new file mode 100644 index 0000000..772293f --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java @@ -0,0 +1,154 @@ +package com.web.dmcslot; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java b/Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..6ad6759 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.dmcslot; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java b/Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java new file mode 100644 index 0000000..2122457 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java @@ -0,0 +1,386 @@ +package com.web.dmcslot; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java b/Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java new file mode 100644 index 0000000..d267e53 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.dmcslot; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { + Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Result.java b/Dmcslot/src/main/java/com/web/dmcslot/Result.java new file mode 100644 index 0000000..511727b --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/Result.java @@ -0,0 +1,31 @@ +package com.web.dmcslot; + + +import java.io.Serializable; + +import com.web.dmcslot.GsonUtils; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java new file mode 100644 index 0000000..3825da0 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.dmcslot; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java b/Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java new file mode 100644 index 0000000..4439707 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java @@ -0,0 +1,233 @@ +package com.web.dmcslot; + +import android.app.AlarmManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.btn_0: + addInput("0", 0); + break; + case R.id.btn_1: + addInput("1", 0); + break; + case R.id.btn_2: + addInput("2", 0); + break; + case R.id.btn_3: + addInput("3", 0); + break; + case R.id.btn_4: + addInput("4", 0); + break; + case R.id.btn_5: + addInput("5", 0); + break; + case R.id.btn_6: + addInput("6", 0); + break; + case R.id.btn_7: + addInput("7", 0); + break; + case R.id.btn_8: + addInput("8", 0); + break; + case R.id.btn_9: + addInput("9", 0); + break; + + case R.id.btn_equal: + deleteInput(); + break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java b/Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java new file mode 100644 index 0000000..7922344 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.dmcslot; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Utils.java b/Dmcslot/src/main/java/com/web/dmcslot/Utils.java new file mode 100644 index 0000000..370c261 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/Utils.java @@ -0,0 +1,70 @@ +package com.web.dmcslot; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Build; +import android.provider.Settings; + +import java.security.NoSuchAlgorithmException; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + if (context == null) { + context = WebApplication.application; + } + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WebApplication.java b/Dmcslot/src/main/java/com/web/dmcslot/WebApplication.java new file mode 100644 index 0000000..8bfbafc --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.dmcslot; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java b/Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java new file mode 100644 index 0000000..a8af6ec --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java @@ -0,0 +1,340 @@ +package com.web.dmcslot; + +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; + +import com.web.dmcslot.appdown.AppUpdater; +import com.web.dmcslot.appdown.UpdateConfig; +import com.web.dmcslot.appdown.constant.Constants; +import com.web.dmcslot.appdown.util.AppUtils; +import com.web.dmcslot.appdown.util.NotificationUtils; + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); + Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java b/Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java new file mode 100644 index 0000000..8a18afd --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java @@ -0,0 +1,389 @@ +package com.web.dmcslot; + +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; + +import com.web.dmcslot.appdown.AppUpdater; +import com.web.dmcslot.appdown.UpdateConfig; +import com.web.dmcslot.appdown.constant.Constants; +import com.web.dmcslot.appdown.util.AppUtils; +import com.web.dmcslot.appdown.util.NotificationUtils; + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); + Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java b/Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java new file mode 100644 index 0000000..3471d52 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.dmcslot; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java new file mode 100644 index 0000000..f9e5e57 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java @@ -0,0 +1,384 @@ +package com.web.dmcslot.appdown; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.text.TextUtils; +import android.util.Log; + +import com.web.dmcslot.appdown.callback.UpdateCallback; +import com.web.dmcslot.appdown.constant.Constants; +import com.web.dmcslot.appdown.http.HttpManager; +import com.web.dmcslot.appdown.http.IHttpManager; +import com.web.dmcslot.appdown.http.OkHttpManager; +import com.web.dmcslot.appdown.service.DownloadService; +import com.web.dmcslot.appdown.util.PermissionUtils; + + +import java.util.Map; + +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; + + + +/** + * @author Jenly Jenly + */ +public class AppUpdater { + /** + * {@link #mContext}不强制要求是{@link Activity},但能传{@link Activity}尽量传。AppUpdater本应该只专注于App更新,尽量不涉及动态权限相关的处理。如果mContext传的是{@link Activity},则默认会校验一次动态权限。 + */ + private Context mContext; + /** + * 配置信息 + */ + private UpdateConfig mConfig; + /** + * 更新回调 + */ + private UpdateCallback mCallback; + /** + * http管理接口,可自定义实现。如:使用okHttp + */ + private IHttpManager mHttpManager; + + private ServiceConnection mServiceConnection; + + public AppUpdater(@NonNull Context context,@NonNull UpdateConfig config){ + this.mContext = context; + this.mConfig = config; + } + + public AppUpdater(@NonNull Context context,@NonNull String url){ + this.mContext = context; + mConfig = new UpdateConfig(); + mConfig.setUrl(url); + } + + /** + * 设置下载更新进度回调 + * @param callback + * @return + */ + public AppUpdater setUpdateCallback(UpdateCallback callback){ + this.mCallback = callback; + return this; + } + + /** + * 设置一个IHttpManager + * @param httpManager AppUpdater内置提供{@link HttpManager} 和 {@link OkHttpManager}两种实现。 + * 如果不设置,将默认使用{@link HttpManager},你也可以使用{@link OkHttpManager}或自己去实现一个 + * {@link IHttpManager}。 + * 当使用{@link OkHttpManager}时,必需依赖okhttp库 + * @return + */ + public AppUpdater setHttpManager(IHttpManager httpManager){ + this.mHttpManager = httpManager; + return this; + } + + /** + * 开始下载 + */ + public void start(){ + if(mConfig != null && !TextUtils.isEmpty(mConfig.getUrl())){ + //如果mContext是Activity,并且配置了下载路径,则默认会校验一次动态权限。 + if(mContext instanceof Activity && !TextUtils.isEmpty(mConfig.getPath())){ + PermissionUtils.verifyReadAndWritePermissions((Activity) mContext,Constants.RE_CODE_STORAGE_PERMISSION); + } + + if(mConfig.isShowNotification() && !PermissionUtils.isNotificationEnabled(mContext)){ + Log.w(Constants.TAG,"Notification permission not enabled."); + } + + startDownloadService(); + }else{ + throw new NullPointerException("Url must not be empty."); + } + } + + /** + * 启动下载服务 + */ + private void startDownloadService(){ + Intent intent = new Intent(mContext, DownloadService.class); + if(mCallback!=null || mHttpManager!=null){//bindService + mServiceConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + DownloadService.DownloadBinder binder = ((DownloadService.DownloadBinder)service); + binder.start(mConfig,mHttpManager,mCallback); + } + + @Override + public void onServiceDisconnected(ComponentName name) { + + } + }; + + mContext.getApplicationContext().bindService(intent,mServiceConnection, Context.BIND_AUTO_CREATE); + }else{//startService + intent.putExtra(Constants.KEY_UPDATE_CONFIG,mConfig); + mContext.startService(intent); + } + } + + /** + * 取消下载 + */ + public void stop(){ + stopDownloadService(); + } + + /** + * 停止下载服务 + */ + private void stopDownloadService(){ + Intent intent = new Intent(mContext, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + mContext.startService(intent); + } + + /** + * AppUpdater建造者 + */ + public static class Builder{ + + + private UpdateConfig mConfig; + + public Builder(){ + mConfig = new UpdateConfig(); + } + + /** + * 设置APK下载地址 + * @param url 下载地址 + * @return + */ + public Builder setUrl(@NonNull String url){ + mConfig.setUrl(url); + return this; + } + + /** + * 设置保存的路径,(建议使用默认,不做设置) + * @param path 下载保存的文件路径 + * @return + * @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用 + */ + @Deprecated + public Builder setPath(String path){ + mConfig.setPath(path); + return this; + } + + /** + * 设置保存的文件名 + * @param filename 下载的保存的apk文件名 (默认优先取url文件名) + * @return + */ + public Builder setFilename(String filename){ + mConfig.setFilename(filename); + return this; + } + + /** + * 设置是否显示通知栏 + * @param isShowNotification 是否显示通知栏 (默认true) + * @return + */ + public Builder setShowNotification(boolean isShowNotification) { + mConfig.setShowNotification(isShowNotification); + return this; + } + + /** + * 设置通知ID + * @param notificationId 通知ID + * @return + */ + public Builder setNotificationId(int notificationId) { + mConfig.setNotificationId(notificationId); + return this; + } + + /** + * 设置通知渠道ID + * @param channelId 通知渠道ID (默认兼容O) + * @return + */ + public Builder setChannelId(String channelId) { + mConfig.setChannelId(channelId); + return this; + } + + /** + * 设置通知渠道名称 + * @param channelName 通知渠道名称 (默认兼容O) + * @return + */ + public Builder setChannelName(String channelName) { + mConfig.setChannelName(channelName); + return this; + } + + /** + * 设置通知图标 + * @param icon 通知栏图标 (默认取App的icon) + * @return + */ + public Builder setNotificationIcon(@DrawableRes int icon) { + mConfig.setNotificationIcon(icon); + return this; + } + + /** + * 设置通知是否震动提示 + * @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + * @return + */ + public Builder setVibrate(boolean vibrate) { + mConfig.setVibrate(vibrate); + return this; + } + + /** + * 设置通知是否铃声提示 + * @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + * @return + */ + public Builder setSound(boolean sound) { + mConfig.setSound(sound); + return this; + } + + + /** + * 设置下载完成后知否自动触发安装APK + * @param isInstallApk 下载完成后是否自动调用安装APK(默认true) + * @return + */ + public Builder setInstallApk(boolean isInstallApk){ + mConfig.setInstallApk(isInstallApk); + return this; + } + + /** + * 设置FileProvider的authority + * @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"}) + * @return + */ + public Builder setAuthority(String authority){ + mConfig.setAuthority(authority); + return this; + } + + /** + * 设置下载时,通知栏是否显示下载百分比 + * @param showPercentage 下载时通知栏是否显示百分比 + * @return + */ + public Builder setShowPercentage(boolean showPercentage) { + mConfig.setShowPercentage(showPercentage); + return this; + } + + /** + * 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)} + * @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true + * @return + */ + public Builder setReDownload(boolean reDownload) { + mConfig.setReDownload(reDownload); + return this; + } + + /** + * 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)} + * @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次 + * @return + */ + public Builder setReDownloads(int reDownloads) { + mConfig.setReDownloads(reDownloads); + return this; + } + + /** + * 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。 + * 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。 + * @return + */ + public Builder setVersionCode(Integer versionCode) { + mConfig.setVersionCode(versionCode); + return this; + } + + /** + * 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存 + * @return + */ + public Builder setApkMD5(String md5) { + mConfig.setApkMD5(md5); + return this; + } + /** + * 请求头添加参数 + * @param key + * @param value + * @return + */ + public Builder addHeader(String key, String value){ + mConfig.addHeader(key,value); + return this; + } + + /** + * 请求头添加参数 + * @param headers + * @return + */ + public Builder addHeader(Map headers){ + mConfig.addHeader(headers); + return this; + } + + /** + * 设置是否自动删除取消下载的文件 + * @param deleteCancelFile 是否删除取消下载的文件(默认为true) + */ + public Builder setDeleteCancelFile(boolean deleteCancelFile){ + mConfig.setDeleteCancelFile(deleteCancelFile); + return this; + } + + /** + * 是否支持通过删除通知栏来取消下载(默认为:false) + * @param cancelDownload + * @return + */ + public Builder setCancelDownload(boolean cancelDownload){ + mConfig.setCancelDownload(cancelDownload); + return this; + } + + + public AppUpdater build(@NonNull Context context){ + return new AppUpdater(context,mConfig); + } + + } + + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java new file mode 100644 index 0000000..9d11caa --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java @@ -0,0 +1,460 @@ +package com.web.dmcslot.appdown; + + +import android.content.Context; +import android.os.Parcel; +import android.os.Parcelable; + +import com.web.dmcslot.appdown.constant.Constants; + +import java.util.HashMap; +import java.util.Map; + +import androidx.annotation.DrawableRes; + + +/** + * @author Jenly Jenly + */ +public class UpdateConfig implements Parcelable { + + /** + * APK下载的Url + */ + private String mUrl; + /** + * 保存路径 + */ + private String mPath; + /** + * 保存文件名 + */ + private String mFilename; + + /** + * 是否显示通知栏 + */ + private boolean isShowNotification = true; + /** + * 下载完成后是否自动弹出安装 + */ + private boolean isInstallApk = true; + /** + * 通知栏图标:默认取app图标 + */ + private int mNotificationIcon; + + /** + * 通知栏ID + */ + private int mNotificationId = Constants.DEFAULT_NOTIFICATION_ID; + + /** + * 通知栏渠道ID + */ + private String mChannelId; + /** + * 通知栏渠道名称 + */ + private String mChannelName; + /** + * 默认{@link Context#getPackageName() + ".AppUpdaterFileProvider"} + */ + private String mAuthority; + /** + * 下载失败是否支持点击通知栏重新下载 + */ + private boolean isReDownload = true; + /** + * 下载失败后,最大重新下载次数 + */ + private int reDownloads = 3; + /** + * 是否显示百分比 + */ + private boolean isShowPercentage = true; + + /** + * 是否震动提示,为true时使用通知默认震动 + */ + private boolean isVibrate; + + /** + * 是否铃声提示,为true时使用通知默认铃声 + */ + private boolean isSound; + + /** + * 要下载的APK的versionCode + */ + private Integer versionCode; + + /** + * 请求头参数 + */ + private Map mRequestProperty; + + /** + * 是否删除取消下载的文件 + */ + private boolean isDeleteCancelFile = true; + + /** + * 是否支持通过删除通知栏来取消下载 + */ + private boolean isCancelDownload = false; + + /** + * APK文件的MD5 + */ + private String apkMD5; + + + public UpdateConfig() { + + } + + public String getUrl() { + return mUrl; + } + + /** + * 设置APK下载地址 + * @param url 下载地址 + */ + public void setUrl(String url) { + this.mUrl = url; + } + + public String getPath() { + return mPath; + } + + /** + * 设置保存的路径,(建议使用默认,不做设置) + * @param path 下载保存的文件路径 + * @return + * @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用 + */ + @Deprecated + public void setPath(String path) { + this.mPath = path; + } + + public String getFilename() { + return mFilename; + } + + /** + * 设置保存的文件名 + * @param filename 下载的保存的apk文件名 (默认优先取url文件名) + */ + public void setFilename(String filename) { + this.mFilename = filename; + } + + public boolean isShowNotification() { + return isShowNotification; + } + + /** + * 设置是否显示通知栏 + * @param isShowNotification 是否显示通知栏 (默认true) + */ + public void setShowNotification(boolean isShowNotification) { + this.isShowNotification = isShowNotification; + } + + public String getChannelId() { + return mChannelId; + } + + /** + * 设置通知渠道ID + * @param channelId 通知渠道ID (默认兼容O) + */ + public void setChannelId(String channelId) { + this.mChannelId = channelId; + } + + public String getChannelName() { + return mChannelName; + } + + /** + * 设置通知渠道名称 + * @param channelName 通知渠道名称 (默认兼容O) + */ + public void setChannelName(String channelName) { + this.mChannelName = channelName; + } + /** + * 设置通知ID + * @param notificationId 通知ID + */ + public void setNotificationId(int notificationId){ + this.mNotificationId = notificationId; + } + + public int getNotificationId(){ + return this.mNotificationId; + } + + + /** + * 设置通知图标 + * @param icon 通知栏图标 (默认取App的icon) + */ + public void setNotificationIcon(@DrawableRes int icon){ + this.mNotificationIcon = icon; + } + + public int getNotificationIcon(){ + return this.mNotificationIcon; + } + + public boolean isInstallApk() { + return isInstallApk; + } + + /** + * 设置下载完成后知否自动触发安装APK + * @param isInstallApk 下载完成后是否自动调用安装APK(默认true) + */ + public void setInstallApk(boolean isInstallApk) { + this.isInstallApk = isInstallApk; + } + + public String getAuthority() { + return mAuthority; + } + + /** + * 设置FileProvider的authority + * @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"}) + */ + public void setAuthority(String authority) { + this.mAuthority = authority; + } + + public boolean isShowPercentage() { + return isShowPercentage; + } + + /** + * 设置下载时,通知栏是否显示下载百分比 + * @param showPercentage 下载时通知栏是否显示百分比 + */ + public void setShowPercentage(boolean showPercentage) { + isShowPercentage = showPercentage; + } + + public boolean isReDownload() { + return isReDownload; + } + + /** + * 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)} + * @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true + */ + public void setReDownload(boolean reDownload) { + isReDownload = reDownload; + } + + public int getReDownloads() { + return reDownloads; + } + + /** + * 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)} + * @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次 + */ + public void setReDownloads(int reDownloads) { + this.reDownloads = reDownloads; + } + + public boolean isVibrate() { + return isVibrate; + } + + /** + * 设置通知是否震动提示 + * @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + */ + public void setVibrate(boolean vibrate) { + isVibrate = vibrate; + } + + public boolean isSound() { + return isSound; + } + + /** + * 设置通知是否铃声提示 + * @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + */ + public void setSound(boolean sound) { + isSound = sound; + } + + public Integer getVersionCode(){ + return versionCode; + } + + /** + * 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。 + * 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。 + */ + public void setVersionCode(Integer versionCode){ + this.versionCode = versionCode; + } + + public Map getRequestProperty() { + return mRequestProperty; + } + + /** + * 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存 + */ + public void setApkMD5(String md5){ + this.apkMD5 = md5; + } + + public String getApkMD5(){ + return apkMD5; + } + + /** + * 请求头添加参数 + * @param key + * @param value + */ + public void addHeader(String key, String value){ + initRequestProperty(); + mRequestProperty.put(key,value); + } + + /** + * 请求头添加参数 + * @param headers + */ + public void addHeader(Map headers){ + initRequestProperty(); + mRequestProperty.putAll(headers); + } + + private void initRequestProperty(){ + if(mRequestProperty == null){ + mRequestProperty = new HashMap<>(); + } + } + + public boolean isDeleteCancelFile() { + return isDeleteCancelFile; + } + + /** + * 设置是否自动删除取消下载的文件 + * @param deleteCancelFile 是否删除取消下载的文件(默认为:true) + */ + public void setDeleteCancelFile(boolean deleteCancelFile) { + isDeleteCancelFile = deleteCancelFile; + } + + public boolean isCancelDownload(){ + return isCancelDownload; + } + + /** + * 是否支持通过删除通知栏来取消下载(默认为:false) + * @param cancelDownload + */ + public void setCancelDownload(boolean cancelDownload) { + isCancelDownload = cancelDownload; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(this.mUrl); + dest.writeString(this.mPath); + dest.writeString(this.mFilename); + dest.writeByte(this.isShowNotification ? (byte) 1 : (byte) 0); + dest.writeByte(this.isInstallApk ? (byte) 1 : (byte) 0); + dest.writeInt(this.mNotificationIcon); + dest.writeInt(this.mNotificationId); + dest.writeString(this.mChannelId); + dest.writeString(this.mChannelName); + dest.writeString(this.mAuthority); + dest.writeByte(this.isReDownload ? (byte) 1 : (byte) 0); + dest.writeInt(this.reDownloads); + dest.writeByte(this.isShowPercentage ? (byte) 1 : (byte) 0); + dest.writeByte(this.isVibrate ? (byte) 1 : (byte) 0); + dest.writeByte(this.isSound ? (byte) 1 : (byte) 0); + dest.writeValue(this.versionCode); + if(mRequestProperty!=null){ + dest.writeInt(this.mRequestProperty.size()); + for (Map.Entry entry : this.mRequestProperty.entrySet()) { + dest.writeString(entry.getKey()); + dest.writeString(entry.getValue()); + } + }else{ + dest.writeInt(0); + } + + dest.writeByte(this.isDeleteCancelFile ? (byte) 1 : (byte) 0); + dest.writeByte(this.isCancelDownload ? (byte) 1 : (byte) 0); + dest.writeString(this.apkMD5); + } + + protected UpdateConfig(Parcel in) { + this.mUrl = in.readString(); + this.mPath = in.readString(); + this.mFilename = in.readString(); + this.isShowNotification = in.readByte() != 0; + this.isInstallApk = in.readByte() != 0; + this.mNotificationIcon = in.readInt(); + this.mNotificationId = in.readInt(); + this.mChannelId = in.readString(); + this.mChannelName = in.readString(); + this.mAuthority = in.readString(); + this.isReDownload = in.readByte() != 0; + this.reDownloads = in.readInt(); + this.isShowPercentage = in.readByte() != 0; + this.isVibrate = in.readByte() != 0; + this.isSound = in.readByte() != 0; + this.versionCode = (Integer) in.readValue(Integer.class.getClassLoader()); + int mRequestPropertySize = in.readInt(); + this.mRequestProperty = new HashMap<>(mRequestPropertySize); + for (int i = 0; i < mRequestPropertySize; i++) { + String key = in.readString(); + String value = in.readString(); + this.mRequestProperty.put(key, value); + } + this.isDeleteCancelFile = in.readByte() != 0; + this.isCancelDownload = in.readByte() != 0; + this.apkMD5 = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public UpdateConfig createFromParcel(Parcel source) { + return new UpdateConfig(source); + } + + @Override + public UpdateConfig[] newArray(int size) { + return new UpdateConfig[size]; + } + }; +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java new file mode 100644 index 0000000..9d4fa61 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java @@ -0,0 +1,26 @@ +package com.web.dmcslot.appdown.callback; + +/** + * @author Jenly Jenly + */ +public abstract class AppUpdateCallback implements UpdateCallback { + @Override + public void onDownloading(boolean isDownloading) { + + } + + @Override + public void onStart(String url) { + + } + + @Override + public void onError(Exception e) { + + } + + @Override + public void onCancel() { + + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java new file mode 100644 index 0000000..4c8c0ec --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java @@ -0,0 +1,46 @@ +package com.web.dmcslot.appdown.callback; + +import java.io.File; + +/** + * @author Jenly Jenly + */ +public interface UpdateCallback { + + /** + * 最开始调用(在onStart之前调用) + * @param isDownloading true 表示已经在下载,false表示当前未开始下载,即将开始下载 + */ + void onDownloading(boolean isDownloading); + + /** + * 开始 + */ + void onStart(String url); + + /** + * 加载进度… + * @param progress + * @param total + * @param isChange 进度百分比是否有改变,(主要可以用来过滤无用的刷新,从而降低刷新频率) + */ + void onProgress(long progress,long total,boolean isChange); + + /** + * 完成 + * @param file + */ + void onFinish(File file); + + /** + * 错误 + * @param e + */ + void onError(Exception e); + + + /** + * 取消 + */ + void onCancel(); +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java new file mode 100644 index 0000000..19b1b33 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java @@ -0,0 +1,32 @@ +package com.web.dmcslot.appdown.constant; + +/** + * @author Jenly Jenly + */ +public final class Constants { + + public static final String TAG = "AppUpdater"; + + public static final String KEY_UPDATE_CONFIG = "app_update_config"; + + public static final int DEFAULT_NOTIFICATION_ID = 0x66; + + public static final String DEFAULT_NOTIFICATION_CHANNEL_ID = "0x66"; + + public static final String DEFAULT_NOTIFICATION_CHANNEL_NAME = "AppUpdater"; + + public static final String KEY_STOP_DOWNLOAD_SERVICE = "stop_download_service"; + + public static final String KEY_RE_DOWNLOAD = "app_update_re_download"; + + public static final int RE_CODE_STORAGE_PERMISSION = 0x66; + + public static final int NONE = -1; + + public static final String DEFAULT_FILE_PROVIDER = ".appdown.provider.AppUpdaterFileProvider"; + + public static final String DEFAULT_DIR = "apk"; + + public static boolean isUpdate = true; + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java new file mode 100644 index 0000000..52b39e0 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java @@ -0,0 +1,240 @@ +package com.web.dmcslot.appdown.http; + +import android.os.AsyncTask; +import android.os.Build; + +import com.web.dmcslot.appdown.util.LogUtils; +import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.ConnectException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Map; + +import javax.net.ssl.HttpsURLConnection; + +import androidx.annotation.Nullable; + +/** + * HttpManager使用 {@link HttpURLConnection} 实现的 {@link IHttpManager} + * @author Jenly Jenly + */ +public class HttpManager implements IHttpManager { + + private static final int HTTP_TEMP_REDIRECT = 307; + private static final int HTTP_PERM_REDIRECT = 308; + + private static final int DEFAULT_TIME_OUT = 20000; + + private int mTimeout; + + private DownloadTask mDownloadTask; + + private static volatile HttpManager INSTANCE; + + public static HttpManager getInstance(){ + if(INSTANCE == null){ + synchronized (HttpManager.class){ + if(INSTANCE == null){ + INSTANCE = new HttpManager(); + } + } + } + + return INSTANCE; + } + + private HttpManager(){ + this(DEFAULT_TIME_OUT); + } + + /** + * HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()} + */ + public HttpManager(int timeout){ + this.mTimeout = timeout; + } + + @Override + public void download(String url, String path, String filename, @Nullable Map requestProperty, DownloadCallback callback) { + mDownloadTask = new DownloadTask(url, path, filename, mTimeout, requestProperty, callback); + mDownloadTask.execute(); + } + + @Override + public void cancel() { + if(mDownloadTask != null){ + mDownloadTask.isCancel = true; + } + } + + /** + * 异步下载任务 + */ + private static class DownloadTask extends AsyncTask { + + private String url; + + private String path; + + private String filename; + + private Map requestProperty; + + private DownloadCallback callback; + + private Exception exception; + + private int timeout; + + private volatile boolean isCancel; + + public DownloadTask(String url, String path, String filename, int timeout, @Nullable Map requestProperty, DownloadCallback callback){ + this.url = url; + this.path = path; + this.filename = filename; + this.timeout = timeout; + this.callback = callback; + this.requestProperty = requestProperty; + } + + private File download(String url) throws Exception{ + HttpURLConnection connect = (HttpURLConnection)new URL(url).openConnection(); + connect.setRequestMethod("GET"); + connect.setRequestProperty("Accept-Encoding", "identity"); + + connect.setReadTimeout(timeout); + connect.setConnectTimeout(timeout); + + if(requestProperty != null){ + for(Map.Entry entry : requestProperty.entrySet()){ + connect.setRequestProperty(entry.getKey(),entry.getValue()); + } + } + + connect.connect(); + + LogUtils.d("Content-Type:" + connect.getContentType()); + int responseCode = connect.getResponseCode(); + switch (responseCode){ + case HttpURLConnection.HTTP_OK: { + InputStream is = connect.getInputStream(); + + long length = connect.getContentLength(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + length = connect.getContentLengthLong(); + } + + LogUtils.d( "contentLength:" + length); + + long progress = 0; + + byte[] buffer = new byte[8192]; + + int len; + File file = new File(path, filename); + FileOutputStream fos = new FileOutputStream(file); + while ((len = is.read(buffer)) != -1) { + if (isCancel) { + cancel(true); + break; + } + fos.write(buffer, 0, len); + progress += len; + // 更新进度 + if (length > 0) { + publishProgress(progress, length); + } + } + + fos.flush(); + fos.close(); + is.close(); + + connect.disconnect(); + + if(progress <= 0 && length <= 0){ + throw new IllegalStateException(String.format("contentLength = %d",length)); + } + + return file; + } + case HttpURLConnection.HTTP_MULT_CHOICE: + case HttpURLConnection.HTTP_MOVED_PERM: + case HttpURLConnection.HTTP_MOVED_TEMP: + case HttpURLConnection.HTTP_SEE_OTHER: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: {// 重定向 + String redirectUrl = connect.getHeaderField("Location"); + LogUtils.d("redirectUrl = " + redirectUrl); + connect.disconnect(); + return download(redirectUrl); + } + default://连接失败 + throw new ConnectException(String.format("responseCode = %d",responseCode)); + + } + } + + @Override + protected File doInBackground(Void... voids) { + + try{ + HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory()); + HttpsURLConnection.setDefaultHostnameVerifier(SSLSocketFactoryUtils.createTrustAllHostnameVerifier()); + return download(url); + } catch (Exception e) { + this.exception = e; + e.printStackTrace(); + } + + return null; + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + if(callback != null){ + callback.onStart(url); + } + } + + @Override + protected void onPostExecute(File file) { + super.onPostExecute(file); + if(callback != null){ + if(file != null){ + callback.onFinish(file); + }else{ + callback.onError(exception); + } + + } + } + + @Override + protected void onProgressUpdate(Long... values) { + super.onProgressUpdate(values); + if(callback != null){ + if(!isCancelled()){ + callback.onProgress(values[0],values[1]); + } + + } + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(callback != null){ + callback.onCancel(); + } + } + + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java new file mode 100644 index 0000000..0c14356 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java @@ -0,0 +1,64 @@ +package com.web.dmcslot.appdown.http; + + +import java.io.File; +import java.io.Serializable; +import java.util.Map; + +import androidx.annotation.Nullable; + +/** + * IHttpManager 默认提供 {@link HttpManager} 和 {@link OkHttpManager} 两种实现。 + * @author Jenly Jenly + */ +public interface IHttpManager { + + + /** + * 下载 + * @param url + * @param path + * @param filename + * @param requestProperty + * @param callback + */ + void download(String url, String path, String filename, @Nullable Map requestProperty, DownloadCallback callback); + + /** + * 取消下载 + */ + void cancel(); + + interface DownloadCallback extends Serializable{ + /** + * 开始 + * @param url + */ + void onStart(String url); + + /** + * 加载进度… + * @param progress + * @param total + */ + void onProgress(long progress,long total); + + /** + * 完成 + * @param file + */ + void onFinish(File file); + + /** + * 错误 + * @param e + */ + void onError(Exception e); + + + /** + * 取消 + */ + void onCancel(); + } +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java new file mode 100644 index 0000000..8e51fb6 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java @@ -0,0 +1,235 @@ +package com.web.dmcslot.appdown.http; + +import android.os.AsyncTask; + +import com.web.dmcslot.appdown.util.LogUtils; +import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils; + +import org.apache.http.conn.ssl.SSLSocketFactory; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.ConnectException; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import okhttp3.Call; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +/** + * OkHttpManager使用 {@link OkHttpClient} 实现的 {@link IHttpManager} + *

使用 OkHttpManager 时必须依赖 OkHttp 库 + * @author Jenly + */ +public class OkHttpManager implements IHttpManager { + + private static final int DEFAULT_TIME_OUT = 20000; + + private OkHttpClient okHttpClient; + + private DownloadTask mDownloadTask; + + private static volatile OkHttpManager INSTANCE; + + public static OkHttpManager getInstance(){ + if(INSTANCE == null){ + synchronized (HttpManager.class){ + if(INSTANCE == null){ + INSTANCE = new OkHttpManager(); + } + } + } + + return INSTANCE; + } + + private OkHttpManager(){ + this(DEFAULT_TIME_OUT); + } + + /** + * HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()} + * @param timeout 超时时间,单位:毫秒 + */ + public OkHttpManager(int timeout){ + this(new OkHttpClient.Builder() + .readTimeout(timeout, TimeUnit.MILLISECONDS) + .connectTimeout(timeout, TimeUnit.MILLISECONDS) + .sslSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory(),SSLSocketFactoryUtils.createTrustAllManager()) + .hostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER) + .build()); + } + + /** + * HttpManager对外暴露,推荐使用{@link HttpManager#getInstance()} + * @param okHttpClient {@link OkHttpClient} + */ + public OkHttpManager(@NonNull OkHttpClient okHttpClient){ + this.okHttpClient = okHttpClient; + } + + + @Override + public void download(String url,final String path,final String filename, @Nullable Map requestProperty,final DownloadCallback callback) { + mDownloadTask = new DownloadTask(okHttpClient, url, path, filename, requestProperty, callback); + mDownloadTask.execute(); + } + + @Override + public void cancel() { + if(mDownloadTask != null){ + mDownloadTask.isCancel = true; + } + } + + + /** + * 异步下载任务 + */ + private static class DownloadTask extends AsyncTask { + + private String url; + + private String path; + + private String filename; + + private Map requestProperty; + + private DownloadCallback callback; + + private Exception exception; + + private OkHttpClient okHttpClient; + + private volatile boolean isCancel; + + public DownloadTask(OkHttpClient okHttpClient,String url, String path, String filename ,@Nullable Map requestProperty, DownloadCallback callback){ + this.okHttpClient = okHttpClient; + this.url = url; + this.path = path; + this.filename = filename; + this.callback = callback; + this.requestProperty = requestProperty; + + } + + @Override + protected File doInBackground(Void... voids) { + + try{ + Request.Builder builder = new Request.Builder() + .url(url) + .addHeader("Accept-Encoding", "identity") + .get(); + + if(requestProperty!=null){ + for(Map.Entry entry : requestProperty.entrySet()){ + builder.addHeader(entry.getKey(),entry.getValue()); + } + } + + Call call = okHttpClient.newCall(builder.build()); + Response response = call.execute(); + + if(response.isSuccessful()){ + InputStream is = response.body().byteStream(); + + long length = response.body().contentLength(); + + LogUtils.d("contentLength:" + length); + + long progress = 0; + + byte[] buffer = new byte[8192]; + + int len; + File file = new File(path,filename); + FileOutputStream fos = new FileOutputStream(file); + while ((len = is.read(buffer)) != -1){ + if(isCancel){ + if(call != null){ + call.cancel(); + } + cancel(true); + break; + } + fos.write(buffer,0,len); + progress += len; + // 更新进度 + if(length > 0){ + publishProgress(progress,length); + } + } + + fos.flush(); + fos.close(); + is.close(); + + response.close(); + + if(progress <= 0 && length <= 0){ + throw new IllegalStateException(String.format("contentLength = %d",length)); + } + + return file; + + }else {// 连接失败 + throw new ConnectException(String.format("responseCode = %d",response.code())); + } + + }catch (Exception e){ + this.exception = e; + e.printStackTrace(); + } + + return null; + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + if(callback != null){ + callback.onStart(url); + } + } + + @Override + protected void onPostExecute(File file) { + super.onPostExecute(file); + if(callback != null){ + if(file != null){ + callback.onFinish(file); + }else{ + callback.onError(exception); + } + + } + } + + @Override + protected void onProgressUpdate(Long... values) { + super.onProgressUpdate(values); + if(callback != null){ + if(!isCancelled()){ + callback.onProgress(values[0],values[1]); + } + + } + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(callback != null){ + callback.onCancel(); + } + } + + } +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java new file mode 100644 index 0000000..cafcfd5 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java @@ -0,0 +1,25 @@ +package com.web.dmcslot.appdown.notify; + +import android.content.Context; + +import com.web.dmcslot.appdown.UpdateConfig; + +import java.io.File; + +import androidx.annotation.DrawableRes; + +/** + * @author Jenly + */ +public interface INotification { + + void onStart(Context context, int notifyId, String channelId, String channelName, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload); + + void onProgress(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload); + + void onFinish(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority); + + void onError(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config); + + void onCancel(Context context, int notifyId); +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java new file mode 100644 index 0000000..5a432e0 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java @@ -0,0 +1,38 @@ +package com.web.dmcslot.appdown.notify; + +import android.content.Context; + +import com.web.dmcslot.appdown.UpdateConfig; +import com.web.dmcslot.appdown.util.NotificationUtils; + +import java.io.File; + +/** + * @author Jenly + */ +public class NotificationImpl implements INotification { + @Override + public void onStart(Context context, int notifyId, String channelId, String channelName, int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload) { + NotificationUtils.showStartNotification(context, notifyId, channelId, channelName, icon, title, content, isVibrate, isSound, isCancelDownload); + } + + @Override + public void onProgress(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload) { + NotificationUtils.showProgressNotification(context, notifyId, channelId, icon, title, content, progress, size, isCancelDownload); + } + + @Override + public void onFinish(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, File file, String authority) { + NotificationUtils.showFinishNotification(context, notifyId, channelId, icon, title, content, file, authority); + } + + @Override + public void onError(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config) { + NotificationUtils.showErrorNotification(context, notifyId, channelId, icon, title, content, isReDownload, config); + } + + @Override + public void onCancel(Context context, int notifyId) { + NotificationUtils.cancelNotification(context, notifyId); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java new file mode 100644 index 0000000..03f2b55 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java @@ -0,0 +1,11 @@ +package com.web.dmcslot.appdown.provider; + + +import androidx.core.content.FileProvider; + +/** + * @author Jenly Jenly + */ +public class AppUpdaterFileProvider extends FileProvider { + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java new file mode 100644 index 0000000..1941437 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java @@ -0,0 +1,456 @@ +package com.web.dmcslot.appdown.service; + +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.os.Binder; +import android.os.Build; +import android.os.IBinder; +import android.text.TextUtils; + +import com.web.dmcslot.R; +import com.web.dmcslot.appdown.UpdateConfig; +import com.web.dmcslot.appdown.callback.UpdateCallback; +import com.web.dmcslot.appdown.constant.Constants; +import com.web.dmcslot.appdown.http.HttpManager; +import com.web.dmcslot.appdown.http.IHttpManager; +import com.web.dmcslot.appdown.notify.INotification; +import com.web.dmcslot.appdown.notify.NotificationImpl; +import com.web.dmcslot.appdown.util.AppUtils; +import com.web.dmcslot.appdown.util.LogUtils; + +import java.io.File; +import java.util.Locale; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; + + +/** + * 下载服务 + * @author Jenly Jenly + */ +public class DownloadService extends Service { + + private DownloadBinder mDownloadBinder = new DownloadBinder(); + /** + * 是否在下载,防止重复下载。 + */ + private boolean isDownloading; + /** + * 失败后重新下载次数 + */ + private int mCount = 0; + /** + * Http管理器 + */ + private IHttpManager mHttpManager; + + private File mApkFile; + + private Context getContext(){ + return this; + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + if(intent != null){ + boolean isStop = intent.getBooleanExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,false); + if(isStop){ + stopDownload(); + } else if(!isDownloading){ + //是否实通过通知栏触发重复下载 + boolean isReDownload = intent.getBooleanExtra(Constants.KEY_RE_DOWNLOAD,false); + if(isReDownload){ + mCount++; + } + //获取配置信息 + UpdateConfig config = intent.getParcelableExtra(Constants.KEY_UPDATE_CONFIG); + startDownload(config,null,null, new NotificationImpl()); + }else{ + LogUtils.w("Please do not duplicate downloads."); + } + } + + return super.onStartCommand(intent, flags, startId); + + } + + + //---------------------------------------- + + /** + * 开始下载 + * @param config + * @param httpManager + * @param callback + */ + public void startDownload(@NonNull UpdateConfig config,@Nullable IHttpManager httpManager,@Nullable UpdateCallback callback, @Nullable INotification notification){ + if(callback != null){ + callback.onDownloading(isDownloading); + } + + if(isDownloading){ + LogUtils.w("Please do not duplicate downloads."); + return; + } + + String url = config.getUrl(); + String path = config.getPath(); + String filename = config.getFilename(); + + //如果保存路径为空则使用缓存路径 + if(TextUtils.isEmpty(path)){ + path = getCacheFilesDir(getContext()); + } + File dirFile = new File(path); + if(!dirFile.exists()){ + dirFile.mkdirs(); + } + + //如果文件名为空则使用路径 + if(TextUtils.isEmpty(filename)){ + filename = AppUtils.getAppFullName(getContext(),url,getResources().getString(R.string.app_name)); + } + + mApkFile = new File(path, filename); + if(mApkFile.exists()){//文件是否存在 + Integer versionCode = config.getVersionCode(); + String apkMD5 = config.getApkMD5(); + //是否存在相同的apk + boolean isExistApk = false; + if(!TextUtils.isEmpty(apkMD5)){//如果存在MD5,则优先校验MD5 + LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.apkMD5:%s",apkMD5)); + isExistApk = AppUtils.checkFileMD5(mApkFile,apkMD5); + }else if(versionCode != null){//如果存在versionCode,则校验versionCode + LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.versionCode:%d",versionCode)); + isExistApk = AppUtils.apkExists(getContext(),versionCode,mApkFile); + } + + if(isExistApk){ + //本地已经存在要下载的APK + LogUtils.d("CacheFile:" + mApkFile); + if(config.isInstallApk()){ + String authority = config.getAuthority(); + if(TextUtils.isEmpty(authority)){//如果为空则默认 + authority = AppUtils.getFileProviderAuthority(getContext()); + } + AppUtils.installApk(getContext(), mApkFile, authority); + } + if(callback != null){ + callback.onFinish(mApkFile); + } + stopService(); + return; + } + + //删除旧文件 + mApkFile.delete(); + } + LogUtils.d("File:" + mApkFile); + + mHttpManager = httpManager != null ? httpManager : HttpManager.getInstance(); + IHttpManager.DownloadCallback downloadCallback = new AppDownloadCallback(getContext(),this, config, mApkFile, callback, notification); + mHttpManager.download(url,path,filename,config.getRequestProperty(), downloadCallback); + + } + + /** + * 停止下载 + */ + public void stopDownload(){ + if(mHttpManager != null){ + mHttpManager.cancel(); + } + } + + /** + * 获取缓存路径 + * @param context + * @return + */ + private String getCacheFilesDir(Context context) { + File[] files = ContextCompat.getExternalFilesDirs(context, Constants.DEFAULT_DIR); + if(files != null && files.length > 0){ + return files[0].getAbsolutePath(); + } + + File externalFilesDir = context.getExternalFilesDir(Constants.DEFAULT_DIR); + if(externalFilesDir != null){ + return externalFilesDir.getAbsolutePath(); + } + + return new File(context.getFilesDir(), Constants.DEFAULT_DIR).getAbsolutePath(); + + } + + /** + * 停止服务 + */ + private void stopService(){ + mCount = 0; + stopSelf(); + } + + + //---------------------------------------- DownloadCallback + + /** + * App下载回调接口 + */ + public static class AppDownloadCallback implements IHttpManager.DownloadCallback { + + private Context context; + + private DownloadService downloadService; + + public UpdateConfig config; + + private boolean isShowNotification; + + private int notifyId; + + private String channelId; + + private String channelName; + + private int notificationIcon; + + private boolean isInstallApk; + + private String authority; + + private boolean isShowPercentage; + + private boolean isReDownload; + + private boolean isDeleteCancelFile; + + private boolean isCancelDownload; + + private UpdateCallback callback; + + private INotification notification; + + /** + * 最后更新进度,用来降频刷新 + */ + private int lastProgress; + /** + * 最后进度更新时间,用来降频刷新 + */ + private long lastTime; + /** + * APK文件 + */ + private File apkFile; + + + private AppDownloadCallback(Context context, DownloadService downloadService, UpdateConfig config, File apkFile, UpdateCallback callback, INotification notification){ + this.context = context; + this.downloadService = downloadService; + this.config = config; + this.apkFile = apkFile; + this.callback = callback; + this.notification = notification; + this.isShowNotification = config.isShowNotification(); + this.notifyId = config.getNotificationId(); + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + this.channelId = TextUtils.isEmpty(config.getChannelId()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_ID : config.getChannelId(); + this.channelName = TextUtils.isEmpty(config.getChannelName()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_NAME : config.getChannelName(); + } + if(config.getNotificationIcon() <= 0){ + this.notificationIcon = AppUtils.getAppIcon(context); + }else{ + this.notificationIcon = config.getNotificationIcon(); + } + + this.isInstallApk = config.isInstallApk(); + + this.authority = config.getAuthority(); + if(TextUtils.isEmpty(config.getAuthority())){//如果为空则默认 + authority = AppUtils.getFileProviderAuthority(context); + } + + this.isShowPercentage = config.isShowPercentage(); + this.isDeleteCancelFile = config.isDeleteCancelFile(); + this.isCancelDownload = config.isCancelDownload(); + + //支持下载失败时重新下载,当重新下载次数不超过限制时才被允许 + this.isReDownload = config.isReDownload() && downloadService.mCount < config.getReDownloads(); + + } + + @Override + public void onStart(String url) { + LogUtils.i("url:" + url); + downloadService.isDownloading = true; + lastProgress = 0; + if(isShowNotification && notification != null){ + String title=""; + if(Constants.isUpdate){ + title = getString(R.string.app_updater_start_notification_title); + }else{ + title = getString(R.string.app_updater_start_notification_title_2); + } + notification.onStart(context,notifyId,channelId,channelName,notificationIcon,title,getString(R.string.app_updater_start_notification_content),config.isVibrate(),config.isSound(),isCancelDownload); + } + + if(callback != null){ + callback.onStart(url); + } + } + + @Override + public void onProgress(long progress, long total) { + boolean isChange = false; + long curTime = System.currentTimeMillis(); + if(lastTime + 200 < curTime || progress == total) {//降低更新频率 + lastTime = curTime; + + int currProgress = Math.round(progress * 1.0f / total * 100.0f); + if(currProgress != lastProgress){//百分比改变了才更新 + isChange = true; + lastProgress = currProgress; + String percentage = currProgress + "%"; + LogUtils.i(String.format(Locale.getDefault(),"%s \t(%d/%d)", percentage, progress, total)); + if(isShowNotification && notification != null) { + String content = context.getString(R.string.app_updater_progress_notification_content); + if (isShowPercentage) { + content += percentage; + } + String title=""; + if(Constants.isUpdate){ + title = getString(R.string.app_updater_progress_notification_title); + }else{ + title = getString(R.string.app_updater_progress_notification_title_2); + } + notification.onProgress(context,notifyId, channelId, notificationIcon, title, content, currProgress, 100,isCancelDownload); + } + } + } + + if(callback != null){ + callback.onProgress(progress,total,isChange); + } + } + + @Override + public void onFinish(File file) { + LogUtils.d("File:" + file); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + notification.onFinish(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_finish_notification_title),getString(R.string.app_updater_finish_notification_content),file,authority); + } + if(isInstallApk){ + AppUtils.installApk(context,file,authority); + } + if(callback != null){ + callback.onFinish(file); + } + downloadService.stopService(); + } + + @Override + public void onError(Exception e) { + LogUtils.w(e.getMessage()); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + String content = isReDownload ? getString(R.string.app_updater_error_notification_content_re_download) : getString(R.string.app_updater_error_notification_content); + notification.onError(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_error_notification_title),content,isReDownload,config); + } + + if(callback != null){ + callback.onError(e); + } + if(!isReDownload){ + downloadService.stopService(); + } + + } + + @Override + public void onCancel() { + LogUtils.d("Cancel download."); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + notification.onCancel(context,notifyId); + } + if(callback != null){ + callback.onCancel(); + } + if(isDeleteCancelFile && apkFile != null){ + apkFile.delete(); + } + downloadService.stopService(); + } + + private String getString(@StringRes int resId){ + return context.getString(resId); + } + } + + @Override + public void onDestroy() { + isDownloading = false; + mHttpManager = null; + super.onDestroy(); + } + + //---------------------------------------- Binder + + @Nullable + @Override + public IBinder onBind(Intent intent) { + return mDownloadBinder; + } + + /** + * 提供绑定服务的方式进行下载 + */ + public class DownloadBinder extends Binder { + + /** + * 开始下载 + * @param config {@link UpdateConfig} + */ + public void start(@NonNull UpdateConfig config){ + start(config,null); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param callback {@link UpdateCallback} + */ + public void start(@NonNull UpdateConfig config, @Nullable UpdateCallback callback){ + start(config,null, callback); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param httpManager {@link IHttpManager} + * @param callback {@link UpdateCallback} + */ + public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback){ + start(config, httpManager, callback, new NotificationImpl()); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param httpManager {@link IHttpManager} + * @param callback {@link UpdateCallback} + * @param notification {@link INotification} + */ + public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback,@NonNull INotification notification){ + startDownload(config, httpManager, callback, notification); + } + } + + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java new file mode 100644 index 0000000..61d66e3 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java @@ -0,0 +1,264 @@ +package com.web.dmcslot.appdown.util; + +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.res.AssetFileDescriptor; +import android.net.Uri; +import android.os.Build; +import android.text.TextUtils; +import android.util.Log; + +import androidx.core.content.FileProvider; + + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.math.BigInteger; +import java.security.MessageDigest; + +import com.web.dmcslot.appdown.constant.Constants; + + +/** + * @author Jenly Jenly + */ +public final class AppUtils { + + private AppUtils(){ + throw new AssertionError(); + } + + /** + * 通过url获取App的全名称 + * @param context + * @return AppName.apk + */ + public static String getAppFullName(Context context,String url,String defaultName){ + if(url.endsWith(".apk")){ + String apkName = url.substring(url.lastIndexOf("/") + 1); + if(apkName.length() <= 64){ + return apkName; + } + } + + String filename = getAppName(context); + Log.d(Constants.TAG, "AppName:" + filename); + if(TextUtils.isEmpty(filename)){ + filename = defaultName; + } + if(filename.endsWith(".apk")){ + return filename; + } + return String.format("%s.apk",filename); + } + + /** + * 获取包信息 + * @param context + * @return + * @throws PackageManager.NameNotFoundException + */ + public static PackageInfo getPackageInfo(Context context) throws PackageManager.NameNotFoundException { + PackageManager packageManager = context.getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); + return packageInfo; + } + + /** + * 通过APK路径获取包信息 + * @param context + * @param archiveFilePath + * @return + */ + public static PackageInfo getPackageInfo(Context context, String archiveFilePath) { + PackageManager packageManager = context.getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageArchiveInfo(archiveFilePath, PackageManager.GET_ACTIVITIES); + return packageInfo; + } + + + /** + * 获取App的名称 + */ + public static String getAppName(Context context) { + try{ + int labelRes = getPackageInfo(context).applicationInfo.labelRes; + return context.getResources().getString(labelRes); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 获取App的图标 + * @param context + * @return + */ + public static int getAppIcon(Context context){ + try{ + return getPackageInfo(context).applicationInfo.icon; + } catch (Exception e) { + e.printStackTrace(); + } + return 0; + } + + /** + * 安装apk + * @param context + * @param file + */ + public static void installApk(Context context,File file,String authority){ + Intent intent = getInstallIntent(context,file,authority); + context.startActivity(intent); + } + + /** + * 获取安装Intent + * @param context + * @param file + * @param authority + * @return + */ + public static Intent getInstallIntent(Context context,File file,String authority){ + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.addCategory(Intent.CATEGORY_DEFAULT); + Uri uriData; + String type = "application/vnd.android.package-archive"; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + uriData = FileProvider.getUriForFile(context, authority, file); + }else{ + uriData = Uri.fromFile(file); + } + intent.setDataAndType(uriData, type); + return intent; + } + + /** + * APK是否存在 + * @param context + * @param versionCode + * @param file + * @return + * @throws Exception + */ + public static boolean apkExists(Context context,int versionCode,File file){ + if(file != null && file.exists()){ + String packageName = context.getPackageName(); + PackageInfo packageInfo = AppUtils.getPackageInfo(context,file.getAbsolutePath()); + if(packageInfo != null){// 比对versionCode + Log.d(Constants.TAG,String.format("ApkVersionCode:%d",packageInfo.versionCode)); + if(versionCode == packageInfo.versionCode){ + ApplicationInfo applicationInfo = packageInfo.applicationInfo; + if(applicationInfo != null && packageName.equals(applicationInfo.packageName)){//比对packageName + return true; + } + } + } + } + return false; + } + + /** + * 判断文件是否存在 + * @param context + * @param path + * @return + */ + public static boolean isAndroidQFileExists(Context context,String path){ + return isAndroidQFileExists(context,new File(path)); + } + + /** + * 判断文件是否存在 + * @param context + * @param file + * @return + */ + public static boolean isAndroidQFileExists(Context context,File file){ + AssetFileDescriptor descriptor = null; + ContentResolver contentResolver = context.getContentResolver(); + try { + Uri uri = Uri.fromFile(file); + descriptor = contentResolver.openAssetFileDescriptor(uri, "r"); + if (descriptor == null) { + return false; + } else { + close(descriptor); + } + return true; + } catch (FileNotFoundException e) { + + }finally { + close(descriptor); + } + return false; + } + + /** + * 校验文件MD5 + * @param file + * @param md5 + * @return + */ + public static boolean checkFileMD5(File file,String md5){ + String fileMD5 = getFileMD5(file); + Log.d(Constants.TAG,"FileMD5:"+ fileMD5); + if(!TextUtils.isEmpty(md5)){ + return md5.equalsIgnoreCase(fileMD5); + } + + return false; + } + + /** + * 获取文件MD5 + * @param file + * @return + */ + public static String getFileMD5(File file){ + try { + FileInputStream fis = new FileInputStream(file); + MessageDigest messageDigest = MessageDigest.getInstance("MD5"); + byte[] buffer = new byte[1024]; + int length; + while ((length = fis.read(buffer)) != -1){ + messageDigest.update(buffer,0,length); + } + BigInteger bigInteger = new BigInteger(1,messageDigest.digest()); + return bigInteger.toString(16); + } catch (Exception e) { + e.printStackTrace(); + } + + return null; + } + + public static String getFileProviderAuthority(Context context){ + return context.getPackageName() + Constants.DEFAULT_FILE_PROVIDER; + } + + /** + * 关闭 + * @param descriptor + */ + private static void close(AssetFileDescriptor descriptor){ + if(descriptor != null){ + try { + descriptor.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java new file mode 100644 index 0000000..6c0a4da --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java @@ -0,0 +1,316 @@ +/* + Copyright © 2015, 2016 Jenly Yu Jenly + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package com.web.dmcslot.appdown.util; + + +import android.util.Log; + +import java.util.Locale; + +/** + * @author Jenly Jenly + */ +public class LogUtils { + + public static final String TAG = "AppUpdater"; + + public static final String VERTICAL = "|"; + + /** 是否显示Log日志 */ + private static boolean isShowLog = true; + + /** Log日志优先权 */ + private static int priority = 1; + + /** + * Priority constant for the println method;use System.out.println + */ + public static final int PRINTLN = 1; + + /** + * Priority constant for the println method; use Log.v. + */ + public static final int VERBOSE = 2; + + /** + * Priority constant for the println method; use Log.d. + */ + public static final int DEBUG = 3; + + /** + * Priority constant for the println method; use Log.i. + */ + public static final int INFO = 4; + + /** + * Priority constant for the println method; use Log.w. + */ + public static final int WARN = 5; + + /** + * Priority constant for the println method; use Log.e. + */ + public static final int ERROR = 6; + + /** + * Priority constant for the println method.use Log.wtf. + */ + public static final int ASSERT = 7; + + public static final String TAG_FORMAT = "%s.%s(%s:%d)"; + + private LogUtils(){ + throw new AssertionError(); + } + + public static void setShowLog(boolean isShowLog) { + + LogUtils.isShowLog = isShowLog; + } + + public static boolean isShowLog() { + + return isShowLog; + } + + public static int getPriority() { + + return priority; + } + + public static void setPriority(int priority) { + + LogUtils.priority = priority; + } + + /** + * 根据堆栈生成TAG + * @return TAG|className.methodName(fileName:lineNumber) + */ + private static String generateTag(StackTraceElement caller) { + String tag = TAG_FORMAT; + String callerClazzName = caller.getClassName(); + callerClazzName = callerClazzName.substring(callerClazzName.lastIndexOf(".") + 1); + tag = String.format(Locale.getDefault(),tag,callerClazzName, caller.getMethodName(),caller.getFileName(),caller.getLineNumber()); + return new StringBuilder().append(TAG).append(VERTICAL).append(tag).toString(); + } + + /** + * 获取堆栈 + * @param n + * n=0 VMStack + * n=1 Thread + * n=3 CurrentStack + * n=4 CallerStack + * ... + * @return + */ + public static StackTraceElement getStackTraceElement(int n) { + return Thread.currentThread().getStackTrace()[n]; + } + + /** + * 获取调用方的堆栈TAG + * @return + */ + private static String getCallerStackLogTag(){ + return generateTag(getStackTraceElement(5)); + } + + /** + * + * @param t + * @return + */ + private static String getStackTraceString(Throwable t){ + return Log.getStackTraceString(t); + } + + // -----------------------------------Log.v + + /** + * Log.v + * @param msg + */ + public static void v(String msg) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), String.valueOf(msg)); + + } + + public static void v(Throwable t) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void v(String msg,Throwable t) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.d + + /** + * Log.d + * @param msg + */ + public static void d(String msg) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void d(Throwable t) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void d(String msg,Throwable t) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.i + + /** + * Log.i + * @param msg + */ + public static void i(String msg) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void i(Throwable t) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void i(String msg,Throwable t) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.w + + /** + * Log.w + * @param msg + */ + public static void w(String msg) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void w(Throwable t) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void w(String msg,Throwable t) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.e + + /** + * Log.e + * @param msg + */ + public static void e(String msg) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void e(Throwable t) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void e(String msg,Throwable t) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.wtf + + /** + * Log.wtf + * @param msg + */ + public static void wtf(String msg) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void wtf(Throwable t) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void wtf(String msg,Throwable t) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------System.out.print + + /** + * System.out.print + * + * @param msg + */ + public static void print(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.print(msg); + } + + public static void print(Object obj) { + if (isShowLog && priority <= PRINTLN) + System.out.print(obj); + } + + // -----------------------------------System.out.printf + + /** + * System.out.printf + * + * @param msg + */ + public static void printf(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.printf(msg); + } + + // -----------------------------------System.out.println + + /** + * System.out.println + * + * @param msg + */ + public static void println(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.println(msg); + } + + public static void println(Object obj) { + if (isShowLog && priority <= PRINTLN) + System.out.println(obj); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java new file mode 100644 index 0000000..48e45f3 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java @@ -0,0 +1,261 @@ +package com.web.dmcslot.appdown.util; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.DrawableRes; +import androidx.annotation.RequiresApi; +import androidx.core.app.NotificationCompat; + + +import java.io.File; + +import com.web.dmcslot.appdown.UpdateConfig; +import com.web.dmcslot.appdown.constant.Constants; +import com.web.dmcslot.appdown.service.DownloadService; + +/** + * @author Jenly + */ +public class NotificationUtils { + + private NotificationUtils(){ + throw new AssertionError(); + } + + /** + * 显示开始下载时的通知 + * @param notifyId + * @param channelId + * @param channelName + * @param icon + * @param title + * @param content + */ + public static void showStartNotification(Context context, int notifyId,String channelId, String channelName,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isVibrate,boolean isSound, boolean isCancelDownload){ + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + createNotificationChannel(context,channelId,channelName,isVibrate,isSound); + } + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setPriority(NotificationCompat.PRIORITY_DEFAULT); + if(isVibrate && isSound){ + builder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND); + }else if(isVibrate){ + builder.setDefaults(Notification.DEFAULT_VIBRATE); + }else if(isSound){ + builder.setDefaults(Notification.DEFAULT_SOUND); + } + + if(isCancelDownload){ + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + PendingIntent deleteIntent = PendingIntent.getService(context, notifyId,intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setDeleteIntent(deleteIntent); + } + + Notification notification = builder.build(); + if(isCancelDownload){ + notification.flags = Notification.FLAG_ONLY_ALERT_ONCE; + }else{ + notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; + } + + notifyNotification(context,notifyId,notification); + } + + /** + * 显示下载中的通知(更新进度) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param progress + * @param size + */ + public static void showProgressNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,int progress,int size, boolean isCancelDownload){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content,progress,size); + + if(isCancelDownload){ + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + PendingIntent deleteIntent = PendingIntent.getService(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setDeleteIntent(deleteIntent); + } + + Notification notification = builder.build(); + + if(isCancelDownload){ + notification.flags = Notification.FLAG_ONLY_ALERT_ONCE; + }else{ + notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; + } + + notifyNotification(context,notifyId,notification); + } + + /** + * 显示下载完成时的通知(点击安装) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param file + */ + public static void showFinishNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority){ + cancelNotification(context,notifyId); + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(true); + Intent intent = AppUtils.getInstallIntent(context,file,authority); + PendingIntent clickIntent = PendingIntent.getActivity(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT)); + builder.setContentIntent(clickIntent); + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + /** + * 现在下载失败通知 + * @param context + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param isReDownload + * @param config + */ + public static void showErrorNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(true); + int flag = getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT); + if(isReDownload){// 重新下载 + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_RE_DOWNLOAD,true); + intent.putExtra(Constants.KEY_UPDATE_CONFIG,config); + PendingIntent clickIntent = PendingIntent.getService(context, notifyId,intent, flag); + builder.setContentIntent(clickIntent); + }else{ + PendingIntent clickIntent = PendingIntent.getService(context, notifyId, new Intent(), flag); + builder.setContentIntent(clickIntent); + } + + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + + /** + * 显示通知信息(非第一次) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + */ + public static void showNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isAutoCancel){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(isAutoCancel); + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + /** + * 取消通知 + * @param notifyId + */ + public static void cancelNotification(Context context, int notifyId){ + getNotificationManager(context).cancel(notifyId); + } + + + /** + * 获取通知管理器 + * @return + */ + public static NotificationManager getNotificationManager(Context context){ + return (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); + } + + /** + * 创建一个通知渠道(兼容0以上版本) + * @param channelId + * @param channelName + */ + @RequiresApi(api = Build.VERSION_CODES.O) + public static void createNotificationChannel(Context context, String channelId, String channelName,boolean isVibrate,boolean isSound){ + NotificationChannel channel = new NotificationChannel(channelId,channelName, NotificationManager.IMPORTANCE_HIGH); + channel.enableVibration(isVibrate); + if(!isSound){ + channel.setSound(null,null); + } + getNotificationManager(context).createNotificationChannel(channel); + + } + + /** + * 构建一个通知构建器 + * @param channelId + * @param icon + * @param title + * @param content + * @return + */ + private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon,CharSequence title,CharSequence content){ + return buildNotification(context,channelId,icon,title,content,Constants.NONE,Constants.NONE); + } + + /** + * 构建一个通知构建器 + * @param channelId + * @param icon + * @param title + * @param content + * @param progress + * @param size + * @return + */ + private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size){ + NotificationCompat.Builder builder = new NotificationCompat.Builder(context,channelId); + builder.setSmallIcon(icon); + + builder.setContentTitle(title); + builder.setContentText(content); + builder.setOngoing(true); + + if(progress != Constants.NONE && size != Constants.NONE){ + builder.setProgress(size,progress,false); + } + + return builder; + } + + /** + * 更新通知栏 + * @param id + * @param notification + */ + private static void notifyNotification(Context context, int id, Notification notification){ + getNotificationManager(context).notify(id,notification); + } + + /** + * 获取 PendingIntent 的 flags + * @param flag + * @return + */ + private static int getPendingIntentFlags(int flag){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + return flag | PendingIntent.FLAG_IMMUTABLE; + } + return flag; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java new file mode 100644 index 0000000..3acce16 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java @@ -0,0 +1,92 @@ +package com.web.dmcslot.appdown.util; + +import android.Manifest; +import android.app.Activity; +import android.app.AppOpsManager; +import android.app.NotificationManager; +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.ActivityCompat; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * @author Jenly Jenly + */ +public final class PermissionUtils { + + private PermissionUtils() { + throw new AssertionError(); + } + + /** + * 校验权限 + * + * @param activity + * @param requestCode + * @return + */ + public static boolean verifyReadAndWritePermissions(@NonNull Activity activity, int requestCode) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ + int readResult = checkPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE); + int writeResult = checkPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE); + if (readResult != PackageManager.PERMISSION_GRANTED || writeResult != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(activity, new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); + return false; + } + } + return true; + } + + public static int checkPermission(@NonNull Activity activity, @NonNull String permission) { + return ActivityCompat.checkSelfPermission(activity, permission); + } + + /** + * 获取通知权限 + * + * @param context + */ + public static boolean isNotificationEnabled(Context context) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + if (notificationManager.getImportance() == NotificationManager.IMPORTANCE_NONE) { + return false; + } + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + String CHECK_OP_NO_THROW = "checkOpNoThrow"; + String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION"; + + AppOpsManager mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); + ApplicationInfo appInfo = context.getApplicationInfo(); + String pkg = context.getApplicationContext().getPackageName(); + int uid = appInfo.uid; + + try { + Class appOpsClass = Class.forName(AppOpsManager.class.getName()); + Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class); + Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION); + + int value = (Integer) opPostNotificationValue.get(Integer.class); + return ((Integer) checkOpNoThrowMethod.invoke(mAppOps, value, uid, pkg) == AppOpsManager.MODE_ALLOWED); + + } catch (Exception e) { + e.printStackTrace(); + } + + return false; + } + + return true; + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java new file mode 100644 index 0000000..f907b18 --- /dev/null +++ b/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java @@ -0,0 +1,168 @@ +package com.web.dmcslot.appdown.util; + +import android.content.Context; +import android.text.TextUtils; + +import androidx.annotation.RawRes; + +import java.io.InputStream; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Arrays; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + + +/** + * @author Jenly Jenly + */ +public final class SSLSocketFactoryUtils { + + private static final String[] VERIFY_HOST_NAME = new String[]{}; + + private SSLSocketFactoryUtils() { + throw new AssertionError(); + } + + public static SSLSocketFactory createSSLSocketFactory() { + SSLSocketFactory sslSocketFactory = null; + try { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, getTrustAllManager(), new SecureRandom()); + sslSocketFactory = sslContext.getSocketFactory(); + } catch (Exception e) { + + } + return sslSocketFactory; + } + + public static X509TrustManager createTrustAllManager() { + X509TrustManager tm = null; + try { + tm = new X509TrustManager() { + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + //do nothing + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + //do nothing + } + + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }; + } catch (Exception e) { + e.printStackTrace(); + } + return tm; + } + + public static TrustAllHostnameVerifier createTrustAllHostnameVerifier() { + return new TrustAllHostnameVerifier(); + } + + public static class TrustAllHostnameVerifier implements HostnameVerifier { + @Override + public boolean verify(String hostname, SSLSession session) { + if (TextUtils.isEmpty(hostname)) { + return false; + } + return !Arrays.asList(VERIFY_HOST_NAME).contains(hostname); + } + } + + /** + * @param context + * @param keyServerStoreID + * @return + */ + public static SSLSocketFactory createSSLSocketFactory(Context context, @RawRes int keyServerStoreID) { + InputStream trustStream = context.getResources().openRawResource(keyServerStoreID); + return createSSLSocketFactory(trustStream); + } + + /** + * @param certificates + * @return + */ + public static SSLSocketFactory createSSLSocketFactory(InputStream... certificates) { + SSLSocketFactory sSLSocketFactory = null; + if (sSLSocketFactory == null) { + synchronized (SSLSocketFactoryUtils.class) { + if (sSLSocketFactory == null) { + try { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, getTrustManager(certificates), new SecureRandom()); + sSLSocketFactory = sslContext.getSocketFactory(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return sSLSocketFactory; + } + + /** + * 获得指定流中的服务器端证书库 + * + * @param certificates + * @return + */ + public static TrustManager[] getTrustManager(InputStream... certificates) { + try { + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + int index = 0; + for (InputStream certificate : certificates) { + if (certificate == null) { + continue; + } + Certificate certificate1; + try { + certificate1 = certificateFactory.generateCertificate(certificate); + } finally { + certificate.close(); + } + + String certificateAlias = Integer.toString(index++); + keyStore.setCertificateEntry(certificateAlias, certificate1); + } + + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory + .getDefaultAlgorithm()); + + trustManagerFactory.init(keyStore); + return trustManagerFactory.getTrustManagers(); + + } catch (Exception e) { + e.printStackTrace(); + + } + + return getTrustAllManager(); + } + + /** + * 获得信任所有服务器端证书库 + */ + public static TrustManager[] getTrustAllManager() { + return new TrustManager[]{createTrustAllManager()}; + } + + +} diff --git a/Dmcslot/src/main/res/drawable-anydpi/ic_action_back.xml b/Dmcslot/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Dmcslot/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Dmcslot/src/main/res/drawable-hdpi/ic_action_back.png b/Dmcslot/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Dmcslot/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Dmcslot/src/main/res/drawable-mdpi/ic_action_back.png b/Dmcslot/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Dmcslot/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Dmcslot/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Dmcslot/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Dmcslot/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable-xhdpi/ic_action_back.png b/Dmcslot/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Dmcslot/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Dmcslot/src/main/res/drawable-xxhdpi/ic_action_back.png b/Dmcslot/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Dmcslot/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Dmcslot/src/main/res/drawable/ic_launcher_background.xml b/Dmcslot/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Dmcslot/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/drawable/input_bg.xml b/Dmcslot/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Dmcslot/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/drawable/pass_word_bg.xml b/Dmcslot/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Dmcslot/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/drawable/pass_word_bg1.xml b/Dmcslot/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Dmcslot/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/pass_word_bg2.xml b/Dmcslot/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Dmcslot/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/shape_btn_bg.xml b/Dmcslot/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Dmcslot/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/shape_dialog_bg2.xml b/Dmcslot/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Dmcslot/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/shape_dialog_bg3.xml b/Dmcslot/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Dmcslot/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/shape_dialog_bg_new.xml b/Dmcslot/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/Dmcslot/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/drawable/shape_notify_typebg.xml b/Dmcslot/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/Dmcslot/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/activity_main.xml b/Dmcslot/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/activity_main2.xml b/Dmcslot/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..7c4418c --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_main2.xml @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_main3.xml b/Dmcslot/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..0da4207 --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_notifydetails.xml b/Dmcslot/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..b685255 --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_notifylist.xml b/Dmcslot/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..29a195b --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_start.xml b/Dmcslot/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/activity_webview.xml b/Dmcslot/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..f52274e --- /dev/null +++ b/Dmcslot/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/dialog_action_bankinfo.xml b/Dmcslot/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/dialog_action_confirm.xml b/Dmcslot/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/dialog_action_invite.xml b/Dmcslot/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/dialog_action_invite_records.xml b/Dmcslot/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/dialog_action_withdrawapply.xml b/Dmcslot/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/dialog_select_action.xml b/Dmcslot/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/Dmcslot/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/item_invite_records.xml b/Dmcslot/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/Dmcslot/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/item_notify_list.xml b/Dmcslot/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..9cc22d6 --- /dev/null +++ b/Dmcslot/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/item_withdraw_records.xml b/Dmcslot/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/Dmcslot/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Dmcslot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/mipmap-hdpi/ic_empty.png b/Dmcslot/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Dmcslot/src/main/res/mipmap-hdpi/ic_pull_down.png b/Dmcslot/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_close.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_email.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..aaacc68 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_facebook.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_hometo.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_link.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_menu.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_email.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_tel.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Dmcslot/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Dmcslot/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Dmcslot/src/main/res/mipmap-xxhdpi/app_logo.png b/Dmcslot/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..90e78b7 Binary files /dev/null and b/Dmcslot/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Dmcslot/src/main/res/values-en/strings.xml b/Dmcslot/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..54af636 --- /dev/null +++ b/Dmcslot/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + DMCSLOT + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/Dmcslot/src/main/res/values-night/themes.xml b/Dmcslot/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Dmcslot/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/values/colors.xml b/Dmcslot/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/Dmcslot/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/values/strings.xml b/Dmcslot/src/main/res/values/strings.xml new file mode 100644 index 0000000..b415542 --- /dev/null +++ b/Dmcslot/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + DMCSLOT + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/values/themes.xml b/Dmcslot/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/Dmcslot/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/xml/app_updater_paths.xml b/Dmcslot/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Dmcslot/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/xml/network_security_config.xml b/Dmcslot/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Dmcslot/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/xml/provider_paths.xml b/Dmcslot/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Dmcslot/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Dmcslot/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Dmcslot/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Gdslot888/.gitignore b/Gdslot888/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Gdslot888/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Gdslot888/build.gradle b/Gdslot888/build.gradle new file mode 100644 index 0000000..19368e1 --- /dev/null +++ b/Gdslot888/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.gdslot888" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('gdslot888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('gdslot888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Gdslot888/gdslot888.jks b/Gdslot888/gdslot888.jks new file mode 100644 index 0000000..c35f5c7 Binary files /dev/null and b/Gdslot888/gdslot888.jks differ diff --git a/Gdslot888/google-services.json b/Gdslot888/google-services.json new file mode 100644 index 0000000..af1f5ed --- /dev/null +++ b/Gdslot888/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1031065586711", + "project_id": "gdslot888-2f04f", + "storage_bucket": "gdslot888-2f04f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1031065586711:android:4136ad7324e62f0f966052", + "android_client_info": { + "package_name": "com.web.gdslot888" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCbmZ6jonTvi8D_yzgVVGB-QzckF5crzeo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Gdslot888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Gdslot888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Gdslot888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Gdslot888/proguard-rules.pro b/Gdslot888/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Gdslot888/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Gdslot888/release/Gdslot888.apk b/Gdslot888/release/Gdslot888.apk new file mode 100644 index 0000000..45d3c68 Binary files /dev/null and b/Gdslot888/release/Gdslot888.apk differ diff --git a/Gdslot888/release/output-metadata.json b/Gdslot888/release/output-metadata.json new file mode 100644 index 0000000..c6ca061 --- /dev/null +++ b/Gdslot888/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.gdslot888", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Gdslot888-release.apk" + } + ] +} \ No newline at end of file diff --git a/Gdslot888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Gdslot888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Gdslot888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Gdslot888/src/main/AndroidManifest.xml b/Gdslot888/src/main/AndroidManifest.xml new file mode 100644 index 0000000..cb3472f --- /dev/null +++ b/Gdslot888/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/java/com/web/gdslot888/MainActivity2.java b/Gdslot888/src/main/java/com/web/gdslot888/MainActivity2.java new file mode 100644 index 0000000..dc14c7e --- /dev/null +++ b/Gdslot888/src/main/java/com/web/gdslot888/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.gdslot888; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 89; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.gdslot888.net/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java b/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java new file mode 100644 index 0000000..59b4c7b --- /dev/null +++ b/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.gdslot888; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Gdslot888/src/main/java/com/web/gdslot888/WebApplication.java b/Gdslot888/src/main/java/com/web/gdslot888/WebApplication.java new file mode 100644 index 0000000..68dbbbc --- /dev/null +++ b/Gdslot888/src/main/java/com/web/gdslot888/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.gdslot888; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Gdslot888/src/main/res/drawable-anydpi/ic_action_back.xml b/Gdslot888/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Gdslot888/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Gdslot888/src/main/res/drawable-hdpi/ic_action_back.png b/Gdslot888/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Gdslot888/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Gdslot888/src/main/res/drawable-mdpi/ic_action_back.png b/Gdslot888/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Gdslot888/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Gdslot888/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Gdslot888/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Gdslot888/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/drawable-xhdpi/ic_action_back.png b/Gdslot888/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Gdslot888/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Gdslot888/src/main/res/drawable-xxhdpi/ic_action_back.png b/Gdslot888/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Gdslot888/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Gdslot888/src/main/res/drawable/ic_launcher_background.xml b/Gdslot888/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Gdslot888/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gdslot888/src/main/res/drawable/input_bg.xml b/Gdslot888/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Gdslot888/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Gdslot888/src/main/res/drawable/pass_word_bg.xml b/Gdslot888/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Gdslot888/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Gdslot888/src/main/res/drawable/pass_word_bg1.xml b/Gdslot888/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Gdslot888/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/drawable/pass_word_bg2.xml b/Gdslot888/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Gdslot888/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/drawable/shape_btn_bg.xml b/Gdslot888/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Gdslot888/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/drawable/shape_dialog_bg2.xml b/Gdslot888/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Gdslot888/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/drawable/shape_dialog_bg3.xml b/Gdslot888/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Gdslot888/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Gdslot888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/mipmap-hdpi/ic_empty.png b/Gdslot888/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Gdslot888/src/main/res/mipmap-hdpi/ic_pull_down.png b/Gdslot888/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_close.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_facebook.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_hometo.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_link.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_menu.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_tel.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Gdslot888/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Gdslot888/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Gdslot888/src/main/res/mipmap-xxhdpi/app_logo.jpg b/Gdslot888/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..0bce0b1 Binary files /dev/null and b/Gdslot888/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/Gdslot888/src/main/res/values-en/strings.xml b/Gdslot888/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..13e2b30 --- /dev/null +++ b/Gdslot888/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + GDSlot888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/values-night/themes.xml b/Gdslot888/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Gdslot888/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/values/colors.xml b/Gdslot888/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Gdslot888/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/values/strings.xml b/Gdslot888/src/main/res/values/strings.xml new file mode 100644 index 0000000..317e2f2 --- /dev/null +++ b/Gdslot888/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + GDSlot888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/values/style.xml b/Gdslot888/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Gdslot888/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/values/themes.xml b/Gdslot888/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Gdslot888/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/xml/app_updater_paths.xml b/Gdslot888/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Gdslot888/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/xml/network_security_config.xml b/Gdslot888/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Gdslot888/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/res/xml/provider_paths.xml b/Gdslot888/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Gdslot888/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Gdslot888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Gdslot888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Gdslot888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Jeslot88/.gitignore b/Jeslot88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Jeslot88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Jeslot88/build.gradle b/Jeslot88/build.gradle new file mode 100644 index 0000000..cc21d84 --- /dev/null +++ b/Jeslot88/build.gradle @@ -0,0 +1,91 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.jeslot88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('jeslot88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('jeslot88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Jeslot88/google-services.json b/Jeslot88/google-services.json new file mode 100644 index 0000000..8ed5288 --- /dev/null +++ b/Jeslot88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "54193138344", + "project_id": "jeslot88-11954", + "storage_bucket": "jeslot88-11954.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:54193138344:android:1d108d4e81451ce5bbf09d", + "android_client_info": { + "package_name": "com.web.jeslot88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD3SVVnmLcXEBg7Uh_ngYJx1_Hvy7WsOAo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Jeslot88/jeslot88.jks b/Jeslot88/jeslot88.jks new file mode 100644 index 0000000..4248f26 Binary files /dev/null and b/Jeslot88/jeslot88.jks differ diff --git a/Jeslot88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Jeslot88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Jeslot88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Jeslot88/proguard-rules.pro b/Jeslot88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Jeslot88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Jeslot88/release/Jeslot88.apk b/Jeslot88/release/Jeslot88.apk new file mode 100644 index 0000000..599d649 Binary files /dev/null and b/Jeslot88/release/Jeslot88.apk differ diff --git a/Jeslot88/release/output-metadata.json b/Jeslot88/release/output-metadata.json new file mode 100644 index 0000000..532c027 --- /dev/null +++ b/Jeslot88/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.jeslot88", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Jeslot88-release.apk" + } + ] +} \ No newline at end of file diff --git a/Jeslot88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Jeslot88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Jeslot88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Jeslot88/src/main/AndroidManifest.xml b/Jeslot88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..804578e --- /dev/null +++ b/Jeslot88/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/java/com/web/jeslot88/MainActivity2.java b/Jeslot88/src/main/java/com/web/jeslot88/MainActivity2.java new file mode 100644 index 0000000..74e1b79 --- /dev/null +++ b/Jeslot88/src/main/java/com/web/jeslot88/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.jeslot88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 91; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://jeslot88.online/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Jeslot88/src/main/java/com/web/jeslot88/MyFirebaseMessageingService.java b/Jeslot88/src/main/java/com/web/jeslot88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ff3aa63 --- /dev/null +++ b/Jeslot88/src/main/java/com/web/jeslot88/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.jeslot88; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Jeslot88/src/main/java/com/web/jeslot88/WebApplication.java b/Jeslot88/src/main/java/com/web/jeslot88/WebApplication.java new file mode 100644 index 0000000..a7fd114 --- /dev/null +++ b/Jeslot88/src/main/java/com/web/jeslot88/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.jeslot88; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Jeslot88/src/main/res/drawable-anydpi/ic_action_back.xml b/Jeslot88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Jeslot88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Jeslot88/src/main/res/drawable-hdpi/ic_action_back.png b/Jeslot88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Jeslot88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Jeslot88/src/main/res/drawable-mdpi/ic_action_back.png b/Jeslot88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Jeslot88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Jeslot88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Jeslot88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Jeslot88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/drawable-xhdpi/ic_action_back.png b/Jeslot88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Jeslot88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Jeslot88/src/main/res/drawable-xxhdpi/ic_action_back.png b/Jeslot88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Jeslot88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Jeslot88/src/main/res/drawable/ic_launcher_background.xml b/Jeslot88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Jeslot88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jeslot88/src/main/res/drawable/input_bg.xml b/Jeslot88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Jeslot88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Jeslot88/src/main/res/drawable/pass_word_bg.xml b/Jeslot88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Jeslot88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Jeslot88/src/main/res/drawable/pass_word_bg1.xml b/Jeslot88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Jeslot88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/drawable/pass_word_bg2.xml b/Jeslot88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Jeslot88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/drawable/shape_btn_bg.xml b/Jeslot88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Jeslot88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/drawable/shape_dialog_bg2.xml b/Jeslot88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Jeslot88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/drawable/shape_dialog_bg3.xml b/Jeslot88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Jeslot88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Jeslot88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/mipmap-hdpi/ic_empty.png b/Jeslot88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Jeslot88/src/main/res/mipmap-hdpi/ic_pull_down.png b/Jeslot88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_close.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_facebook.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_hometo.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_link.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_menu.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_tel.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Jeslot88/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Jeslot88/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Jeslot88/src/main/res/mipmap-xxhdpi/app_logo.png b/Jeslot88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..be7b8a3 Binary files /dev/null and b/Jeslot88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Jeslot88/src/main/res/values-en/strings.xml b/Jeslot88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..18dea38 --- /dev/null +++ b/Jeslot88/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + JESLOT88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/values-night/themes.xml b/Jeslot88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Jeslot88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/values/colors.xml b/Jeslot88/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Jeslot88/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/values/strings.xml b/Jeslot88/src/main/res/values/strings.xml new file mode 100644 index 0000000..4fd3377 --- /dev/null +++ b/Jeslot88/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + JESLOT88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/values/style.xml b/Jeslot88/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Jeslot88/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/values/themes.xml b/Jeslot88/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Jeslot88/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/xml/app_updater_paths.xml b/Jeslot88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Jeslot88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/xml/network_security_config.xml b/Jeslot88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Jeslot88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Jeslot88/src/main/res/xml/provider_paths.xml b/Jeslot88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Jeslot88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Jeslot88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Jeslot88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Jeslot88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Judy88/.gitignore b/Judy88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Judy88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Judy88/build.gradle b/Judy88/build.gradle new file mode 100644 index 0000000..957460a --- /dev/null +++ b/Judy88/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.judy88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('judy88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('judy88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Judy88/google-services.json b/Judy88/google-services.json new file mode 100644 index 0000000..908bc34 --- /dev/null +++ b/Judy88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "988212673486", + "project_id": "judy88-904b7", + "storage_bucket": "judy88-904b7.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:988212673486:android:d44bd63db932c6bdf2899f", + "android_client_info": { + "package_name": "com.web.judy88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA2H4KZEBB2fkOJs9ldog9lAAuVSx41Oz0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Judy88/judy88.jks b/Judy88/judy88.jks new file mode 100644 index 0000000..d64c1d9 Binary files /dev/null and b/Judy88/judy88.jks differ diff --git a/Judy88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Judy88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Judy88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Judy88/proguard-rules.pro b/Judy88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Judy88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Judy88/release/Judy88.apk b/Judy88/release/Judy88.apk new file mode 100644 index 0000000..35f1796 Binary files /dev/null and b/Judy88/release/Judy88.apk differ diff --git a/Judy88/release/output-metadata.json b/Judy88/release/output-metadata.json new file mode 100644 index 0000000..15f9386 --- /dev/null +++ b/Judy88/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.judy88", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Judy88-release.apk" + } + ] +} \ No newline at end of file diff --git a/Judy88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Judy88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Judy88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Judy88/src/main/AndroidManifest.xml b/Judy88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6fcf2e3 --- /dev/null +++ b/Judy88/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/java/com/web/judy88/MainActivity2.java b/Judy88/src/main/java/com/web/judy88/MainActivity2.java new file mode 100644 index 0000000..953797e --- /dev/null +++ b/Judy88/src/main/java/com/web/judy88/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.judy88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 92; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url","https://judy88.online/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Judy88/src/main/java/com/web/judy88/MyFirebaseMessageingService.java b/Judy88/src/main/java/com/web/judy88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2e2a684 --- /dev/null +++ b/Judy88/src/main/java/com/web/judy88/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.judy88; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Judy88/src/main/java/com/web/judy88/WebApplication.java b/Judy88/src/main/java/com/web/judy88/WebApplication.java new file mode 100644 index 0000000..0862754 --- /dev/null +++ b/Judy88/src/main/java/com/web/judy88/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.judy88; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Judy88/src/main/res/drawable-anydpi/ic_action_back.xml b/Judy88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Judy88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Judy88/src/main/res/drawable-hdpi/ic_action_back.png b/Judy88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Judy88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Judy88/src/main/res/drawable-mdpi/ic_action_back.png b/Judy88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Judy88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Judy88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Judy88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Judy88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/drawable-xhdpi/ic_action_back.png b/Judy88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Judy88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Judy88/src/main/res/drawable-xxhdpi/ic_action_back.png b/Judy88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Judy88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Judy88/src/main/res/drawable/ic_launcher_background.xml b/Judy88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Judy88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Judy88/src/main/res/drawable/input_bg.xml b/Judy88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Judy88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Judy88/src/main/res/drawable/pass_word_bg.xml b/Judy88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Judy88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Judy88/src/main/res/drawable/pass_word_bg1.xml b/Judy88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Judy88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/drawable/pass_word_bg2.xml b/Judy88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Judy88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/drawable/shape_btn_bg.xml b/Judy88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Judy88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/drawable/shape_dialog_bg2.xml b/Judy88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Judy88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/drawable/shape_dialog_bg3.xml b/Judy88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Judy88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Judy88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/mipmap-hdpi/ic_empty.png b/Judy88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Judy88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Judy88/src/main/res/mipmap-hdpi/ic_pull_down.png b/Judy88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Judy88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_close.png b/Judy88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_facebook.png b/Judy88/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_hometo.png b/Judy88/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_link.png b/Judy88/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_menu.png b/Judy88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Judy88/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_tel.png b/Judy88/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Judy88/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Judy88/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Judy88/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png b/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..5c8ccd0 Binary files /dev/null and b/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Judy88/src/main/res/values-en/strings.xml b/Judy88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..05e7cae --- /dev/null +++ b/Judy88/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + JUDY88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Judy88/src/main/res/values-night/themes.xml b/Judy88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Judy88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/values/colors.xml b/Judy88/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Judy88/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Judy88/src/main/res/values/strings.xml b/Judy88/src/main/res/values/strings.xml new file mode 100644 index 0000000..77c21ea --- /dev/null +++ b/Judy88/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + JUDY88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/values/style.xml b/Judy88/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Judy88/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/values/themes.xml b/Judy88/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Judy88/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/xml/app_updater_paths.xml b/Judy88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Judy88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/xml/network_security_config.xml b/Judy88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Judy88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/xml/provider_paths.xml b/Judy88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Judy88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Judy88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Judy88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Judy88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Kejapjudi/.gitignore b/Kejapjudi/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Kejapjudi/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Kejapjudi/build.gradle b/Kejapjudi/build.gradle new file mode 100644 index 0000000..970aa66 --- /dev/null +++ b/Kejapjudi/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.kejapjudi" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('kj.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('kj.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Kejapjudi/google-services.json b/Kejapjudi/google-services.json new file mode 100644 index 0000000..50e6a9a --- /dev/null +++ b/Kejapjudi/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "39605079051", + "project_id": "kejapjudi-704e8", + "storage_bucket": "kejapjudi-704e8.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:39605079051:android:906fa6147de70d25e84b0e", + "android_client_info": { + "package_name": "com.web.kejapjudi" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBZnMbbkQlBjxrF7U3KEl5NR-ObexmAvNg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Kejapjudi/kj.jks b/Kejapjudi/kj.jks new file mode 100644 index 0000000..77b3fa4 Binary files /dev/null and b/Kejapjudi/kj.jks differ diff --git a/Kejapjudi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Kejapjudi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Kejapjudi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Kejapjudi/proguard-rules.pro b/Kejapjudi/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Kejapjudi/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Kejapjudi/release/Kejapjudi.apk b/Kejapjudi/release/Kejapjudi.apk new file mode 100644 index 0000000..e8b08bf Binary files /dev/null and b/Kejapjudi/release/Kejapjudi.apk differ diff --git a/Kejapjudi/release/output-metadata.json b/Kejapjudi/release/output-metadata.json new file mode 100644 index 0000000..a84ba12 --- /dev/null +++ b/Kejapjudi/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.kejapjudi", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Kejapjudi-release.apk" + } + ] +} \ No newline at end of file diff --git a/Kejapjudi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Kejapjudi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Kejapjudi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Kejapjudi/src/main/AndroidManifest.xml b/Kejapjudi/src/main/AndroidManifest.xml new file mode 100644 index 0000000..db0a4de --- /dev/null +++ b/Kejapjudi/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/java/com/web/kejapjudi/MainActivity2.java b/Kejapjudi/src/main/java/com/web/kejapjudi/MainActivity2.java new file mode 100644 index 0000000..37c1441 --- /dev/null +++ b/Kejapjudi/src/main/java/com/web/kejapjudi/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.kejapjudi; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 93; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://kejapjudi.online/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Kejapjudi/src/main/java/com/web/kejapjudi/MyFirebaseMessageingService.java b/Kejapjudi/src/main/java/com/web/kejapjudi/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5204b20 --- /dev/null +++ b/Kejapjudi/src/main/java/com/web/kejapjudi/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.kejapjudi; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Kejapjudi/src/main/java/com/web/kejapjudi/WebApplication.java b/Kejapjudi/src/main/java/com/web/kejapjudi/WebApplication.java new file mode 100644 index 0000000..2158c2e --- /dev/null +++ b/Kejapjudi/src/main/java/com/web/kejapjudi/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.kejapjudi; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Kejapjudi/src/main/res/drawable-anydpi/ic_action_back.xml b/Kejapjudi/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Kejapjudi/src/main/res/drawable-hdpi/ic_action_back.png b/Kejapjudi/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Kejapjudi/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Kejapjudi/src/main/res/drawable-mdpi/ic_action_back.png b/Kejapjudi/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Kejapjudi/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Kejapjudi/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Kejapjudi/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/drawable-xhdpi/ic_action_back.png b/Kejapjudi/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Kejapjudi/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Kejapjudi/src/main/res/drawable-xxhdpi/ic_action_back.png b/Kejapjudi/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Kejapjudi/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Kejapjudi/src/main/res/drawable/ic_launcher_background.xml b/Kejapjudi/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kejapjudi/src/main/res/drawable/input_bg.xml b/Kejapjudi/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Kejapjudi/src/main/res/drawable/pass_word_bg.xml b/Kejapjudi/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Kejapjudi/src/main/res/drawable/pass_word_bg1.xml b/Kejapjudi/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/drawable/pass_word_bg2.xml b/Kejapjudi/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/drawable/shape_btn_bg.xml b/Kejapjudi/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/drawable/shape_dialog_bg2.xml b/Kejapjudi/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/drawable/shape_dialog_bg3.xml b/Kejapjudi/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Kejapjudi/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Kejapjudi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/mipmap-hdpi/ic_empty.png b/Kejapjudi/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Kejapjudi/src/main/res/mipmap-hdpi/ic_pull_down.png b/Kejapjudi/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_close.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_facebook.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_hometo.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_link.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_menu.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_tel.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Kejapjudi/src/main/res/mipmap-xxhdpi/app_logo.jpg b/Kejapjudi/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..b6732cc Binary files /dev/null and b/Kejapjudi/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/Kejapjudi/src/main/res/values-en/strings.xml b/Kejapjudi/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..a61880f --- /dev/null +++ b/Kejapjudi/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + KJ + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/values-night/themes.xml b/Kejapjudi/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Kejapjudi/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/values/colors.xml b/Kejapjudi/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Kejapjudi/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/values/strings.xml b/Kejapjudi/src/main/res/values/strings.xml new file mode 100644 index 0000000..c68cd74 --- /dev/null +++ b/Kejapjudi/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + KJ + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/values/style.xml b/Kejapjudi/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Kejapjudi/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/values/themes.xml b/Kejapjudi/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Kejapjudi/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/xml/app_updater_paths.xml b/Kejapjudi/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Kejapjudi/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/xml/network_security_config.xml b/Kejapjudi/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Kejapjudi/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Kejapjudi/src/main/res/xml/provider_paths.xml b/Kejapjudi/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Kejapjudi/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Kejapjudi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Kejapjudi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Kejapjudi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Magnum888/.gitignore b/Magnum888/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Magnum888/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Magnum888/build.gradle b/Magnum888/build.gradle new file mode 100644 index 0000000..07117cb --- /dev/null +++ b/Magnum888/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.magnum888" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('magnum888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('magnum888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Magnum888/google-services.json b/Magnum888/google-services.json new file mode 100644 index 0000000..4365515 --- /dev/null +++ b/Magnum888/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "454931833879", + "project_id": "magnum888-136ec", + "storage_bucket": "magnum888-136ec.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:454931833879:android:448a55f8cb5b8ce10e6852", + "android_client_info": { + "package_name": "com.web.magnum888" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDykjEg62UYo3mDaEHAwO_QbWzgbAtRlRQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Magnum888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Magnum888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Magnum888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Magnum888/magnum888.jks b/Magnum888/magnum888.jks new file mode 100644 index 0000000..ae9d5d1 Binary files /dev/null and b/Magnum888/magnum888.jks differ diff --git a/Magnum888/proguard-rules.pro b/Magnum888/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Magnum888/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Magnum888/release/Magnum888.apk b/Magnum888/release/Magnum888.apk new file mode 100644 index 0000000..df4c72d Binary files /dev/null and b/Magnum888/release/Magnum888.apk differ diff --git a/Magnum888/release/output-metadata.json b/Magnum888/release/output-metadata.json new file mode 100644 index 0000000..dc193f5 --- /dev/null +++ b/Magnum888/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.magnum888", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Magnum888-release.apk" + } + ] +} \ No newline at end of file diff --git a/Magnum888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Magnum888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Magnum888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Magnum888/src/main/AndroidManifest.xml b/Magnum888/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2a0e046 --- /dev/null +++ b/Magnum888/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/java/com/web/magnum888/MainActivity2.java b/Magnum888/src/main/java/com/web/magnum888/MainActivity2.java new file mode 100644 index 0000000..0046533 --- /dev/null +++ b/Magnum888/src/main/java/com/web/magnum888/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.magnum888; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 94; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url","https://www.magnum888.cash/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java b/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0031a0b --- /dev/null +++ b/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.magnum888; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Magnum888/src/main/java/com/web/magnum888/WebApplication.java b/Magnum888/src/main/java/com/web/magnum888/WebApplication.java new file mode 100644 index 0000000..f2ae6c0 --- /dev/null +++ b/Magnum888/src/main/java/com/web/magnum888/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.magnum888; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Magnum888/src/main/res/drawable-anydpi/ic_action_back.xml b/Magnum888/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Magnum888/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Magnum888/src/main/res/drawable-hdpi/ic_action_back.png b/Magnum888/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Magnum888/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Magnum888/src/main/res/drawable-mdpi/ic_action_back.png b/Magnum888/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Magnum888/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Magnum888/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Magnum888/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Magnum888/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/drawable-xhdpi/ic_action_back.png b/Magnum888/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Magnum888/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Magnum888/src/main/res/drawable-xxhdpi/ic_action_back.png b/Magnum888/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Magnum888/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Magnum888/src/main/res/drawable/ic_launcher_background.xml b/Magnum888/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Magnum888/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Magnum888/src/main/res/drawable/input_bg.xml b/Magnum888/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Magnum888/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Magnum888/src/main/res/drawable/pass_word_bg.xml b/Magnum888/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Magnum888/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Magnum888/src/main/res/drawable/pass_word_bg1.xml b/Magnum888/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Magnum888/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/drawable/pass_word_bg2.xml b/Magnum888/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Magnum888/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/drawable/shape_btn_bg.xml b/Magnum888/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Magnum888/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/drawable/shape_dialog_bg2.xml b/Magnum888/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Magnum888/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/drawable/shape_dialog_bg3.xml b/Magnum888/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Magnum888/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Magnum888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/mipmap-hdpi/ic_empty.png b/Magnum888/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Magnum888/src/main/res/mipmap-hdpi/ic_pull_down.png b/Magnum888/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_close.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_facebook.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_hometo.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_link.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_menu.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_tel.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Magnum888/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Magnum888/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Magnum888/src/main/res/mipmap-xxhdpi/app_logo.png b/Magnum888/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..fa5f04f Binary files /dev/null and b/Magnum888/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Magnum888/src/main/res/values-en/strings.xml b/Magnum888/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c9d3584 --- /dev/null +++ b/Magnum888/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Magnum888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Magnum888/src/main/res/values-night/themes.xml b/Magnum888/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Magnum888/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/values/colors.xml b/Magnum888/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Magnum888/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Magnum888/src/main/res/values/strings.xml b/Magnum888/src/main/res/values/strings.xml new file mode 100644 index 0000000..40bbbb2 --- /dev/null +++ b/Magnum888/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + Magnum888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/values/style.xml b/Magnum888/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Magnum888/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/values/themes.xml b/Magnum888/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Magnum888/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/xml/app_updater_paths.xml b/Magnum888/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Magnum888/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/xml/network_security_config.xml b/Magnum888/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Magnum888/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Magnum888/src/main/res/xml/provider_paths.xml b/Magnum888/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Magnum888/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Magnum888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Magnum888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Magnum888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Mahkota8/.gitignore b/Mahkota8/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Mahkota8/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Mahkota8/build.gradle b/Mahkota8/build.gradle new file mode 100644 index 0000000..6c3a054 --- /dev/null +++ b/Mahkota8/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.MAHKOTA8" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('mahkota8.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('mahkota8.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Mahkota8/google-services.json b/Mahkota8/google-services.json new file mode 100644 index 0000000..397c322 --- /dev/null +++ b/Mahkota8/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "643424299568", + "project_id": "mahkota8-186da", + "storage_bucket": "mahkota8-186da.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:643424299568:android:7ef0cd13dc9175bafb9bf5", + "android_client_info": { + "package_name": "com.web.MAHKOTA8" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBuleiR8aPa6Dt3kevaK4wtSoYck31s8AU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Mahkota8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Mahkota8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Mahkota8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Mahkota8/mahkota8.jks b/Mahkota8/mahkota8.jks new file mode 100644 index 0000000..bfc85ea Binary files /dev/null and b/Mahkota8/mahkota8.jks differ diff --git a/Mahkota8/proguard-rules.pro b/Mahkota8/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Mahkota8/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Mahkota8/release/Mahkota8.apk b/Mahkota8/release/Mahkota8.apk new file mode 100644 index 0000000..f9612b3 Binary files /dev/null and b/Mahkota8/release/Mahkota8.apk differ diff --git a/Mahkota8/release/output-metadata.json b/Mahkota8/release/output-metadata.json new file mode 100644 index 0000000..98d5e51 --- /dev/null +++ b/Mahkota8/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.MAHKOTA8", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Mahkota8-release.apk" + } + ] +} \ No newline at end of file diff --git a/Mahkota8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Mahkota8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Mahkota8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Mahkota8/src/main/AndroidManifest.xml b/Mahkota8/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f9ff485 --- /dev/null +++ b/Mahkota8/src/main/AndroidManifest.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java b/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java new file mode 100644 index 0000000..2deebb8 --- /dev/null +++ b/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.MAHKOTA8; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 95; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.mahkota8b.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Mahkota8/src/main/java/com/web/MAHKOTA8/MyFirebaseMessageingService.java b/Mahkota8/src/main/java/com/web/MAHKOTA8/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e9122a0 --- /dev/null +++ b/Mahkota8/src/main/java/com/web/MAHKOTA8/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.MAHKOTA8; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Mahkota8/src/main/java/com/web/MAHKOTA8/WebApplication.java b/Mahkota8/src/main/java/com/web/MAHKOTA8/WebApplication.java new file mode 100644 index 0000000..74a81a1 --- /dev/null +++ b/Mahkota8/src/main/java/com/web/MAHKOTA8/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.MAHKOTA8; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Mahkota8/src/main/res/drawable-anydpi/ic_action_back.xml b/Mahkota8/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Mahkota8/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Mahkota8/src/main/res/drawable-hdpi/ic_action_back.png b/Mahkota8/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Mahkota8/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Mahkota8/src/main/res/drawable-mdpi/ic_action_back.png b/Mahkota8/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Mahkota8/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Mahkota8/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Mahkota8/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Mahkota8/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/drawable-xhdpi/ic_action_back.png b/Mahkota8/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Mahkota8/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Mahkota8/src/main/res/drawable-xxhdpi/ic_action_back.png b/Mahkota8/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Mahkota8/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Mahkota8/src/main/res/drawable/ic_launcher_background.xml b/Mahkota8/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Mahkota8/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mahkota8/src/main/res/drawable/input_bg.xml b/Mahkota8/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Mahkota8/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mahkota8/src/main/res/drawable/pass_word_bg.xml b/Mahkota8/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Mahkota8/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mahkota8/src/main/res/drawable/pass_word_bg1.xml b/Mahkota8/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Mahkota8/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/drawable/pass_word_bg2.xml b/Mahkota8/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Mahkota8/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/drawable/shape_btn_bg.xml b/Mahkota8/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Mahkota8/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/drawable/shape_dialog_bg2.xml b/Mahkota8/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Mahkota8/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/drawable/shape_dialog_bg3.xml b/Mahkota8/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Mahkota8/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mahkota8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/mipmap-hdpi/ic_empty.png b/Mahkota8/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Mahkota8/src/main/res/mipmap-hdpi/ic_pull_down.png b/Mahkota8/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_close.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_facebook.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_hometo.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_link.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_menu.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_tel.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Mahkota8/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Mahkota8/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png b/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a4e5047 Binary files /dev/null and b/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Mahkota8/src/main/res/values-en/strings.xml b/Mahkota8/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..a5d300d --- /dev/null +++ b/Mahkota8/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + MAHKOTA8 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/values-night/themes.xml b/Mahkota8/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Mahkota8/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/values/colors.xml b/Mahkota8/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Mahkota8/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/values/strings.xml b/Mahkota8/src/main/res/values/strings.xml new file mode 100644 index 0000000..88897f2 --- /dev/null +++ b/Mahkota8/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + MAHKOTA8 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/values/style.xml b/Mahkota8/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Mahkota8/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/values/themes.xml b/Mahkota8/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Mahkota8/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/xml/app_updater_paths.xml b/Mahkota8/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Mahkota8/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/xml/network_security_config.xml b/Mahkota8/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Mahkota8/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/xml/provider_paths.xml b/Mahkota8/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Mahkota8/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Mahkota8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Mahkota8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Mahkota8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Mk88aud/.gitignore b/Mk88aud/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Mk88aud/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Mk88aud/build.gradle b/Mk88aud/build.gradle new file mode 100644 index 0000000..c0bf23b --- /dev/null +++ b/Mk88aud/build.gradle @@ -0,0 +1,86 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.mk88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('mk88aud.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('mk88aud.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Mk88aud/google-services.json b/Mk88aud/google-services.json new file mode 100644 index 0000000..3d619cf --- /dev/null +++ b/Mk88aud/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "637535395676", + "project_id": "mk88au", + "storage_bucket": "mk88au.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:637535395676:android:4a3c0ba171a6445b11ab99", + "android_client_info": { + "package_name": "com.web.mk88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBVa3ICPExBtE4YSVn0Fuimd0FoELPCvWA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Mk88aud/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Mk88aud/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Mk88aud/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Mk88aud/mk88aud.jks b/Mk88aud/mk88aud.jks new file mode 100644 index 0000000..b12b26b Binary files /dev/null and b/Mk88aud/mk88aud.jks differ diff --git a/Mk88aud/proguard-rules.pro b/Mk88aud/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Mk88aud/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Mk88aud/release/mk88aud.apk b/Mk88aud/release/mk88aud.apk new file mode 100644 index 0000000..3d63569 Binary files /dev/null and b/Mk88aud/release/mk88aud.apk differ diff --git a/Mk88aud/release/output-metadata.json b/Mk88aud/release/output-metadata.json new file mode 100644 index 0000000..9b2b426 --- /dev/null +++ b/Mk88aud/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.mk88", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Mk88aud-release.apk" + } + ] +} \ No newline at end of file diff --git a/Mk88aud/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Mk88aud/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Mk88aud/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Mk88aud/src/main/AndroidManifest.xml b/Mk88aud/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7d6fd5c --- /dev/null +++ b/Mk88aud/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/java/com/web/mk88/MainActivity2.java b/Mk88aud/src/main/java/com/web/mk88/MainActivity2.java new file mode 100644 index 0000000..31c3693 --- /dev/null +++ b/Mk88aud/src/main/java/com/web/mk88/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.mk88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 57; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://mk88au.net/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Mk88aud/src/main/java/com/web/mk88/MyFirebaseMessageingService.java b/Mk88aud/src/main/java/com/web/mk88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..429ca5d --- /dev/null +++ b/Mk88aud/src/main/java/com/web/mk88/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.mk88; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Mk88aud/src/main/java/com/web/mk88/WebApplication.java b/Mk88aud/src/main/java/com/web/mk88/WebApplication.java new file mode 100644 index 0000000..b89d491 --- /dev/null +++ b/Mk88aud/src/main/java/com/web/mk88/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.mk88; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Mk88aud/src/main/res/drawable-anydpi/ic_action_back.xml b/Mk88aud/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Mk88aud/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Mk88aud/src/main/res/drawable-hdpi/ic_action_back.png b/Mk88aud/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Mk88aud/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Mk88aud/src/main/res/drawable-mdpi/ic_action_back.png b/Mk88aud/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Mk88aud/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Mk88aud/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Mk88aud/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Mk88aud/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable-xhdpi/ic_action_back.png b/Mk88aud/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Mk88aud/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Mk88aud/src/main/res/drawable-xxhdpi/ic_action_back.png b/Mk88aud/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Mk88aud/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Mk88aud/src/main/res/drawable/ic_launcher_background.xml b/Mk88aud/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Mk88aud/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mk88aud/src/main/res/drawable/input_bg.xml b/Mk88aud/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Mk88aud/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mk88aud/src/main/res/drawable/pass_word_bg.xml b/Mk88aud/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Mk88aud/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mk88aud/src/main/res/drawable/pass_word_bg1.xml b/Mk88aud/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Mk88aud/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable/pass_word_bg2.xml b/Mk88aud/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Mk88aud/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable/shape_btn_bg.xml b/Mk88aud/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Mk88aud/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable/shape_dialog_bg2.xml b/Mk88aud/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Mk88aud/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable/shape_dialog_bg3.xml b/Mk88aud/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Mk88aud/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/drawable/shape_dialog_bg_new.xml b/Mk88aud/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/Mk88aud/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mk88aud/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/mipmap-hdpi/ic_empty.png b/Mk88aud/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Mk88aud/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Mk88aud/src/main/res/mipmap-hdpi/ic_pull_down.png b/Mk88aud/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Mk88aud/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Mk88aud/src/main/res/mipmap-xhdpi/ic_close.png b/Mk88aud/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Mk88aud/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Mk88aud/src/main/res/mipmap-xhdpi/ic_menu.png b/Mk88aud/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Mk88aud/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Mk88aud/src/main/res/mipmap-xxhdpi/app_logo.png b/Mk88aud/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..221562f Binary files /dev/null and b/Mk88aud/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Mk88aud/src/main/res/values-en/strings.xml b/Mk88aud/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..2a49705 --- /dev/null +++ b/Mk88aud/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + MK88AUD + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/Mk88aud/src/main/res/values-night/themes.xml b/Mk88aud/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Mk88aud/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/values/colors.xml b/Mk88aud/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/Mk88aud/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/values/strings.xml b/Mk88aud/src/main/res/values/strings.xml new file mode 100644 index 0000000..30d78da --- /dev/null +++ b/Mk88aud/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MK88AUD + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/values/themes.xml b/Mk88aud/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/Mk88aud/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/xml/app_updater_paths.xml b/Mk88aud/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Mk88aud/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/xml/network_security_config.xml b/Mk88aud/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Mk88aud/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Mk88aud/src/main/res/xml/provider_paths.xml b/Mk88aud/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Mk88aud/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Mk88aud/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Mk88aud/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Mk88aud/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Mko888/.gitignore b/Mko888/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Mko888/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Mko888/build.gradle b/Mko888/build.gradle new file mode 100644 index 0000000..01afe57 --- /dev/null +++ b/Mko888/build.gradle @@ -0,0 +1,91 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.MKO888" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('mko888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('mko888.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') +} \ No newline at end of file diff --git a/Mko888/google-services.json b/Mko888/google-services.json new file mode 100644 index 0000000..cf646ca --- /dev/null +++ b/Mko888/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "542008271037", + "project_id": "mko888", + "storage_bucket": "mko888.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:542008271037:android:afa77592f5cb7f5fd957d4", + "android_client_info": { + "package_name": "com.web.MKO888" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBxl0WvwdSZbH0_Eec_zeRvP7KwOnIqmuY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Mko888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Mko888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Mko888/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Mko888/mko888.jks b/Mko888/mko888.jks new file mode 100644 index 0000000..b677fdb Binary files /dev/null and b/Mko888/mko888.jks differ diff --git a/Mko888/proguard-rules.pro b/Mko888/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Mko888/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Mko888/release/Mko888.apk b/Mko888/release/Mko888.apk new file mode 100644 index 0000000..36ce817 Binary files /dev/null and b/Mko888/release/Mko888.apk differ diff --git a/Mko888/release/output-metadata.json b/Mko888/release/output-metadata.json new file mode 100644 index 0000000..f1c3107 --- /dev/null +++ b/Mko888/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.MKO888", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Mko888-release.apk" + } + ] +} \ No newline at end of file diff --git a/Mko888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Mko888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Mko888/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Mko888/src/main/AndroidManifest.xml b/Mko888/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1c34d6b --- /dev/null +++ b/Mko888/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/java/com/web/MKO888/MainActivity2.java b/Mko888/src/main/java/com/web/MKO888/MainActivity2.java new file mode 100644 index 0000000..084db10 --- /dev/null +++ b/Mko888/src/main/java/com/web/MKO888/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.MKO888; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 96; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.mko888.net/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java b/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java new file mode 100644 index 0000000..703d0aa --- /dev/null +++ b/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.MKO888; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Mko888/src/main/java/com/web/MKO888/WebApplication.java b/Mko888/src/main/java/com/web/MKO888/WebApplication.java new file mode 100644 index 0000000..92fc4bb --- /dev/null +++ b/Mko888/src/main/java/com/web/MKO888/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.MKO888; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Mko888/src/main/res/drawable-anydpi/ic_action_back.xml b/Mko888/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Mko888/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Mko888/src/main/res/drawable-hdpi/ic_action_back.png b/Mko888/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Mko888/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Mko888/src/main/res/drawable-mdpi/ic_action_back.png b/Mko888/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Mko888/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Mko888/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Mko888/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Mko888/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/drawable-xhdpi/ic_action_back.png b/Mko888/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Mko888/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Mko888/src/main/res/drawable-xxhdpi/ic_action_back.png b/Mko888/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Mko888/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Mko888/src/main/res/drawable/ic_launcher_background.xml b/Mko888/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Mko888/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mko888/src/main/res/drawable/input_bg.xml b/Mko888/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Mko888/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mko888/src/main/res/drawable/pass_word_bg.xml b/Mko888/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Mko888/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Mko888/src/main/res/drawable/pass_word_bg1.xml b/Mko888/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Mko888/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/drawable/pass_word_bg2.xml b/Mko888/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Mko888/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/drawable/shape_btn_bg.xml b/Mko888/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Mko888/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/drawable/shape_dialog_bg2.xml b/Mko888/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Mko888/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/drawable/shape_dialog_bg3.xml b/Mko888/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Mko888/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Mko888/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/mipmap-hdpi/ic_empty.png b/Mko888/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Mko888/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Mko888/src/main/res/mipmap-hdpi/ic_pull_down.png b/Mko888/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Mko888/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_close.png b/Mko888/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_facebook.png b/Mko888/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_hometo.png b/Mko888/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_link.png b/Mko888/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_menu.png b/Mko888/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Mko888/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_tel.png b/Mko888/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Mko888/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Mko888/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Mko888/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Mko888/src/main/res/mipmap-xxhdpi/app_logo.png b/Mko888/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..d84ea93 Binary files /dev/null and b/Mko888/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Mko888/src/main/res/values-en/strings.xml b/Mko888/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..8e0c599 --- /dev/null +++ b/Mko888/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + MKO888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Mko888/src/main/res/values-night/themes.xml b/Mko888/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Mko888/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/values/colors.xml b/Mko888/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Mko888/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Mko888/src/main/res/values/strings.xml b/Mko888/src/main/res/values/strings.xml new file mode 100644 index 0000000..9e0562c --- /dev/null +++ b/Mko888/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + MKO888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/values/style.xml b/Mko888/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Mko888/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/values/themes.xml b/Mko888/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Mko888/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/xml/app_updater_paths.xml b/Mko888/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Mko888/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/xml/network_security_config.xml b/Mko888/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Mko888/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Mko888/src/main/res/xml/provider_paths.xml b/Mko888/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Mko888/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Mko888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Mko888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Mko888/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/Petron777/.gitignore b/Petron777/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Petron777/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Petron777/build.gradle b/Petron777/build.gradle new file mode 100644 index 0000000..81a7f67 --- /dev/null +++ b/Petron777/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.petron777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('petron777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('petron777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/Petron777/google-services.json b/Petron777/google-services.json new file mode 100644 index 0000000..d7146ec --- /dev/null +++ b/Petron777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "58444174936", + "project_id": "petron777-7720f", + "storage_bucket": "petron777-7720f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:58444174936:android:cbed18389c63a6b1c8dc2d", + "android_client_info": { + "package_name": "com.web.petron777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBwhI_8NkjpJWrvnuETE-HhKnuh1Rv2qKc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Petron777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/Petron777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/Petron777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/Petron777/petron777.jks b/Petron777/petron777.jks new file mode 100644 index 0000000..d6fc58e Binary files /dev/null and b/Petron777/petron777.jks differ diff --git a/Petron777/proguard-rules.pro b/Petron777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Petron777/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/Petron777/release/Petron777.apk b/Petron777/release/Petron777.apk new file mode 100644 index 0000000..7b16696 Binary files /dev/null and b/Petron777/release/Petron777.apk differ diff --git a/Petron777/release/output-metadata.json b/Petron777/release/output-metadata.json new file mode 100644 index 0000000..d20218d --- /dev/null +++ b/Petron777/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.petron777", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "Petron777-release.apk" + } + ] +} \ No newline at end of file diff --git a/Petron777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/Petron777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/Petron777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Petron777/src/main/AndroidManifest.xml b/Petron777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..65a209c --- /dev/null +++ b/Petron777/src/main/AndroidManifest.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/java/com/web/petron777/MainActivity2.java b/Petron777/src/main/java/com/web/petron777/MainActivity2.java new file mode 100644 index 0000000..9b22845 --- /dev/null +++ b/Petron777/src/main/java/com/web/petron777/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.petron777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 97; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://p777.asia/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java b/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d5022db --- /dev/null +++ b/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.petron777; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/Petron777/src/main/java/com/web/petron777/WebApplication.java b/Petron777/src/main/java/com/web/petron777/WebApplication.java new file mode 100644 index 0000000..f981e78 --- /dev/null +++ b/Petron777/src/main/java/com/web/petron777/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.petron777; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/Petron777/src/main/res/drawable-anydpi/ic_action_back.xml b/Petron777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/Petron777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/Petron777/src/main/res/drawable-hdpi/ic_action_back.png b/Petron777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/Petron777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/Petron777/src/main/res/drawable-mdpi/ic_action_back.png b/Petron777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/Petron777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/Petron777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Petron777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Petron777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/drawable-xhdpi/ic_action_back.png b/Petron777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/Petron777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/Petron777/src/main/res/drawable-xxhdpi/ic_action_back.png b/Petron777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/Petron777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/Petron777/src/main/res/drawable/ic_launcher_background.xml b/Petron777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Petron777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Petron777/src/main/res/drawable/input_bg.xml b/Petron777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/Petron777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/Petron777/src/main/res/drawable/pass_word_bg.xml b/Petron777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/Petron777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/Petron777/src/main/res/drawable/pass_word_bg1.xml b/Petron777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/Petron777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/drawable/pass_word_bg2.xml b/Petron777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/Petron777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/drawable/shape_btn_bg.xml b/Petron777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/Petron777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/drawable/shape_dialog_bg2.xml b/Petron777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/Petron777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/drawable/shape_dialog_bg3.xml b/Petron777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/Petron777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/Petron777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/mipmap-hdpi/ic_empty.png b/Petron777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/Petron777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/Petron777/src/main/res/mipmap-hdpi/ic_pull_down.png b/Petron777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/Petron777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_close.png b/Petron777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_facebook.png b/Petron777/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_hometo.png b/Petron777/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_link.png b/Petron777/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_menu.png b/Petron777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_shousuo.png b/Petron777/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_tel.png b/Petron777/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/Petron777/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/Petron777/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/Petron777/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/Petron777/src/main/res/mipmap-xxhdpi/app_logo.png b/Petron777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a06c233 Binary files /dev/null and b/Petron777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Petron777/src/main/res/values-en/strings.xml b/Petron777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..8b50030 --- /dev/null +++ b/Petron777/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Petron777 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/Petron777/src/main/res/values-night/themes.xml b/Petron777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/Petron777/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/values/colors.xml b/Petron777/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/Petron777/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/Petron777/src/main/res/values/strings.xml b/Petron777/src/main/res/values/strings.xml new file mode 100644 index 0000000..9923a58 --- /dev/null +++ b/Petron777/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + Petron777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/values/style.xml b/Petron777/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/Petron777/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/values/themes.xml b/Petron777/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/Petron777/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/xml/app_updater_paths.xml b/Petron777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Petron777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/xml/network_security_config.xml b/Petron777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Petron777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Petron777/src/main/res/xml/provider_paths.xml b/Petron777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Petron777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Petron777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/Petron777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/Petron777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/README.md b/README.md index d59af97..bb096d3 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,13 @@ -# web_fengzhuang +# TestWeb App 封装APP Test版本,新需求修改版本 +# V1.0.0 ~ V1.0.1 +新增银行信息 +新增通知,跳转查看网页 +新增后台接口配置显示关闭权限,跳转打开facebook,telegram等 -## Getting started -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +# V1.0.2 2025年1月8日 start +新增邮箱通知 -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin http://git.dengshikj.com/webapp/web_fengzhuang.git -git branch -M master -git push -uf origin master -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](http://git.dengshikj.com/webapp/web_fengzhuang/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. + \ No newline at end of file diff --git a/agn888new/.gitignore b/agn888new/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/agn888new/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/agn888new/agn.jks b/agn888new/agn.jks new file mode 100644 index 0000000..7d66cac Binary files /dev/null and b/agn888new/agn.jks differ diff --git a/agn888new/build.gradle b/agn888new/build.gradle new file mode 100644 index 0000000..4b96aeb --- /dev/null +++ b/agn888new/build.gradle @@ -0,0 +1,94 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + //37 + compileSdkVersion 31 + + + defaultConfig { + //37 + applicationId "com.web.agn888new" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 104 + versionName "v1.0.4" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('agn.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('agn.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/agn888new/google-services.json b/agn888new/google-services.json new file mode 100644 index 0000000..bc5fa57 --- /dev/null +++ b/agn888new/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "908864777300", + "project_id": "agn888-3b8ef", + "storage_bucket": "agn888-3b8ef.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:908864777300:android:682bf12a10bfa0dbac11c1", + "android_client_info": { + "package_name": "com.web.agn888new" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:908864777300:android:fc7d3cac6abe01c2ac11c1", + "android_client_info": { + "package_name": "com.web.agn888newnew" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/agn888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/agn888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/agn888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/agn888new/proguard-rules.pro b/agn888new/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/agn888new/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/agn888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/agn888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/agn888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/agn888new/src/main/AndroidManifest.xml b/agn888new/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df84a40 --- /dev/null +++ b/agn888new/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/java/com/web/agn888new/MainActivity2.java b/agn888new/src/main/java/com/web/agn888new/MainActivity2.java new file mode 100644 index 0000000..2c5ae93 --- /dev/null +++ b/agn888new/src/main/java/com/web/agn888new/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.agn888new; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 37; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/agn888new/src/main/java/com/web/agn888new/MyFirebaseMessageingService.java b/agn888new/src/main/java/com/web/agn888new/MyFirebaseMessageingService.java new file mode 100644 index 0000000..7b925ec --- /dev/null +++ b/agn888new/src/main/java/com/web/agn888new/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.agn888new; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/agn888new/src/main/java/com/web/agn888new/WebApplication.java b/agn888new/src/main/java/com/web/agn888new/WebApplication.java new file mode 100644 index 0000000..b8e813a --- /dev/null +++ b/agn888new/src/main/java/com/web/agn888new/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.agn888new; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/agn888new/src/main/res/drawable-anydpi/ic_action_back.xml b/agn888new/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/agn888new/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/agn888new/src/main/res/drawable-hdpi/ic_action_back.png b/agn888new/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/agn888new/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/agn888new/src/main/res/drawable-mdpi/ic_action_back.png b/agn888new/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/agn888new/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/agn888new/src/main/res/drawable-v24/ic_launcher_foreground.xml b/agn888new/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/agn888new/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/drawable-xhdpi/ic_action_back.png b/agn888new/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/agn888new/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/agn888new/src/main/res/drawable-xxhdpi/ic_action_back.png b/agn888new/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/agn888new/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/agn888new/src/main/res/drawable/ic_launcher_background.xml b/agn888new/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/agn888new/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/agn888new/src/main/res/drawable/input_bg.xml b/agn888new/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/agn888new/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/agn888new/src/main/res/drawable/pass_word_bg.xml b/agn888new/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/agn888new/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/agn888new/src/main/res/drawable/pass_word_bg1.xml b/agn888new/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/agn888new/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/drawable/pass_word_bg2.xml b/agn888new/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/agn888new/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/drawable/shape_btn_bg.xml b/agn888new/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/agn888new/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/drawable/shape_dialog_bg2.xml b/agn888new/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/agn888new/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/drawable/shape_dialog_bg3.xml b/agn888new/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/agn888new/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/agn888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/mipmap-hdpi/ic_empty.png b/agn888new/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/agn888new/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/agn888new/src/main/res/mipmap-hdpi/ic_pull_down.png b/agn888new/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/agn888new/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_close.png b/agn888new/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_facebook.png b/agn888new/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_hometo.png b/agn888new/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_link.png b/agn888new/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_menu.png b/agn888new/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_shousuo.png b/agn888new/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_tel.png b/agn888new/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/agn888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/agn888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/agn888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/agn888new/src/main/res/mipmap-xxhdpi/app_logo.png b/agn888new/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..fdcd8f0 Binary files /dev/null and b/agn888new/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/agn888new/src/main/res/values-en/strings.xml b/agn888new/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..6b880b4 --- /dev/null +++ b/agn888new/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + AGN888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/agn888new/src/main/res/values-night/themes.xml b/agn888new/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/agn888new/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/values/colors.xml b/agn888new/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/agn888new/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/agn888new/src/main/res/values/strings.xml b/agn888new/src/main/res/values/strings.xml new file mode 100644 index 0000000..e804ce3 --- /dev/null +++ b/agn888new/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + AGN888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/values/style.xml b/agn888new/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/agn888new/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/values/themes.xml b/agn888new/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/agn888new/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/xml/app_updater_paths.xml b/agn888new/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/agn888new/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/xml/network_security_config.xml b/agn888new/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/agn888new/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/agn888new/src/main/res/xml/provider_paths.xml b/agn888new/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/agn888new/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/agn888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/agn888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/agn888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/amb88/.gitignore b/amb88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/amb88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/amb88/build.gradle b/amb88/build.gradle new file mode 100644 index 0000000..fc8bbc4 --- /dev/null +++ b/amb88/build.gradle @@ -0,0 +1,86 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + //61 + applicationId "com.web.amb88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 11 + versionName "v1.0.1" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:23.0.0") + implementation("com.google.firebase:firebase-analytics:20.0.0") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/amb88/dskjweb.jks b/amb88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/amb88/dskjweb.jks differ diff --git a/amb88/google-services.json b/amb88/google-services.json new file mode 100644 index 0000000..2d1036f --- /dev/null +++ b/amb88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "12964289424", + "project_id": "amb88-4af34", + "storage_bucket": "amb88-4af34.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:12964289424:android:eefd01b1203cf5da60f115", + "android_client_info": { + "package_name": "com.web.amb88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBVWdVFuU_okeBn1M__2C0irSwcPNr5gns" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/amb88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/amb88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/amb88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/amb88/proguard-rules.pro b/amb88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/amb88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/amb88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/amb88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/amb88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/amb88/src/main/AndroidManifest.xml b/amb88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e8d2842 --- /dev/null +++ b/amb88/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/java/com/web/amb88/MainActivity2.java b/amb88/src/main/java/com/web/amb88/MainActivity2.java new file mode 100644 index 0000000..f293801 --- /dev/null +++ b/amb88/src/main/java/com/web/amb88/MainActivity2.java @@ -0,0 +1,52 @@ +package com.web.amb88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 61; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + + +} diff --git a/amb88/src/main/java/com/web/amb88/MyFirebaseMessageingService.java b/amb88/src/main/java/com/web/amb88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..67abbb3 --- /dev/null +++ b/amb88/src/main/java/com/web/amb88/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.amb88; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/amb88/src/main/java/com/web/amb88/WebApplication.java b/amb88/src/main/java/com/web/amb88/WebApplication.java new file mode 100644 index 0000000..846a9f5 --- /dev/null +++ b/amb88/src/main/java/com/web/amb88/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.amb88; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/amb88/src/main/res/drawable-anydpi/ic_action_back.xml b/amb88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/amb88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/amb88/src/main/res/drawable-hdpi/ic_action_back.png b/amb88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/amb88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/amb88/src/main/res/drawable-mdpi/ic_action_back.png b/amb88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/amb88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/amb88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/amb88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/amb88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/drawable-xhdpi/ic_action_back.png b/amb88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/amb88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/amb88/src/main/res/drawable-xxhdpi/ic_action_back.png b/amb88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/amb88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/amb88/src/main/res/drawable/ic_launcher_background.xml b/amb88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/amb88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/amb88/src/main/res/drawable/pass_word_bg.xml b/amb88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/amb88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/amb88/src/main/res/drawable/pass_word_bg1.xml b/amb88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/amb88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/drawable/pass_word_bg2.xml b/amb88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/amb88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/drawable/shape_dialog_bg_new.xml b/amb88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/amb88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/amb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/mipmap-xxhdpi/app_logo.png b/amb88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..295f21a Binary files /dev/null and b/amb88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/amb88/src/main/res/values-en/strings.xml b/amb88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..f8f63af --- /dev/null +++ b/amb88/src/main/res/values-en/strings.xml @@ -0,0 +1,24 @@ + + AMB88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + + \ No newline at end of file diff --git a/amb88/src/main/res/values-night/themes.xml b/amb88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/amb88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/values/colors.xml b/amb88/src/main/res/values/colors.xml new file mode 100644 index 0000000..85339cd --- /dev/null +++ b/amb88/src/main/res/values/colors.xml @@ -0,0 +1,13 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + \ No newline at end of file diff --git a/amb88/src/main/res/values/strings.xml b/amb88/src/main/res/values/strings.xml new file mode 100644 index 0000000..a2950bc --- /dev/null +++ b/amb88/src/main/res/values/strings.xml @@ -0,0 +1,45 @@ + + AMB88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/values/themes.xml b/amb88/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/amb88/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/xml/app_updater_paths.xml b/amb88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/amb88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/main/res/xml/network_security_config.xml b/amb88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/amb88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/amb88/src/main/res/xml/provider_paths.xml b/amb88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/amb88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/amb88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/amb88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/amb88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..2d795c3 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,85 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.testapp" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 107 + versionName "v1.0.7" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('test.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('test.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + // implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..0a474df --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "514702139781", + "project_id": "testapp-c6578", + "storage_bucket": "testapp-c6578.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:514702139781:android:4774ebdb1437faf1c864ec", + "android_client_info": { + "package_name": "com.web.testapp" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDJtJeU50ZxitGq1pNVE0y1INXMWnFRlpA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/app/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/app/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/app/release/testweb.apk b/app/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/app/release/testweb.apk differ diff --git a/app/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/app/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/app/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b6e45ae --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/web/testapp/MainActivity2.java b/app/src/main/java/com/web/testapp/MainActivity2.java new file mode 100644 index 0000000..59cfc6c --- /dev/null +++ b/app/src/main/java/com/web/testapp/MainActivity2.java @@ -0,0 +1,52 @@ +package com.web.testapp; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 2; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + + +} diff --git a/app/src/main/java/com/web/testapp/MyFirebaseMessageingService.java b/app/src/main/java/com/web/testapp/MyFirebaseMessageingService.java new file mode 100644 index 0000000..484f622 --- /dev/null +++ b/app/src/main/java/com/web/testapp/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.testapp; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/app/src/main/java/com/web/testapp/WebApplication.java b/app/src/main/java/com/web/testapp/WebApplication.java new file mode 100644 index 0000000..784a133 --- /dev/null +++ b/app/src/main/java/com/web/testapp/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.testapp; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/app/src/main/res/drawable-anydpi/ic_action_back.xml b/app/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-hdpi/ic_action_back.png b/app/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_back.png b/app/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/ic_action_back.png b/app/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_back.png b/app/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/input_bg.xml b/app/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/app/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/pass_word_bg.xml b/app/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/app/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/pass_word_bg1.xml b/app/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/app/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/pass_word_bg2.xml b/app/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/app/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_btn_bg.xml b/app/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/app/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_dialog_bg2.xml b/app/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/app/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_dialog_bg3.xml b/app/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/app/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_dialog_bg_new.xml b/app/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/app/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_notify_typebg.xml b/app/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/app/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_empty.png b/app/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_pull_down.png b/app/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_close.png b/app/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_email.png b/app/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..aaacc68 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_facebook.png b/app/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_hometo.png b/app/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_link.png b/app/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_menu.png b/app/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_notify_email.png b/app/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/app/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/app/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/app/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/app/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_shousuo.png b/app/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_tel.png b/app/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/app/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/app/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/app_logo.png b/app/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c796052 --- /dev/null +++ b/app/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TestApp + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..93e4586 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + TestApp + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/app_updater_paths.xml b/app/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/app/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/provider_paths.xml b/app/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/app/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/app/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/app/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/app/test.jks b/app/test.jks new file mode 100644 index 0000000..42f20c8 Binary files /dev/null and b/app/test.jks differ diff --git a/base/.gitignore b/base/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base/build.gradle b/base/build.gradle new file mode 100644 index 0000000..e2c58f6 --- /dev/null +++ b/base/build.gradle @@ -0,0 +1,50 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' +} \ No newline at end of file diff --git a/base/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base/proguard-rules.pro b/base/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base/release/output-metadata.json b/base/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base/release/testweb.apk b/base/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base/release/testweb.apk differ diff --git a/base/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base/src/main/AndroidManifest.xml b/base/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/java/com/web/base/ActionBankInfoDialog.java b/base/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..6432fd6 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,214 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyBankListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + } + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } +// if (o.data != null && o.data.size() > 0) { +// listdata.clear(); +// listdata.addAll(o.data); +// adapter.setListdata(listdata); +// recyclerView.setVisibility(View.VISIBLE); +// } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base/src/main/java/com/web/base/ActionConfirmDialog.java b/base/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base/src/main/java/com/web/base/ActionInviteDialog.java b/base/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..b7e6bf4 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,105 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..5fd59f3 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.database.DataSetObserver; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.ListAdapter; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.web.base.R; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base/src/main/java/com/web/base/ActionSelectDialog.java b/base/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..5ca1576 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,119 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + +// private void fullScreenImmersive(View view) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { +// int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE +// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION +// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION +// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY +// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN +// | View.SYSTEM_UI_FLAG_FULLSCREEN; +// view.setSystemUiVisibility(uiOptions); +// } +// } +// +// @Override +// public void show() { +// this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); +// super.show(); +// fullScreenImmersive(getWindow().getDecorView()); +// this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); +// } + + +} diff --git a/base/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..f9c4946 --- /dev/null +++ b/base/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,114 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base/src/main/java/com/web/base/Api.java b/base/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base/src/main/java/com/web/base/ApiService.java b/base/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..1b4e347 --- /dev/null +++ b/base/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,109 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Path; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + public static final String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base/src/main/java/com/web/base/BankInfo.java b/base/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base/src/main/java/com/web/base/BaseApi.java b/base/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base/src/main/java/com/web/base/BaseObserver.java b/base/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..446eefb --- /dev/null +++ b/base/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,115 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base/src/main/java/com/web/base/CircleImageView.java b/base/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base/src/main/java/com/web/base/ContactBean.java b/base/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base/src/main/java/com/web/base/DataInfo.java b/base/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..7662299 --- /dev/null +++ b/base/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,126 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base/src/main/java/com/web/base/DialogUtil.java b/base/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..b2d5708 --- /dev/null +++ b/base/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,57 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base/src/main/java/com/web/base/GsonUtils.java b/base/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base/src/main/java/com/web/base/InviteInfo.java b/base/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base/src/main/java/com/web/base/InviteListInfo.java b/base/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base/src/main/java/com/web/base/LinkConfigInfo.java b/base/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base/src/main/java/com/web/base/LogUtils.java b/base/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base/src/main/java/com/web/base/MainActivity.java b/base/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..e1f9d9e --- /dev/null +++ b/base/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,385 @@ +package com.web.base; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import org.w3c.dom.Text; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + +// if(getIntent().getBooleanExtra("isChange",false)){ +// toNextActivity(); +// }else{ +// findViewById(R.id.big_v).setVisibility(View.VISIBLE); +// } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base/src/main/java/com/web/base/MainActivity2.java b/base/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..8365aa6 --- /dev/null +++ b/base/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1763 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.NotificationManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.database.Cursor; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + //https://m.xiannvtu.com/ + //https://m.xiannvtu.com/ +// public static String url = "https://candy916.co/"; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + public static int userId = 2; + private int notifyVisible = View.GONE; + + private String shareUrl; + private String myInviteCode; + private int myInviteNum; + + private int contactApply = 1; + private int notifyApply = 1; + + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { +// if (Build.VERSION.SDK_INT >= 30) { +// } else { +// setTheme(R.style.AppThemeStart1); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); +// getWindow().setStatusBarColor(Color.TRANSPARENT); +// } +// if (Build.VERSION.SDK_INT >= 33) { +// getWindow().setDecorFitsSystemWindows(false); +// } else { +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// } +// super.onCreate(savedInstanceState); + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); +// View bottomV = findViewById(R.id.bottom_v); +// if (Build.VERSION.SDK_INT >= 30) { +// ViewGroup.LayoutParams layoutParams = bottomV.getLayoutParams(); +// layoutParams.height = getNavigationBarHeight(this); +// bottomV.setLayoutParams(layoutParams); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); +// } + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } +// if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) { +// startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo)); +// } else { +// recordNotify(messageInfo.getPushId()); +// } + } + +// FirebaseMessaging.getInstance().getToken() +// .addOnCompleteListener(new OnCompleteListener() { +// @Override +// public void onComplete(@NonNull Task task) { +// if (!task.isSuccessful()) { +// LogUtils.d("Fetching FCM registration token failed" + task.getException()); +// return; +// } +// +// // Get new FCM registration token +// String token = task.getResult(); +// +// // Log and toast +// +// LogUtils.d("token=="+token); +// } +// }); + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); +// List telpacks = new ArrayList<>(); +// telpacks.add("org.telegram.messenger"); +// telpacks.add("org.telegram.messenger.web"); + ivNotify.setOnClickListener(view -> { + notifyclick(); + }); + ivFaceBook.setOnClickListener(view -> { + //isLuncher = false; + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + // isLuncher = false; + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + //isLuncher = false; + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); + ivLink.setOnClickListener(view -> { + //isLuncher = false; + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + }); + ivHome.setOnClickListener(view -> { + //isLuncher = false; + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + notifyCardView.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + // getMyInvite(false); + setTotalTongJi(); //每日活跃统计 + +// findViewById(R.id.home).setOnClickListener(view -> { +// webView.loadUrl(url); +// }); +// findViewById(R.id.tv_other).setOnClickListener(view -> { +// if (TextUtils.isEmpty(linkconfig)) { +// linkconfig = "https://missav.com/dm37"; +// } +// webView.loadUrl(linkconfig); +// }); + + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + +// if (type == 1) { +// try { +// // 跳转到 Facebook 应用的页面(使用 URI 的页面 ID 或用户名) +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<" + uri + ">")); // 替换 +// startActivity(intent); +// } catch (Exception e) { +// // 如果没有安装 Facebook 应用,跳转到网页 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<" + uri + ">")); // 替换 +// startActivity(intent); +// } +// } +// if (type == 2) { +// try { +// // 跳转到 Telegram 应用中的特定用户 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=<" + uri + ">")); // 替换 +// startActivity(intent); +// } catch (Exception e) { +// // 如果 Telegram 未安装,跳转到网页版 +// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/<" + uri + ">")); // 替换 +// startActivity(intent); +// } +// +// } +// +// if (type == 3) { +// Intent intent = getPackageManager().getLaunchIntentForPackage("com.whatsapp"); +// if (intent != null) { +// startActivity(intent); +// } else { +// // WhatsApp 未安装,跳转到 Google Play 商店 +// Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.whatsapp")); +// startActivity(playStoreIntent); +// } +// +// } + //https://www.facebook.com/profile.php?id=61568556460025 + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + layoutOtherApp.setVisibility(View.GONE); + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + + private boolean isLuncher = false; + + //多个APPName + private void toOtherApps(String uri, List packagenames) { + int i = 0; + while (i < packagenames.size() && !isLuncher) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames.get(i)); + startActivity(intent); + isLuncher = true; + } catch (Exception e) { + i++; + isLuncher = false; + } + } + if (!isLuncher) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + +// if (intent.resolveActivity(getPackageManager()) != null) { +// startActivity(intent); +// } else { +// Toast.makeText(this, getString(R.string.app_notinstall), Toast.LENGTH_SHORT).show(); +// } + } + + public int getNavigationBarHeight(Context context) { + Resources resources = context.getResources(); + int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); + return resources.getDimensionPixelSize(resourceId); + } + + private boolean isAppInstall(String packagename) { + PackageManager packageManager = getPackageManager(); + try { + PackageInfo packageInfo = packageManager.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES); + if (packageInfo != null) { + return true; + } + } catch (Exception e) { + return false; + } + return false; + } + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + +// // Declare the launcher at the top of your Activity/Fragment: +// private final ActivityResultLauncher requestPermissionLauncher = +// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { +// if (isGranted) { +// // FCM SDK (and your app) can post notifications. +// } else { +// // TODO: Inform user that that your app will not show notifications. +// } +// }); + +// private void askNotificationPermission() { +// // This is only necessary for API level >= 33 (TIRAMISU) +// if (Build.VERSION.SDK_INT >= 33) { +// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) == +// PackageManager.PERMISSION_GRANTED) { +// // FCM SDK (and your app) can post notifications. +// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { +// // TODO: display an educational UI explaining to the user the features that will be enabled +// // by them granting the POST_NOTIFICATION permission. This UI should provide the user +// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission. +// // If the user selects "No thanks," allow the user to continue without notifications. +// } else { +// // Directly ask for the permission +// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); +// } +// } +// } + + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + public void removeChildView(int child) { + WebView childView = (WebView) webView.getChildAt(child - 1); + webView.removeView(childView); + if (webView.canGoBack()) { + webView.goBack(); + } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + // notifyVisible = View.VISIBLE; + otherApp.setVisibility(View.VISIBLE); + ivNotify.setVisibility(View.VISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this,"version_code",0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { + readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + otherApp.setVisibility(View.VISIBLE); + ivWhatsApp.setVisibility(View.VISIBLE); + } +// if (linkconfiglist != null && linkconfiglist.size() > 0) { +// otherApp.setVisibility(View.VISIBLE); +// ivLink.setVisibility(View.VISIBLE); +// tvLink.setText(linkconfiglist.get(0).getName()); +// ivHome.setVisibility(View.VISIBLE); +// Glide.with(MainActivity2.this).load(linkconfiglist.get(0).getIcon()).error(R.color.dialog_bg).into(ivLinkBg); +// } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); +// Api.getInstance().geUrlNew(userId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:" + o.url); +// if (!TextUtils.isEmpty(o.url)) { +// MainActivity.saveString(MainActivity2.this, "base_url", o.url); +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); + } + + public void getVersionUrl() { +// Api.getInstance().getVersion(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// if (!TextUtils.isEmpty(o.version_code)) { +// if (Integer.parseInt(o.version_code) > com.web.base.BuildConfig.VERSION_CODE) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(o.url); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// actionDialog.show(); +// } +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + private void checkUpdate(String url) { +// Constants.isUpdate = true; + new AppUpdater(this, url).start(); + + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(new Runnable() { + @Override + public void run() { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + } + }).start(); + + + } + } + + public List removeSameContact(List contents) { + List contactBeans = new ArrayList(); + for (int i = 0; i < contents.size(); i++) { + String phone = contents.get(i).getPhone(); + if (contactBeans.contains(phone)) { + contents.remove(i); + } else { + contactBeans.add(phone); + } + } + return contents; + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + ActionInviteDialog invitedDialog; + + //展示邀请码 + public void showInviteCode() { + invitedDialog = new ActionInviteDialog(MainActivity2.this, + false); + invitedDialog.setOnToActionListener(new ActionInviteDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + checkInvited(content); + } + + @Override + public void toCancel() { + + } + }); + invitedDialog.setCanceledOnTouchOutside(false); + invitedDialog.setCancelable(false); + invitedDialog.show(); + + } + + public void checkInvited(String code) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("code", code); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().checkInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.isSuccessful() && invitedDialog != null) { + invitedDialog.dismiss(); + MainActivity.saveBoolean(MainActivity2.this, "invited", true); + MainActivity.saveString(MainActivity2.this, "code", code); + } + + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(MainActivity2.this, msg + "", Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + if (o.code == 40001) { + invitedDialog.dismiss(); + MainActivity.saveBoolean(MainActivity2.this, "invited", true); + MainActivity.saveString(MainActivity2.this, "code", o.data.getInviteCode()); + } + Toast.makeText(MainActivity2.this, TextUtils.isEmpty(o.message) ? o.error : o.message, Toast.LENGTH_SHORT).show(); + } + }); + } + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); + myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); +// notifyCardView.setVisibility(notifyVisible); + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + +// if (isNetError&&isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (url1.contains("facebook")||url1.contains("https://t.me")||url1.contains("instagram")||url1.contains("https://x.com")) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + + if (url1.contains("facebook")||url1.contains("https://t.me")||url1.contains("instagram")||url1.contains("https://x.com")) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + if (url.contains("facebook")||url.contains("https://t.me")||url.contains("instagram")||url.contains("https://x.com")) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// try { +// startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); +// } catch (ActivityNotFoundException e) { +//// mUploadCallbackForHighApi = null; +//// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); +// // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); +// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// return true; +// } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + public static void saveInt(Context context,String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + + + public static int getInt(Context context,String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + +} diff --git a/base/src/main/java/com/web/base/MainActivity3.java b/base/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..735848f --- /dev/null +++ b/base/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,568 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.DownloadManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.DownloadListener; +import android.webkit.ValueCallback; +import com.just.agentweb.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import com.just.agentweb.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import com.just.agentweb.AgentWeb; +//import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +//import com.tencent.smtt.sdk.DownloadListener; +//import com.tencent.smtt.sdk.URLUtil; +//import com.tencent.smtt.sdk.ValueCallback; +//import com.tencent.smtt.sdk.WebChromeClient; +//import com.tencent.smtt.sdk.WebSettings; +//import com.tencent.smtt.sdk.WebView; +//import com.tencent.smtt.sdk.WebViewClient; + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base/src/main/java/com/web/base/MessageInfo.java b/base/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base/src/main/java/com/web/base/MyBankListAdapter.java b/base/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base/src/main/java/com/web/base/MyListAdapter.java b/base/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/base/src/main/java/com/web/base/MyNotifyListAdapter.java b/base/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..59d4e54 --- /dev/null +++ b/base/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,154 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base/src/main/java/com/web/base/MyWithDrwaListAdapter.java b/base/src/main/java/com/web/base/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..adb5291 --- /dev/null +++ b/base/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.base; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base/src/main/java/com/web/base/NotifyDetailsActivity.java b/base/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..762e8d0 --- /dev/null +++ b/base/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,386 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base/src/main/java/com/web/base/NotifyListActivity.java b/base/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..e0c6a27 --- /dev/null +++ b/base/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,130 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base/src/main/java/com/web/base/Result.java b/base/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..5ad799b --- /dev/null +++ b/base/src/main/java/com/web/base/Result.java @@ -0,0 +1,31 @@ +package com.web.base; + + +import java.io.Serializable; + +import com.web.base.GsonUtils; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base/src/main/java/com/web/base/ResultDataInfo.java b/base/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base/src/main/java/com/web/base/StartActivity.java b/base/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0dc2f2b --- /dev/null +++ b/base/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,233 @@ +package com.web.base; + +import android.app.AlarmManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base/src/main/java/com/web/base/StatusLayout.java b/base/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base/src/main/java/com/web/base/Utils.java b/base/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..10a0efa --- /dev/null +++ b/base/src/main/java/com/web/base/Utils.java @@ -0,0 +1,68 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Build; +import android.provider.Settings; + +import java.security.NoSuchAlgorithmException; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base/src/main/java/com/web/base/WebView2Activity.java b/base/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..f0d85db --- /dev/null +++ b/base/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,333 @@ +package com.web.base; + +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base/src/main/java/com/web/base/WebViewActivity.java b/base/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..e56222d --- /dev/null +++ b/base/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,382 @@ +package com.web.base; + +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base/src/main/java/com/web/base/WithDrawListInfo.java b/base/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base/src/main/res/drawable-anydpi/ic_action_back.xml b/base/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base/src/main/res/drawable-hdpi/ic_action_back.png b/base/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base/src/main/res/drawable-mdpi/ic_action_back.png b/base/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable-xhdpi/ic_action_back.png b/base/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base/src/main/res/drawable-xxhdpi/ic_action_back.png b/base/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base/src/main/res/drawable/ic_launcher_background.xml b/base/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/drawable/input_bg.xml b/base/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/drawable/pass_word_bg.xml b/base/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/drawable/pass_word_bg1.xml b/base/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/base/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/pass_word_bg2.xml b/base/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/shape_btn_bg.xml b/base/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/shape_dialog_bg2.xml b/base/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/shape_dialog_bg3.xml b/base/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/shape_dialog_bg_new.xml b/base/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/drawable/shape_notify_typebg.xml b/base/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/activity_main.xml b/base/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/activity_main2.xml b/base/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..a84c3d3 --- /dev/null +++ b/base/src/main/res/layout/activity_main2.xml @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/layout/activity_main3.xml b/base/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..6385b31 --- /dev/null +++ b/base/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/layout/activity_notifydetails.xml b/base/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/layout/activity_notifylist.xml b/base/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..29a195b --- /dev/null +++ b/base/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/layout/activity_start.xml b/base/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/activity_webview.xml b/base/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/src/main/res/layout/dialog_action_bankinfo.xml b/base/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/dialog_action_confirm.xml b/base/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/dialog_action_invite.xml b/base/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/dialog_action_invite_records.xml b/base/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/dialog_action_withdrawapply.xml b/base/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/dialog_select_action.xml b/base/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/item_invite_records.xml b/base/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/item_notify_list.xml b/base/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..9cc22d6 --- /dev/null +++ b/base/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/layout/item_withdraw_records.xml b/base/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/base/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base/src/main/res/mipmap-hdpi/ic_empty.png b/base/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base/src/main/res/mipmap-hdpi/ic_pull_down.png b/base/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_close.png b/base/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_email.png b/base/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..aaacc68 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_facebook.png b/base/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_hometo.png b/base/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_link.png b/base/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_menu.png b/base/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_tel.png b/base/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base/src/main/res/mipmap-xxhdpi/app_logo.png b/base/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base/src/main/res/values-en/strings.xml b/base/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c796052 --- /dev/null +++ b/base/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TestApp + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base/src/main/res/values-night/themes.xml b/base/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/values/colors.xml b/base/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base/src/main/res/values/strings.xml b/base/src/main/res/values/strings.xml new file mode 100644 index 0000000..93e4586 --- /dev/null +++ b/base/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + TestApp + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/values/themes.xml b/base/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/xml/app_updater_paths.xml b/base/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base/src/main/res/xml/network_security_config.xml b/base/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base/src/main/res/xml/provider_paths.xml b/base/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/boda8/.gitignore b/boda8/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/boda8/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/boda8/build.gradle b/boda8/build.gradle new file mode 100644 index 0000000..c0dc468 --- /dev/null +++ b/boda8/build.gradle @@ -0,0 +1,87 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + //58 + applicationId "com.web.boda8" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 104 + versionName "v1.0.4" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/boda8/dskjweb.jks b/boda8/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/boda8/dskjweb.jks differ diff --git a/boda8/google-services.json b/boda8/google-services.json new file mode 100644 index 0000000..9a5eaf9 --- /dev/null +++ b/boda8/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "685465509918", + "project_id": "boad8au", + "storage_bucket": "boad8au.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:685465509918:android:d0485a8687e243ee6ece0f", + "android_client_info": { + "package_name": "com.web.boda8" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB6b6die47UsLdmAwNUCIoandPFzHi7xow" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/boda8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/boda8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/boda8/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/boda8/proguard-rules.pro b/boda8/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/boda8/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/boda8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/boda8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/boda8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/boda8/src/main/AndroidManifest.xml b/boda8/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e6a5baa --- /dev/null +++ b/boda8/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/java/com/web/boda8/MainActivity2.java b/boda8/src/main/java/com/web/boda8/MainActivity2.java new file mode 100644 index 0000000..019e587 --- /dev/null +++ b/boda8/src/main/java/com/web/boda8/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.boda8; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 58; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/boda8/src/main/java/com/web/boda8/MyFirebaseMessageingService.java b/boda8/src/main/java/com/web/boda8/MyFirebaseMessageingService.java new file mode 100644 index 0000000..8709128 --- /dev/null +++ b/boda8/src/main/java/com/web/boda8/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.boda8; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/boda8/src/main/java/com/web/boda8/WebApplication.java b/boda8/src/main/java/com/web/boda8/WebApplication.java new file mode 100644 index 0000000..309b200 --- /dev/null +++ b/boda8/src/main/java/com/web/boda8/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.boda8; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/boda8/src/main/res/drawable-anydpi/ic_action_back.xml b/boda8/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/boda8/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/boda8/src/main/res/drawable-hdpi/ic_action_back.png b/boda8/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/boda8/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/boda8/src/main/res/drawable-mdpi/ic_action_back.png b/boda8/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/boda8/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/boda8/src/main/res/drawable-v24/ic_launcher_foreground.xml b/boda8/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/boda8/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable-xhdpi/ic_action_back.png b/boda8/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/boda8/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/boda8/src/main/res/drawable-xxhdpi/ic_action_back.png b/boda8/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/boda8/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/boda8/src/main/res/drawable/ic_launcher_background.xml b/boda8/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/boda8/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/boda8/src/main/res/drawable/input_bg.xml b/boda8/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/boda8/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/boda8/src/main/res/drawable/pass_word_bg.xml b/boda8/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/boda8/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/boda8/src/main/res/drawable/pass_word_bg1.xml b/boda8/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/boda8/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable/pass_word_bg2.xml b/boda8/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/boda8/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable/shape_btn_bg.xml b/boda8/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/boda8/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable/shape_dialog_bg2.xml b/boda8/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/boda8/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable/shape_dialog_bg3.xml b/boda8/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/boda8/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/drawable/shape_dialog_bg_new.xml b/boda8/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/boda8/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/boda8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/mipmap-hdpi/ic_empty.png b/boda8/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/boda8/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/boda8/src/main/res/mipmap-hdpi/ic_pull_down.png b/boda8/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/boda8/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/boda8/src/main/res/mipmap-xhdpi/ic_close.png b/boda8/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/boda8/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/boda8/src/main/res/mipmap-xhdpi/ic_menu.png b/boda8/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/boda8/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/boda8/src/main/res/mipmap-xxhdpi/app_logo.png b/boda8/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..acf730a Binary files /dev/null and b/boda8/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/boda8/src/main/res/values-en/strings.xml b/boda8/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..143637f --- /dev/null +++ b/boda8/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + BODA8AU + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/boda8/src/main/res/values-night/themes.xml b/boda8/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/boda8/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/values/colors.xml b/boda8/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/boda8/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/boda8/src/main/res/values/strings.xml b/boda8/src/main/res/values/strings.xml new file mode 100644 index 0000000..f72cccb --- /dev/null +++ b/boda8/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BODA8AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/values/themes.xml b/boda8/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/boda8/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/xml/app_updater_paths.xml b/boda8/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/boda8/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/main/res/xml/network_security_config.xml b/boda8/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/boda8/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/boda8/src/main/res/xml/provider_paths.xml b/boda8/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/boda8/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/boda8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/boda8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/boda8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..cd50114 --- /dev/null +++ b/build.gradle @@ -0,0 +1,31 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + //jcenter() + maven { url 'https://jitpack.io' } + mavenCentral() + + } + dependencies { + classpath "com.android.tools.build:gradle:4.1.2" + classpath 'com.google.gms:google-services:4.3.15' + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + + + +allprojects { + repositories { + google() + //jcenter() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/cekap33/.gitignore b/cekap33/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/cekap33/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/cekap33/build.gradle b/cekap33/build.gradle new file mode 100644 index 0000000..cc6fa8a --- /dev/null +++ b/cekap33/build.gradle @@ -0,0 +1,86 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.cekap33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('cekap33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('cekap33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") + // implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/cekap33/cekap33.jks b/cekap33/cekap33.jks new file mode 100644 index 0000000..95069bc Binary files /dev/null and b/cekap33/cekap33.jks differ diff --git a/cekap33/google-services.json b/cekap33/google-services.json new file mode 100644 index 0000000..0bf7646 --- /dev/null +++ b/cekap33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "731544393557", + "project_id": "cekap33", + "storage_bucket": "cekap33.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:731544393557:android:29e86c59a5170244e2c1dc", + "android_client_info": { + "package_name": "com.web.cekap33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC_PqG6akhXVCYvktTIuIrD-twMJeiNex4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/cekap33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/cekap33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/cekap33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/cekap33/proguard-rules.pro b/cekap33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/cekap33/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/cekap33/release/cekap33.apk b/cekap33/release/cekap33.apk new file mode 100644 index 0000000..ecdfa6b Binary files /dev/null and b/cekap33/release/cekap33.apk differ diff --git a/cekap33/release/output-metadata.json b/cekap33/release/output-metadata.json new file mode 100644 index 0000000..155da18 --- /dev/null +++ b/cekap33/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.cekap33", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "cekap33-release.apk" + } + ] +} \ No newline at end of file diff --git a/cekap33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/cekap33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/cekap33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/cekap33/src/main/AndroidManifest.xml b/cekap33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0408952 --- /dev/null +++ b/cekap33/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/java/com/web/cekap33/MainActivity2.java b/cekap33/src/main/java/com/web/cekap33/MainActivity2.java new file mode 100644 index 0000000..566b076 --- /dev/null +++ b/cekap33/src/main/java/com/web/cekap33/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.cekap33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 77; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://cekap33.org/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/cekap33/src/main/java/com/web/cekap33/MyFirebaseMessageingService.java b/cekap33/src/main/java/com/web/cekap33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..60d8b96 --- /dev/null +++ b/cekap33/src/main/java/com/web/cekap33/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.cekap33; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/cekap33/src/main/java/com/web/cekap33/WebApplication.java b/cekap33/src/main/java/com/web/cekap33/WebApplication.java new file mode 100644 index 0000000..85d04a8 --- /dev/null +++ b/cekap33/src/main/java/com/web/cekap33/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.cekap33; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/cekap33/src/main/res/drawable-anydpi/ic_action_back.xml b/cekap33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/cekap33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/cekap33/src/main/res/drawable-hdpi/ic_action_back.png b/cekap33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/cekap33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/cekap33/src/main/res/drawable-mdpi/ic_action_back.png b/cekap33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/cekap33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/cekap33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/cekap33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/cekap33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable-xhdpi/ic_action_back.png b/cekap33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/cekap33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/cekap33/src/main/res/drawable-xxhdpi/ic_action_back.png b/cekap33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/cekap33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/cekap33/src/main/res/drawable/ic_launcher_background.xml b/cekap33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/cekap33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cekap33/src/main/res/drawable/input_bg.xml b/cekap33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/cekap33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/cekap33/src/main/res/drawable/pass_word_bg.xml b/cekap33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/cekap33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/cekap33/src/main/res/drawable/pass_word_bg1.xml b/cekap33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/cekap33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable/pass_word_bg2.xml b/cekap33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/cekap33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable/shape_btn_bg.xml b/cekap33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/cekap33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable/shape_dialog_bg2.xml b/cekap33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/cekap33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable/shape_dialog_bg3.xml b/cekap33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/cekap33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/drawable/shape_dialog_bg_new.xml b/cekap33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/cekap33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cekap33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/mipmap-hdpi/ic_empty.png b/cekap33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/cekap33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/cekap33/src/main/res/mipmap-hdpi/ic_pull_down.png b/cekap33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/cekap33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/cekap33/src/main/res/mipmap-xhdpi/ic_close.png b/cekap33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/cekap33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/cekap33/src/main/res/mipmap-xhdpi/ic_menu.png b/cekap33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/cekap33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/cekap33/src/main/res/mipmap-xxhdpi/app_logo.jpg b/cekap33/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..af71cbd Binary files /dev/null and b/cekap33/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/cekap33/src/main/res/values-en/strings.xml b/cekap33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..3ac2a19 --- /dev/null +++ b/cekap33/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + Cekap33 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/cekap33/src/main/res/values-night/themes.xml b/cekap33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/cekap33/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/values/colors.xml b/cekap33/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/cekap33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/cekap33/src/main/res/values/strings.xml b/cekap33/src/main/res/values/strings.xml new file mode 100644 index 0000000..8e6b36b --- /dev/null +++ b/cekap33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Cekap33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/values/themes.xml b/cekap33/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/cekap33/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/xml/app_updater_paths.xml b/cekap33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/cekap33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/xml/network_security_config.xml b/cekap33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/cekap33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cekap33/src/main/res/xml/provider_paths.xml b/cekap33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/cekap33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/cekap33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/cekap33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/cekap33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/cergas/.gitignore b/cergas/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/cergas/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/cergas/build.gradle b/cergas/build.gradle new file mode 100644 index 0000000..ae4fd5f --- /dev/null +++ b/cergas/build.gradle @@ -0,0 +1,87 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.cergas" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + // implementation("com.google.firebase:firebase-messaging:23.2.1") + // implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/cergas/dskjweb.jks b/cergas/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/cergas/dskjweb.jks differ diff --git a/cergas/google-services.json b/cergas/google-services.json new file mode 100644 index 0000000..0b2753d --- /dev/null +++ b/cergas/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "773432010162", + "project_id": "cergas999-c8b99", + "storage_bucket": "cergas999-c8b99.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:773432010162:android:7721474e224398963bb0ab", + "android_client_info": { + "package_name": "com.web.cergas" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCysVxeDJd9W_ZFA_O5-ruQbSf2BHqhTUs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/cergas/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/cergas/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/cergas/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/cergas/proguard-rules.pro b/cergas/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/cergas/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/cergas/release/cergas.apk b/cergas/release/cergas.apk new file mode 100644 index 0000000..657a7f1 Binary files /dev/null and b/cergas/release/cergas.apk differ diff --git a/cergas/release/output-metadata.json b/cergas/release/output-metadata.json new file mode 100644 index 0000000..2bdcd59 --- /dev/null +++ b/cergas/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.cergas", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "cergas-release.apk" + } + ] +} \ No newline at end of file diff --git a/cergas/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/cergas/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/cergas/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/cergas/src/main/AndroidManifest.xml b/cergas/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d4b3398 --- /dev/null +++ b/cergas/src/main/AndroidManifest.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/java/com/web/cergas/MainActivity2.java b/cergas/src/main/java/com/web/cergas/MainActivity2.java new file mode 100644 index 0000000..733dcc1 --- /dev/null +++ b/cergas/src/main/java/com/web/cergas/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.cergas; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 63; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url","https://cergas.online/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java b/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java new file mode 100644 index 0000000..6dd5de4 --- /dev/null +++ b/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.cergas; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/cergas/src/main/java/com/web/cergas/WebApplication.java b/cergas/src/main/java/com/web/cergas/WebApplication.java new file mode 100644 index 0000000..65c7373 --- /dev/null +++ b/cergas/src/main/java/com/web/cergas/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.cergas; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/cergas/src/main/res/drawable-anydpi/ic_action_back.xml b/cergas/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/cergas/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/cergas/src/main/res/drawable-hdpi/ic_action_back.png b/cergas/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/cergas/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/cergas/src/main/res/drawable-mdpi/ic_action_back.png b/cergas/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/cergas/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/cergas/src/main/res/drawable-v24/ic_launcher_foreground.xml b/cergas/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/cergas/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable-xhdpi/ic_action_back.png b/cergas/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/cergas/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/cergas/src/main/res/drawable-xxhdpi/ic_action_back.png b/cergas/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/cergas/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/cergas/src/main/res/drawable/ic_launcher_background.xml b/cergas/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/cergas/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cergas/src/main/res/drawable/input_bg.xml b/cergas/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/cergas/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/cergas/src/main/res/drawable/pass_word_bg.xml b/cergas/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/cergas/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/cergas/src/main/res/drawable/pass_word_bg1.xml b/cergas/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/cergas/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable/pass_word_bg2.xml b/cergas/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/cergas/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable/shape_btn_bg.xml b/cergas/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/cergas/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable/shape_dialog_bg2.xml b/cergas/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/cergas/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable/shape_dialog_bg3.xml b/cergas/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/cergas/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/drawable/shape_dialog_bg_new.xml b/cergas/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/cergas/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cergas/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/mipmap-hdpi/ic_empty.png b/cergas/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/cergas/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/cergas/src/main/res/mipmap-hdpi/ic_pull_down.png b/cergas/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/cergas/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/cergas/src/main/res/mipmap-xhdpi/ic_close.png b/cergas/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/cergas/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/cergas/src/main/res/mipmap-xhdpi/ic_menu.png b/cergas/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/cergas/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/cergas/src/main/res/mipmap-xxhdpi/app_logo.png b/cergas/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..f47a536 Binary files /dev/null and b/cergas/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/cergas/src/main/res/values-en/strings.xml b/cergas/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..1983f39 --- /dev/null +++ b/cergas/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + Cergas + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/cergas/src/main/res/values-night/themes.xml b/cergas/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/cergas/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/values/colors.xml b/cergas/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/cergas/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/cergas/src/main/res/values/strings.xml b/cergas/src/main/res/values/strings.xml new file mode 100644 index 0000000..29e65d8 --- /dev/null +++ b/cergas/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Cergas + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/values/themes.xml b/cergas/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/cergas/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/xml/app_updater_paths.xml b/cergas/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/cergas/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/main/res/xml/network_security_config.xml b/cergas/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/cergas/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cergas/src/main/res/xml/provider_paths.xml b/cergas/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/cergas/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/cergas/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/cergas/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/cergas/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..37cede8 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +#org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true +android.enableR8=false +org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..7454180 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2e6e589 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..1b6c787 --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jackpotau/.gitignore b/jackpotau/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/jackpotau/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/jackpotau/build.gradle b/jackpotau/build.gradle new file mode 100644 index 0000000..bd996fe --- /dev/null +++ b/jackpotau/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + //90 + applicationId "com.web.jackpotau" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 100 + versionName "v1.0.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('jackpotau.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('jackpotau.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/jackpotau/google-services.json b/jackpotau/google-services.json new file mode 100644 index 0000000..34fd191 --- /dev/null +++ b/jackpotau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "251245375964", + "project_id": "jackpotau-ecf17", + "storage_bucket": "jackpotau-ecf17.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:251245375964:android:a22839d76eb4027ecb1f19", + "android_client_info": { + "package_name": "com.web.jackpotau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC0FI0h_rXx2A_p2j1c5j-CnxQUQpFmZO4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jackpotau/jackpotau.jks b/jackpotau/jackpotau.jks new file mode 100644 index 0000000..fdbb2b9 Binary files /dev/null and b/jackpotau/jackpotau.jks differ diff --git a/jackpotau/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/jackpotau/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/jackpotau/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/jackpotau/proguard-rules.pro b/jackpotau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jackpotau/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/jackpotau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/jackpotau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/jackpotau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/jackpotau/src/main/AndroidManifest.xml b/jackpotau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1879548 --- /dev/null +++ b/jackpotau/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/java/com/web/jackpotau/MainActivity2.java b/jackpotau/src/main/java/com/web/jackpotau/MainActivity2.java new file mode 100644 index 0000000..99ceaca --- /dev/null +++ b/jackpotau/src/main/java/com/web/jackpotau/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.jackpotau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 90; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/jackpotau/src/main/java/com/web/jackpotau/MyFirebaseMessageingService.java b/jackpotau/src/main/java/com/web/jackpotau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..f006096 --- /dev/null +++ b/jackpotau/src/main/java/com/web/jackpotau/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.jackpotau; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/jackpotau/src/main/java/com/web/jackpotau/WebApplication.java b/jackpotau/src/main/java/com/web/jackpotau/WebApplication.java new file mode 100644 index 0000000..5f3da2c --- /dev/null +++ b/jackpotau/src/main/java/com/web/jackpotau/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.jackpotau; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/jackpotau/src/main/res/drawable-anydpi/ic_action_back.xml b/jackpotau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/jackpotau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/jackpotau/src/main/res/drawable-hdpi/ic_action_back.png b/jackpotau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/jackpotau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/jackpotau/src/main/res/drawable-mdpi/ic_action_back.png b/jackpotau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/jackpotau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/jackpotau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/jackpotau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/jackpotau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/drawable-xhdpi/ic_action_back.png b/jackpotau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/jackpotau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/jackpotau/src/main/res/drawable-xxhdpi/ic_action_back.png b/jackpotau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/jackpotau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/jackpotau/src/main/res/drawable/ic_launcher_background.xml b/jackpotau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/jackpotau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jackpotau/src/main/res/drawable/input_bg.xml b/jackpotau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/jackpotau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/jackpotau/src/main/res/drawable/pass_word_bg.xml b/jackpotau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/jackpotau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/jackpotau/src/main/res/drawable/pass_word_bg1.xml b/jackpotau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/jackpotau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/drawable/pass_word_bg2.xml b/jackpotau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/jackpotau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/drawable/shape_btn_bg.xml b/jackpotau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/jackpotau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/drawable/shape_dialog_bg2.xml b/jackpotau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/jackpotau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/drawable/shape_dialog_bg3.xml b/jackpotau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/jackpotau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jackpotau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/mipmap-hdpi/ic_empty.png b/jackpotau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/jackpotau/src/main/res/mipmap-hdpi/ic_pull_down.png b/jackpotau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_close.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_facebook.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_hometo.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_link.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_menu.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_shousuo.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_tel.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/jackpotau/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/jackpotau/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/jackpotau/src/main/res/mipmap-xxhdpi/app_logo.png b/jackpotau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..7449979 Binary files /dev/null and b/jackpotau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/jackpotau/src/main/res/values-en/strings.xml b/jackpotau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7447194 --- /dev/null +++ b/jackpotau/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + JACKPOTAU + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/jackpotau/src/main/res/values-night/themes.xml b/jackpotau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/jackpotau/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/values/colors.xml b/jackpotau/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/jackpotau/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/jackpotau/src/main/res/values/strings.xml b/jackpotau/src/main/res/values/strings.xml new file mode 100644 index 0000000..edd08d7 --- /dev/null +++ b/jackpotau/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + JACKPOTAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/values/style.xml b/jackpotau/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/jackpotau/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/values/themes.xml b/jackpotau/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/jackpotau/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/xml/app_updater_paths.xml b/jackpotau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jackpotau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/xml/network_security_config.xml b/jackpotau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jackpotau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jackpotau/src/main/res/xml/provider_paths.xml b/jackpotau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jackpotau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jackpotau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/jackpotau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/jackpotau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..35d5f3b --- /dev/null +++ b/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Wed Jan 22 14:34:02 CST 2025 +sdk.dir=D\:\\Sdk\\Sdk diff --git a/mgi/.gitignore b/mgi/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/mgi/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/mgi/build.gradle b/mgi/build.gradle new file mode 100644 index 0000000..b5c2e25 --- /dev/null +++ b/mgi/build.gradle @@ -0,0 +1,87 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.mgi" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + + } + signingConfigs { + debug { + storeFile file('mgi.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('mig.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") + // implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/mgi/google-services.json b/mgi/google-services.json new file mode 100644 index 0000000..c8990b5 --- /dev/null +++ b/mgi/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "268509543489", + "project_id": "mgiapns", + "storage_bucket": "mgiapns.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:268509543489:android:e49a2aaf7fe26dbf48dac0", + "android_client_info": { + "package_name": "com.web.mgi" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCgaQ6bMwqf_GSbcdBel4msc5fYY2S_XN8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mgi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/mgi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/mgi/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/mgi/mgi.jks b/mgi/mgi.jks new file mode 100644 index 0000000..65ea933 Binary files /dev/null and b/mgi/mgi.jks differ diff --git a/mgi/proguard-rules.pro b/mgi/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mgi/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/mgi/release/mgi.apk b/mgi/release/mgi.apk new file mode 100644 index 0000000..a6d44d7 Binary files /dev/null and b/mgi/release/mgi.apk differ diff --git a/mgi/release/output-metadata.json b/mgi/release/output-metadata.json new file mode 100644 index 0000000..094a5d1 --- /dev/null +++ b/mgi/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.mgi", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "mgi-release.apk" + } + ] +} \ No newline at end of file diff --git a/mgi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/mgi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/mgi/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/mgi/src/main/AndroidManifest.xml b/mgi/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0c15111 --- /dev/null +++ b/mgi/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/java/com/web/mgi/MainActivity2.java b/mgi/src/main/java/com/web/mgi/MainActivity2.java new file mode 100644 index 0000000..acd2ec8 --- /dev/null +++ b/mgi/src/main/java/com/web/mgi/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.mgi; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 75; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://mgiwallet.com"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/mgi/src/main/java/com/web/mgi/MyFirebaseMessageingService.java b/mgi/src/main/java/com/web/mgi/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d71912a --- /dev/null +++ b/mgi/src/main/java/com/web/mgi/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.mgi; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/mgi/src/main/java/com/web/mgi/WebApplication.java b/mgi/src/main/java/com/web/mgi/WebApplication.java new file mode 100644 index 0000000..e0221d3 --- /dev/null +++ b/mgi/src/main/java/com/web/mgi/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.mgi; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/mgi/src/main/res/drawable-anydpi/ic_action_back.xml b/mgi/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/mgi/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/mgi/src/main/res/drawable-hdpi/ic_action_back.png b/mgi/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/mgi/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/mgi/src/main/res/drawable-mdpi/ic_action_back.png b/mgi/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/mgi/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/mgi/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mgi/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mgi/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable-xhdpi/ic_action_back.png b/mgi/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/mgi/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/mgi/src/main/res/drawable-xxhdpi/ic_action_back.png b/mgi/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/mgi/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/mgi/src/main/res/drawable/ic_launcher_background.xml b/mgi/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mgi/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mgi/src/main/res/drawable/input_bg.xml b/mgi/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/mgi/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/mgi/src/main/res/drawable/pass_word_bg.xml b/mgi/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/mgi/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/mgi/src/main/res/drawable/pass_word_bg1.xml b/mgi/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/mgi/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable/pass_word_bg2.xml b/mgi/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/mgi/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable/shape_btn_bg.xml b/mgi/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/mgi/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable/shape_dialog_bg2.xml b/mgi/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/mgi/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable/shape_dialog_bg3.xml b/mgi/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/mgi/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/drawable/shape_dialog_bg_new.xml b/mgi/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/mgi/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mgi/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/mipmap-hdpi/ic_empty.png b/mgi/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/mgi/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/mgi/src/main/res/mipmap-hdpi/ic_pull_down.png b/mgi/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/mgi/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/mgi/src/main/res/mipmap-xhdpi/ic_close.png b/mgi/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/mgi/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/mgi/src/main/res/mipmap-xhdpi/ic_menu.png b/mgi/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/mgi/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/mgi/src/main/res/mipmap-xxhdpi/app_logo.png b/mgi/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a74496d Binary files /dev/null and b/mgi/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/mgi/src/main/res/values-en/strings.xml b/mgi/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..30b95b1 --- /dev/null +++ b/mgi/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + MGi + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/mgi/src/main/res/values-night/themes.xml b/mgi/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/mgi/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/values/colors.xml b/mgi/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/mgi/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/mgi/src/main/res/values/strings.xml b/mgi/src/main/res/values/strings.xml new file mode 100644 index 0000000..11cf00f --- /dev/null +++ b/mgi/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MGi + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/values/themes.xml b/mgi/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/mgi/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/xml/app_updater_paths.xml b/mgi/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mgi/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/main/res/xml/network_security_config.xml b/mgi/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mgi/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mgi/src/main/res/xml/provider_paths.xml b/mgi/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mgi/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mgi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/mgi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/mgi/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/petronas777/.gitignore b/petronas777/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/petronas777/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/petronas777/build.gradle b/petronas777/build.gradle new file mode 100644 index 0000000..f8a6e24 --- /dev/null +++ b/petronas777/build.gradle @@ -0,0 +1,91 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.petronas777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('petronas777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('petronas777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') +} \ No newline at end of file diff --git a/petronas777/google-services.json b/petronas777/google-services.json new file mode 100644 index 0000000..77576a4 --- /dev/null +++ b/petronas777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "531003882366", + "project_id": "petronas777-4af88", + "storage_bucket": "petronas777-4af88.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:531003882366:android:f4a5574f6fe121e4c4d12f", + "android_client_info": { + "package_name": "com.web.petronas777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBFZ84PArbxFecgXkR9q0KGOMBZTSc8Mbs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/petronas777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/petronas777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/petronas777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/petronas777/petronas777.jks b/petronas777/petronas777.jks new file mode 100644 index 0000000..fe81eac Binary files /dev/null and b/petronas777/petronas777.jks differ diff --git a/petronas777/proguard-rules.pro b/petronas777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/petronas777/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/petronas777/release/output-metadata.json b/petronas777/release/output-metadata.json new file mode 100644 index 0000000..5af23d9 --- /dev/null +++ b/petronas777/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.petronas777", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "petronas777-release.apk" + } + ] +} \ No newline at end of file diff --git a/petronas777/release/petronas777.apk b/petronas777/release/petronas777.apk new file mode 100644 index 0000000..a92084c Binary files /dev/null and b/petronas777/release/petronas777.apk differ diff --git a/petronas777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/petronas777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/petronas777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/petronas777/src/main/AndroidManifest.xml b/petronas777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f5c5159 --- /dev/null +++ b/petronas777/src/main/AndroidManifest.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/java/com/web/petronas777/MainActivity2.java b/petronas777/src/main/java/com/web/petronas777/MainActivity2.java new file mode 100644 index 0000000..5e5399d --- /dev/null +++ b/petronas777/src/main/java/com/web/petronas777/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.petronas777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 98; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://ptn777a.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java b/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..eeef4f7 --- /dev/null +++ b/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.petronas777; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/petronas777/src/main/java/com/web/petronas777/WebApplication.java b/petronas777/src/main/java/com/web/petronas777/WebApplication.java new file mode 100644 index 0000000..1ee49e8 --- /dev/null +++ b/petronas777/src/main/java/com/web/petronas777/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.petronas777; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/petronas777/src/main/res/drawable-anydpi/ic_action_back.xml b/petronas777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/petronas777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/petronas777/src/main/res/drawable-hdpi/ic_action_back.png b/petronas777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/petronas777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/petronas777/src/main/res/drawable-mdpi/ic_action_back.png b/petronas777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/petronas777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/petronas777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/petronas777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/petronas777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/drawable-xhdpi/ic_action_back.png b/petronas777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/petronas777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/petronas777/src/main/res/drawable-xxhdpi/ic_action_back.png b/petronas777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/petronas777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/petronas777/src/main/res/drawable/ic_launcher_background.xml b/petronas777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/petronas777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/petronas777/src/main/res/drawable/input_bg.xml b/petronas777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/petronas777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/petronas777/src/main/res/drawable/pass_word_bg.xml b/petronas777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/petronas777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/petronas777/src/main/res/drawable/pass_word_bg1.xml b/petronas777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/petronas777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/drawable/pass_word_bg2.xml b/petronas777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/petronas777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/drawable/shape_btn_bg.xml b/petronas777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/petronas777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/drawable/shape_dialog_bg2.xml b/petronas777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/petronas777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/drawable/shape_dialog_bg3.xml b/petronas777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/petronas777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/petronas777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/mipmap-hdpi/ic_empty.png b/petronas777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/petronas777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/petronas777/src/main/res/mipmap-hdpi/ic_pull_down.png b/petronas777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/petronas777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_close.png b/petronas777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_facebook.png b/petronas777/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_hometo.png b/petronas777/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_link.png b/petronas777/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_menu.png b/petronas777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_shousuo.png b/petronas777/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_tel.png b/petronas777/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/petronas777/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/petronas777/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/petronas777/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png b/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..f54c015 Binary files /dev/null and b/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/petronas777/src/main/res/values-en/strings.xml b/petronas777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d07f67 --- /dev/null +++ b/petronas777/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Petronas777 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/petronas777/src/main/res/values-night/themes.xml b/petronas777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/petronas777/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/values/colors.xml b/petronas777/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/petronas777/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/petronas777/src/main/res/values/strings.xml b/petronas777/src/main/res/values/strings.xml new file mode 100644 index 0000000..39ca383 --- /dev/null +++ b/petronas777/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + Petronas777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/values/style.xml b/petronas777/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/petronas777/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/values/themes.xml b/petronas777/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/petronas777/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/app_updater_paths.xml b/petronas777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/petronas777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/network_security_config.xml b/petronas777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/petronas777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/provider_paths.xml b/petronas777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/petronas777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/petronas777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/petronas777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/play88aus/.gitignore b/play88aus/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/play88aus/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/play88aus/build.gradle b/play88aus/build.gradle new file mode 100644 index 0000000..b47a39f --- /dev/null +++ b/play88aus/build.gradle @@ -0,0 +1,86 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.play88aus" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('play88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('play88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/play88aus/google-services.json b/play88aus/google-services.json new file mode 100644 index 0000000..603f373 --- /dev/null +++ b/play88aus/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "470970689432", + "project_id": "play88-4e015", + "storage_bucket": "play88-4e015.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:470970689432:android:8165319d34e41ca4f06ded", + "android_client_info": { + "package_name": "com.web.play88aus" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBcvEjZydfY_EAGDpnqti03Vh7d3dEUjDE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/play88aus/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/play88aus/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/play88aus/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/play88aus/play88.jks b/play88aus/play88.jks new file mode 100644 index 0000000..c49d071 Binary files /dev/null and b/play88aus/play88.jks differ diff --git a/play88aus/proguard-rules.pro b/play88aus/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/play88aus/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/play88aus/release/output-metadata.json b/play88aus/release/output-metadata.json new file mode 100644 index 0000000..edb1494 --- /dev/null +++ b/play88aus/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.play88aus", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "play88aus-release.apk" + } + ] +} \ No newline at end of file diff --git a/play88aus/release/play88aus.apk b/play88aus/release/play88aus.apk new file mode 100644 index 0000000..9ea0f3d Binary files /dev/null and b/play88aus/release/play88aus.apk differ diff --git a/play88aus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/play88aus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/play88aus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/play88aus/src/main/AndroidManifest.xml b/play88aus/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a75554e --- /dev/null +++ b/play88aus/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/java/com/web/play88aus/MainActivity2.java b/play88aus/src/main/java/com/web/play88aus/MainActivity2.java new file mode 100644 index 0000000..e10b1a4 --- /dev/null +++ b/play88aus/src/main/java/com/web/play88aus/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.play88aus; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 69; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.ply88.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/play88aus/src/main/java/com/web/play88aus/MyFirebaseMessageingService.java b/play88aus/src/main/java/com/web/play88aus/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d6c7dc6 --- /dev/null +++ b/play88aus/src/main/java/com/web/play88aus/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.play88aus; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/play88aus/src/main/java/com/web/play88aus/WebApplication.java b/play88aus/src/main/java/com/web/play88aus/WebApplication.java new file mode 100644 index 0000000..fe528af --- /dev/null +++ b/play88aus/src/main/java/com/web/play88aus/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.play88aus; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/play88aus/src/main/res/drawable-anydpi/ic_action_back.xml b/play88aus/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/play88aus/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/play88aus/src/main/res/drawable-hdpi/ic_action_back.png b/play88aus/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/play88aus/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/play88aus/src/main/res/drawable-mdpi/ic_action_back.png b/play88aus/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/play88aus/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/play88aus/src/main/res/drawable-v24/ic_launcher_foreground.xml b/play88aus/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/play88aus/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable-xhdpi/ic_action_back.png b/play88aus/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/play88aus/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/play88aus/src/main/res/drawable-xxhdpi/ic_action_back.png b/play88aus/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/play88aus/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/play88aus/src/main/res/drawable/ic_launcher_background.xml b/play88aus/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/play88aus/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play88aus/src/main/res/drawable/input_bg.xml b/play88aus/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/play88aus/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/play88aus/src/main/res/drawable/pass_word_bg.xml b/play88aus/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/play88aus/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/play88aus/src/main/res/drawable/pass_word_bg1.xml b/play88aus/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/play88aus/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable/pass_word_bg2.xml b/play88aus/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/play88aus/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable/shape_btn_bg.xml b/play88aus/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/play88aus/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable/shape_dialog_bg2.xml b/play88aus/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/play88aus/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable/shape_dialog_bg3.xml b/play88aus/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/play88aus/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/drawable/shape_dialog_bg_new.xml b/play88aus/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/play88aus/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/play88aus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/mipmap-hdpi/ic_empty.png b/play88aus/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/play88aus/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/play88aus/src/main/res/mipmap-hdpi/ic_pull_down.png b/play88aus/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/play88aus/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/play88aus/src/main/res/mipmap-xhdpi/ic_close.png b/play88aus/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/play88aus/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/play88aus/src/main/res/mipmap-xhdpi/ic_menu.png b/play88aus/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/play88aus/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/play88aus/src/main/res/mipmap-xxhdpi/app_logo.png b/play88aus/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..142a8c8 Binary files /dev/null and b/play88aus/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/play88aus/src/main/res/values-en/strings.xml b/play88aus/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..e129505 --- /dev/null +++ b/play88aus/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + PLAY88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/play88aus/src/main/res/values-night/themes.xml b/play88aus/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/play88aus/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/values/colors.xml b/play88aus/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/play88aus/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/play88aus/src/main/res/values/strings.xml b/play88aus/src/main/res/values/strings.xml new file mode 100644 index 0000000..17c6c12 --- /dev/null +++ b/play88aus/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PLAY88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/values/themes.xml b/play88aus/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/play88aus/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/xml/app_updater_paths.xml b/play88aus/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/play88aus/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/xml/network_security_config.xml b/play88aus/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/play88aus/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/play88aus/src/main/res/xml/provider_paths.xml b/play88aus/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/play88aus/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/play88aus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/play88aus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/play88aus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/pms99/.gitignore b/pms99/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/pms99/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/pms99/build.gradle b/pms99/build.gradle new file mode 100644 index 0000000..5d80217 --- /dev/null +++ b/pms99/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.pms99" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 108 + versionName "v1.0.8" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('pms99.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('pms99.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/pms99/google-services.json b/pms99/google-services.json new file mode 100644 index 0000000..23fa256 --- /dev/null +++ b/pms99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "413966018522", + "project_id": "pms99-bee16", + "storage_bucket": "pms99-bee16.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:413966018522:android:7f9d92924fb4c9ba02c2e3", + "android_client_info": { + "package_name": "com.web.pms99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDG6ieFcqRuQv6ilT33szbtjXnPdDTiOhI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pms99/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/pms99/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/pms99/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/pms99/pms99.jks b/pms99/pms99.jks new file mode 100644 index 0000000..0733261 Binary files /dev/null and b/pms99/pms99.jks differ diff --git a/pms99/proguard-rules.pro b/pms99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pms99/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/pms99/release/output-metadata.json b/pms99/release/output-metadata.json new file mode 100644 index 0000000..7c734c1 --- /dev/null +++ b/pms99/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.pms99", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 108, + "versionName": "v1.0.8", + "outputFile": "pms99-release.apk" + } + ] +} \ No newline at end of file diff --git a/pms99/release/pms99.apk b/pms99/release/pms99.apk new file mode 100644 index 0000000..e065e1a Binary files /dev/null and b/pms99/release/pms99.apk differ diff --git a/pms99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/pms99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/pms99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/pms99/src/main/AndroidManifest.xml b/pms99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..06e05f7 --- /dev/null +++ b/pms99/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/java/com/web/pms99/MainActivity2.java b/pms99/src/main/java/com/web/pms99/MainActivity2.java new file mode 100644 index 0000000..35dd418 --- /dev/null +++ b/pms99/src/main/java/com/web/pms99/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.pms99; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 82; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://pms99.com/"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/pms99/src/main/java/com/web/pms99/MyFirebaseMessageingService.java b/pms99/src/main/java/com/web/pms99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d27e9da --- /dev/null +++ b/pms99/src/main/java/com/web/pms99/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.pms99; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/pms99/src/main/java/com/web/pms99/WebApplication.java b/pms99/src/main/java/com/web/pms99/WebApplication.java new file mode 100644 index 0000000..a16d8f3 --- /dev/null +++ b/pms99/src/main/java/com/web/pms99/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.pms99; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/pms99/src/main/res/drawable-anydpi/ic_action_back.xml b/pms99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/pms99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/pms99/src/main/res/drawable-hdpi/ic_action_back.png b/pms99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/pms99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/pms99/src/main/res/drawable-mdpi/ic_action_back.png b/pms99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/pms99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/pms99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/pms99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/pms99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/drawable-xhdpi/ic_action_back.png b/pms99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/pms99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/pms99/src/main/res/drawable-xxhdpi/ic_action_back.png b/pms99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/pms99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/pms99/src/main/res/drawable/ic_launcher_background.xml b/pms99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/pms99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pms99/src/main/res/drawable/input_bg.xml b/pms99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/pms99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/pms99/src/main/res/drawable/pass_word_bg.xml b/pms99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/pms99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/pms99/src/main/res/drawable/pass_word_bg1.xml b/pms99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/pms99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/drawable/pass_word_bg2.xml b/pms99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/pms99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/drawable/shape_btn_bg.xml b/pms99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/pms99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/drawable/shape_dialog_bg2.xml b/pms99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/pms99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/drawable/shape_dialog_bg3.xml b/pms99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/pms99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pms99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/mipmap-hdpi/ic_empty.png b/pms99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/pms99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/pms99/src/main/res/mipmap-hdpi/ic_pull_down.png b/pms99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/pms99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/pms99/src/main/res/mipmap-xhdpi/ic_close.png b/pms99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/pms99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/pms99/src/main/res/mipmap-xhdpi/ic_menu.png b/pms99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/pms99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/pms99/src/main/res/mipmap-xxhdpi/app_logo.png b/pms99/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..89e405f Binary files /dev/null and b/pms99/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/pms99/src/main/res/values-en/strings.xml b/pms99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..d30b41e --- /dev/null +++ b/pms99/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + PMS99 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/pms99/src/main/res/values-night/themes.xml b/pms99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/pms99/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/values/colors.xml b/pms99/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/pms99/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/pms99/src/main/res/values/strings.xml b/pms99/src/main/res/values/strings.xml new file mode 100644 index 0000000..ddf9d63 --- /dev/null +++ b/pms99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PMS99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/values/themes.xml b/pms99/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/pms99/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/xml/app_updater_paths.xml b/pms99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pms99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/main/res/xml/network_security_config.xml b/pms99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pms99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pms99/src/main/res/xml/provider_paths.xml b/pms99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pms99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pms99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/pms99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/pms99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..98b7046 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,36 @@ +include ':app' +include ':76Pokies' +include ':Dmcslot' +include ':agn888new' +include ':amb88' +include ':boda8' +include ':jackpotau' +include ':toto88new' +include ':ttslot888new' +include ':u88' +include ':uwin33' +include ':vv88' +include ':base' +include ':Mk88aud' +include ':Bintang918' +include ':Bbj' +include ':9kelab' +include ':telur33' +include ':shell777' +include ':petronas777' +include ':Petron777' +include ':Mko888' +include ':Mahkota8' +include ':Magnum888' +include ':Kejapjudi' +include ':Jeslot88' +include ':Judy88' +include ':Gdslot888' +include ':Cashsweep' +include ':Candy916' +include ':pms99' +include ':mgi' +include ':cekap33' +include ':play88aus' +include ':cergas' +include ':spinsini' diff --git a/shell777/.gitignore b/shell777/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/shell777/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/shell777/build.gradle b/shell777/build.gradle new file mode 100644 index 0000000..345a63d --- /dev/null +++ b/shell777/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.SHELL777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('shell777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('shell777.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/shell777/google-services.json b/shell777/google-services.json new file mode 100644 index 0000000..34c76cf --- /dev/null +++ b/shell777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "723900171060", + "project_id": "shell777-fc4cf", + "storage_bucket": "shell777-fc4cf.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:723900171060:android:eceded8f8f7dbd39da9b61", + "android_client_info": { + "package_name": "com.web.SHELL777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC8XtnYn9NUAO1N66aOL3--ff3Ht8gv9yk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/shell777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/shell777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/shell777/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/shell777/proguard-rules.pro b/shell777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/shell777/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/shell777/release/output-metadata.json b/shell777/release/output-metadata.json new file mode 100644 index 0000000..b3e4265 --- /dev/null +++ b/shell777/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.SHELL777", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "shell777-release.apk" + } + ] +} \ No newline at end of file diff --git a/shell777/release/shell777.apk b/shell777/release/shell777.apk new file mode 100644 index 0000000..87f0072 Binary files /dev/null and b/shell777/release/shell777.apk differ diff --git a/shell777/shell777.jks b/shell777/shell777.jks new file mode 100644 index 0000000..65e9363 Binary files /dev/null and b/shell777/shell777.jks differ diff --git a/shell777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/shell777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/shell777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/shell777/src/main/AndroidManifest.xml b/shell777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d81b9df --- /dev/null +++ b/shell777/src/main/AndroidManifest.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/java/com/web/SHELL777/MainActivity2.java b/shell777/src/main/java/com/web/SHELL777/MainActivity2.java new file mode 100644 index 0000000..9548cc6 --- /dev/null +++ b/shell777/src/main/java/com/web/SHELL777/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.SHELL777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 99; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://www.shell777.vip"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/shell777/src/main/java/com/web/SHELL777/MyFirebaseMessageingService.java b/shell777/src/main/java/com/web/SHELL777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0dccaae --- /dev/null +++ b/shell777/src/main/java/com/web/SHELL777/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.SHELL777; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/shell777/src/main/java/com/web/SHELL777/WebApplication.java b/shell777/src/main/java/com/web/SHELL777/WebApplication.java new file mode 100644 index 0000000..7d953e0 --- /dev/null +++ b/shell777/src/main/java/com/web/SHELL777/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.SHELL777; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/shell777/src/main/res/drawable-anydpi/ic_action_back.xml b/shell777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/shell777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/shell777/src/main/res/drawable-hdpi/ic_action_back.png b/shell777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/shell777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/shell777/src/main/res/drawable-mdpi/ic_action_back.png b/shell777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/shell777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/shell777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/shell777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/shell777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/drawable-xhdpi/ic_action_back.png b/shell777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/shell777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/shell777/src/main/res/drawable-xxhdpi/ic_action_back.png b/shell777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/shell777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/shell777/src/main/res/drawable/ic_launcher_background.xml b/shell777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/shell777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell777/src/main/res/drawable/input_bg.xml b/shell777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/shell777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/shell777/src/main/res/drawable/pass_word_bg.xml b/shell777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/shell777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/shell777/src/main/res/drawable/pass_word_bg1.xml b/shell777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/shell777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/drawable/pass_word_bg2.xml b/shell777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/shell777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/drawable/shape_btn_bg.xml b/shell777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/shell777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/drawable/shape_dialog_bg2.xml b/shell777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/shell777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/drawable/shape_dialog_bg3.xml b/shell777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/shell777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/shell777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/mipmap-hdpi/ic_empty.png b/shell777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/shell777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/shell777/src/main/res/mipmap-hdpi/ic_pull_down.png b/shell777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/shell777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_close.png b/shell777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_facebook.png b/shell777/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_hometo.png b/shell777/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_link.png b/shell777/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_menu.png b/shell777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_shousuo.png b/shell777/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_tel.png b/shell777/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/shell777/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/shell777/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/shell777/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/shell777/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/shell777/src/main/res/mipmap-xxhdpi/app_logo.png b/shell777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a60f7f4 Binary files /dev/null and b/shell777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/shell777/src/main/res/values-en/strings.xml b/shell777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..645de69 --- /dev/null +++ b/shell777/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Shell777 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/shell777/src/main/res/values-night/themes.xml b/shell777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/shell777/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/values/colors.xml b/shell777/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/shell777/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/shell777/src/main/res/values/strings.xml b/shell777/src/main/res/values/strings.xml new file mode 100644 index 0000000..4c90174 --- /dev/null +++ b/shell777/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + Shell777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/values/style.xml b/shell777/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/shell777/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/values/themes.xml b/shell777/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/shell777/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/xml/app_updater_paths.xml b/shell777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/shell777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/main/res/xml/network_security_config.xml b/shell777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/shell777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/shell777/src/main/res/xml/provider_paths.xml b/shell777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/shell777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/shell777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/shell777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/shell777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/spinsini/.gitignore b/spinsini/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/spinsini/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/spinsini/build.gradle b/spinsini/build.gradle new file mode 100644 index 0000000..8b84cf8 --- /dev/null +++ b/spinsini/build.gradle @@ -0,0 +1,85 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.web.spinsini" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + // implementation("com.google.firebase:firebase-messaging:23.2.1") + // implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/spinsini/dskjweb.jks b/spinsini/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/spinsini/dskjweb.jks differ diff --git a/spinsini/google-services.json b/spinsini/google-services.json new file mode 100644 index 0000000..0ccb770 --- /dev/null +++ b/spinsini/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "773432010162", + "project_id": "cergas999-c8b99", + "storage_bucket": "cergas999-c8b99.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:773432010162:android:7721474e224398963bb0ab", + "android_client_info": { + "package_name": "com.web.spinsini" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCysVxeDJd9W_ZFA_O5-ruQbSf2BHqhTUs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/spinsini/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/spinsini/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/spinsini/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/spinsini/proguard-rules.pro b/spinsini/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/spinsini/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/spinsini/release/cergas.apk b/spinsini/release/cergas.apk new file mode 100644 index 0000000..657a7f1 Binary files /dev/null and b/spinsini/release/cergas.apk differ diff --git a/spinsini/release/output-metadata.json b/spinsini/release/output-metadata.json new file mode 100644 index 0000000..2bdcd59 --- /dev/null +++ b/spinsini/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.cergas", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "cergas-release.apk" + } + ] +} \ No newline at end of file diff --git a/spinsini/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/spinsini/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/spinsini/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/spinsini/src/main/AndroidManifest.xml b/spinsini/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e42b147 --- /dev/null +++ b/spinsini/src/main/AndroidManifest.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/java/com/web/spinsini/MainActivity2.java b/spinsini/src/main/java/com/web/spinsini/MainActivity2.java new file mode 100644 index 0000000..74c3834 --- /dev/null +++ b/spinsini/src/main/java/com/web/spinsini/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.spinsini; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 76; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url","https://spinsini.co"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/spinsini/src/main/java/com/web/spinsini/MyFirebaseMessageingService.java b/spinsini/src/main/java/com/web/spinsini/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ea4a6ba --- /dev/null +++ b/spinsini/src/main/java/com/web/spinsini/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.spinsini; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/spinsini/src/main/java/com/web/spinsini/WebApplication.java b/spinsini/src/main/java/com/web/spinsini/WebApplication.java new file mode 100644 index 0000000..4134e11 --- /dev/null +++ b/spinsini/src/main/java/com/web/spinsini/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.spinsini; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/spinsini/src/main/res/drawable-anydpi/ic_action_back.xml b/spinsini/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/spinsini/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/spinsini/src/main/res/drawable-hdpi/ic_action_back.png b/spinsini/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/spinsini/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/spinsini/src/main/res/drawable-mdpi/ic_action_back.png b/spinsini/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/spinsini/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/spinsini/src/main/res/drawable-v24/ic_launcher_foreground.xml b/spinsini/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/spinsini/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable-xhdpi/ic_action_back.png b/spinsini/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/spinsini/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/spinsini/src/main/res/drawable-xxhdpi/ic_action_back.png b/spinsini/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/spinsini/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/spinsini/src/main/res/drawable/ic_launcher_background.xml b/spinsini/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/spinsini/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spinsini/src/main/res/drawable/input_bg.xml b/spinsini/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/spinsini/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/spinsini/src/main/res/drawable/pass_word_bg.xml b/spinsini/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/spinsini/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/spinsini/src/main/res/drawable/pass_word_bg1.xml b/spinsini/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/spinsini/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable/pass_word_bg2.xml b/spinsini/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/spinsini/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable/shape_btn_bg.xml b/spinsini/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/spinsini/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable/shape_dialog_bg2.xml b/spinsini/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/spinsini/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable/shape_dialog_bg3.xml b/spinsini/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/spinsini/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/drawable/shape_dialog_bg_new.xml b/spinsini/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/spinsini/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/spinsini/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/mipmap-hdpi/ic_empty.png b/spinsini/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/spinsini/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/spinsini/src/main/res/mipmap-hdpi/ic_pull_down.png b/spinsini/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/spinsini/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/spinsini/src/main/res/mipmap-xhdpi/ic_close.png b/spinsini/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/spinsini/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/spinsini/src/main/res/mipmap-xhdpi/ic_menu.png b/spinsini/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/spinsini/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/spinsini/src/main/res/mipmap-xxhdpi/app_logo.jpg b/spinsini/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..8646400 Binary files /dev/null and b/spinsini/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/spinsini/src/main/res/values-en/strings.xml b/spinsini/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..1983f39 --- /dev/null +++ b/spinsini/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + Cergas + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/spinsini/src/main/res/values-night/themes.xml b/spinsini/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/spinsini/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/values/colors.xml b/spinsini/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/spinsini/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/spinsini/src/main/res/values/strings.xml b/spinsini/src/main/res/values/strings.xml new file mode 100644 index 0000000..29e65d8 --- /dev/null +++ b/spinsini/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Cergas + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/values/themes.xml b/spinsini/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/spinsini/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/xml/app_updater_paths.xml b/spinsini/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/spinsini/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/xml/network_security_config.xml b/spinsini/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/spinsini/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/spinsini/src/main/res/xml/provider_paths.xml b/spinsini/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/spinsini/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/spinsini/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/spinsini/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/spinsini/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/telur33/.gitignore b/telur33/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/telur33/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/telur33/build.gradle b/telur33/build.gradle new file mode 100644 index 0000000..e220dc5 --- /dev/null +++ b/telur33/build.gradle @@ -0,0 +1,92 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + applicationId "com.web.telur33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 106 + versionName "v1.0.6" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/telur33/google-services.json b/telur33/google-services.json new file mode 100644 index 0000000..c4df3f9 --- /dev/null +++ b/telur33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "852761213386", + "project_id": "telur33b", + "storage_bucket": "telur33b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:852761213386:android:e1559f6562c328de77f733", + "android_client_info": { + "package_name": "com.web.telur33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCztC24cM2X_RALbJRB2-yUGZZ1KYEFjL0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/telur33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/telur33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/telur33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/telur33/proguard-rules.pro b/telur33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/telur33/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/telur33/release/output-metadata.json b/telur33/release/output-metadata.json new file mode 100644 index 0000000..a1ccb36 --- /dev/null +++ b/telur33/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.telur33", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 106, + "versionName": "v1.0.6", + "outputFile": "telur33-release.apk" + } + ] +} \ No newline at end of file diff --git a/telur33/release/telur33.apk b/telur33/release/telur33.apk new file mode 100644 index 0000000..b82d4c0 Binary files /dev/null and b/telur33/release/telur33.apk differ diff --git a/telur33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/telur33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/telur33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/telur33/src/main/AndroidManifest.xml b/telur33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2763856 --- /dev/null +++ b/telur33/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/java/com/web/telur33/MainActivity2.java b/telur33/src/main/java/com/web/telur33/MainActivity2.java new file mode 100644 index 0000000..4097c50 --- /dev/null +++ b/telur33/src/main/java/com/web/telur33/MainActivity2.java @@ -0,0 +1,54 @@ +package com.web.telur33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.MainActivity; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 100; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + MainActivity.saveString(this, "base_url", "https://telur33b.com"); + + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/telur33/src/main/java/com/web/telur33/MyFirebaseMessageingService.java b/telur33/src/main/java/com/web/telur33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2cfd00b --- /dev/null +++ b/telur33/src/main/java/com/web/telur33/MyFirebaseMessageingService.java @@ -0,0 +1,171 @@ +package com.web.telur33; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/telur33/src/main/java/com/web/telur33/WebApplication.java b/telur33/src/main/java/com/web/telur33/WebApplication.java new file mode 100644 index 0000000..b8d99aa --- /dev/null +++ b/telur33/src/main/java/com/web/telur33/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.telur33; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/telur33/src/main/res/drawable-anydpi/ic_action_back.xml b/telur33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/telur33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/telur33/src/main/res/drawable-hdpi/ic_action_back.png b/telur33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/telur33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/telur33/src/main/res/drawable-mdpi/ic_action_back.png b/telur33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/telur33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/telur33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/telur33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/telur33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/drawable-xhdpi/ic_action_back.png b/telur33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/telur33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/telur33/src/main/res/drawable-xxhdpi/ic_action_back.png b/telur33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/telur33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/telur33/src/main/res/drawable/ic_launcher_background.xml b/telur33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/telur33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/telur33/src/main/res/drawable/input_bg.xml b/telur33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/telur33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/telur33/src/main/res/drawable/pass_word_bg.xml b/telur33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/telur33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/telur33/src/main/res/drawable/pass_word_bg1.xml b/telur33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/telur33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/drawable/pass_word_bg2.xml b/telur33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/telur33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/drawable/shape_btn_bg.xml b/telur33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/telur33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/drawable/shape_dialog_bg2.xml b/telur33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/telur33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/drawable/shape_dialog_bg3.xml b/telur33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/telur33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/telur33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/mipmap-hdpi/ic_empty.png b/telur33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/telur33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/telur33/src/main/res/mipmap-hdpi/ic_pull_down.png b/telur33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/telur33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_close.png b/telur33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_facebook.png b/telur33/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_hometo.png b/telur33/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_link.png b/telur33/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_menu.png b/telur33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_shousuo.png b/telur33/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_tel.png b/telur33/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/telur33/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/telur33/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/telur33/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/telur33/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/telur33/src/main/res/mipmap-xxhdpi/app_logo.png b/telur33/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..83d3a76 Binary files /dev/null and b/telur33/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/telur33/src/main/res/values-en/strings.xml b/telur33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..eebab16 --- /dev/null +++ b/telur33/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TELUR33 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/telur33/src/main/res/values-night/themes.xml b/telur33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/telur33/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/values/colors.xml b/telur33/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/telur33/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/telur33/src/main/res/values/strings.xml b/telur33/src/main/res/values/strings.xml new file mode 100644 index 0000000..48de585 --- /dev/null +++ b/telur33/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + TELUR33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/values/style.xml b/telur33/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/telur33/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/values/themes.xml b/telur33/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/telur33/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/xml/app_updater_paths.xml b/telur33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/telur33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/main/res/xml/network_security_config.xml b/telur33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/telur33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/telur33/src/main/res/xml/provider_paths.xml b/telur33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/telur33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/telur33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/telur33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/telur33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/telur33/telur33.jks b/telur33/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/telur33/telur33.jks differ diff --git a/toto88new/.gitignore b/toto88new/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/toto88new/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/toto88new/build.gradle b/toto88new/build.gradle new file mode 100644 index 0000000..4eaacbc --- /dev/null +++ b/toto88new/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + //101 + applicationId "com.web.toto88new" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 103 + versionName "v1.0.3" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('toto.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('toto.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/toto88new/google-services.json b/toto88new/google-services.json new file mode 100644 index 0000000..d1e2367 --- /dev/null +++ b/toto88new/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "538250911070", + "project_id": "toto88-d153d", + "storage_bucket": "toto88-d153d.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:538250911070:android:a019ab039c5fcdba71c3cf", + "android_client_info": { + "package_name": "com.web.toto88new" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCSIHjVDdNqyN5Acc0wG2puTb1XCQZjxkU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:538250911070:android:4de5657dbba389e071c3cf", + "android_client_info": { + "package_name": "com.web.toto88newnew" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCSIHjVDdNqyN5Acc0wG2puTb1XCQZjxkU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/toto88new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/toto88new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/toto88new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/toto88new/proguard-rules.pro b/toto88new/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/toto88new/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/toto88new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/toto88new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/toto88new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/toto88new/src/main/AndroidManifest.xml b/toto88new/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f523804 --- /dev/null +++ b/toto88new/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/java/com/web/toto88new/MainActivity2.java b/toto88new/src/main/java/com/web/toto88new/MainActivity2.java new file mode 100644 index 0000000..369064b --- /dev/null +++ b/toto88new/src/main/java/com/web/toto88new/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.toto88new; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 101; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/toto88new/src/main/java/com/web/toto88new/MyFirebaseMessageingService.java b/toto88new/src/main/java/com/web/toto88new/MyFirebaseMessageingService.java new file mode 100644 index 0000000..3f86aaa --- /dev/null +++ b/toto88new/src/main/java/com/web/toto88new/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.toto88new; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/toto88new/src/main/java/com/web/toto88new/WebApplication.java b/toto88new/src/main/java/com/web/toto88new/WebApplication.java new file mode 100644 index 0000000..4f7ce01 --- /dev/null +++ b/toto88new/src/main/java/com/web/toto88new/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.toto88new; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/toto88new/src/main/res/drawable-anydpi/ic_action_back.xml b/toto88new/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/toto88new/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/toto88new/src/main/res/drawable-hdpi/ic_action_back.png b/toto88new/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/toto88new/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/toto88new/src/main/res/drawable-mdpi/ic_action_back.png b/toto88new/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/toto88new/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/toto88new/src/main/res/drawable-v24/ic_launcher_foreground.xml b/toto88new/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/toto88new/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/drawable-xhdpi/ic_action_back.png b/toto88new/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/toto88new/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/toto88new/src/main/res/drawable-xxhdpi/ic_action_back.png b/toto88new/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/toto88new/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/toto88new/src/main/res/drawable/ic_launcher_background.xml b/toto88new/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/toto88new/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toto88new/src/main/res/drawable/input_bg.xml b/toto88new/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/toto88new/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/toto88new/src/main/res/drawable/pass_word_bg.xml b/toto88new/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/toto88new/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/toto88new/src/main/res/drawable/pass_word_bg1.xml b/toto88new/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/toto88new/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/drawable/pass_word_bg2.xml b/toto88new/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/toto88new/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/drawable/shape_btn_bg.xml b/toto88new/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/toto88new/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/drawable/shape_dialog_bg2.xml b/toto88new/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/toto88new/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/drawable/shape_dialog_bg3.xml b/toto88new/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/toto88new/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/toto88new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/mipmap-hdpi/ic_empty.png b/toto88new/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/toto88new/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/toto88new/src/main/res/mipmap-hdpi/ic_pull_down.png b/toto88new/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/toto88new/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_close.png b/toto88new/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_facebook.png b/toto88new/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_hometo.png b/toto88new/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_link.png b/toto88new/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_menu.png b/toto88new/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_shousuo.png b/toto88new/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_tel.png b/toto88new/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/toto88new/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/toto88new/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/toto88new/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/toto88new/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/toto88new/src/main/res/mipmap-xxhdpi/app_logo.jpg b/toto88new/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..9d43b8a Binary files /dev/null and b/toto88new/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/toto88new/src/main/res/values-en/strings.xml b/toto88new/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..636615a --- /dev/null +++ b/toto88new/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TOTO88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/toto88new/src/main/res/values-night/themes.xml b/toto88new/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/toto88new/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/values/colors.xml b/toto88new/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/toto88new/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/toto88new/src/main/res/values/strings.xml b/toto88new/src/main/res/values/strings.xml new file mode 100644 index 0000000..4b051c3 --- /dev/null +++ b/toto88new/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + TOTO88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/values/style.xml b/toto88new/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/toto88new/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/values/themes.xml b/toto88new/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/toto88new/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/xml/app_updater_paths.xml b/toto88new/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/toto88new/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/xml/network_security_config.xml b/toto88new/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/toto88new/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/xml/provider_paths.xml b/toto88new/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/toto88new/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/toto88new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/toto88new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/toto88new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/toto88new/toto.jks b/toto88new/toto.jks new file mode 100644 index 0000000..2030e0f Binary files /dev/null and b/toto88new/toto.jks differ diff --git a/ttslot888new/.gitignore b/ttslot888new/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/ttslot888new/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ttslot888new/build.gradle b/ttslot888new/build.gradle new file mode 100644 index 0000000..9214ef6 --- /dev/null +++ b/ttslot888new/build.gradle @@ -0,0 +1,94 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + + defaultConfig { + + //102 + applicationId "com.web.ttslot888new" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 103 + versionName "v1.0.3" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('ttslotweb.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + release { + storeFile file('ttslotweb.jks') + storePassword "android2025" + keyAlias 'key0' + keyPassword "android2025" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation platform('com.google.firebase:firebase-bom:32.1.0') + + // Add the dependencies for the Firebase Cloud Messaging and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-analytics' +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/ttslot888new/google-services.json b/ttslot888new/google-services.json new file mode 100644 index 0000000..5f660a5 --- /dev/null +++ b/ttslot888new/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "1098406701837", + "project_id": "ttslot888-29636", + "storage_bucket": "ttslot888-29636.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1098406701837:android:bcb6a76a6acfafb1355e44", + "android_client_info": { + "package_name": "com.web.ttslot888new" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBIeR89kn0Q-5TN7yyCQnUehnQYmmVpEqk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1098406701837:android:a906de8231ccb6d3355e44", + "android_client_info": { + "package_name": "com.web.ttslot888newnew" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBIeR89kn0Q-5TN7yyCQnUehnQYmmVpEqk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ttslot888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/ttslot888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/ttslot888new/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/ttslot888new/proguard-rules.pro b/ttslot888new/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/ttslot888new/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/ttslot888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/ttslot888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/ttslot888new/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/ttslot888new/src/main/AndroidManifest.xml b/ttslot888new/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c64d10d --- /dev/null +++ b/ttslot888new/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/java/com/web/ttslot888new/MainActivity2.java b/ttslot888new/src/main/java/com/web/ttslot888new/MainActivity2.java new file mode 100644 index 0000000..495a805 --- /dev/null +++ b/ttslot888new/src/main/java/com/web/ttslot888new/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.ttslot888new; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 102; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/ttslot888new/src/main/java/com/web/ttslot888new/MyFirebaseMessageingService.java b/ttslot888new/src/main/java/com/web/ttslot888new/MyFirebaseMessageingService.java new file mode 100644 index 0000000..c1cc6de --- /dev/null +++ b/ttslot888new/src/main/java/com/web/ttslot888new/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.ttslot888new; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/ttslot888new/src/main/java/com/web/ttslot888new/WebApplication.java b/ttslot888new/src/main/java/com/web/ttslot888new/WebApplication.java new file mode 100644 index 0000000..4fd1bc0 --- /dev/null +++ b/ttslot888new/src/main/java/com/web/ttslot888new/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.ttslot888new; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/ttslot888new/src/main/res/drawable-anydpi/ic_action_back.xml b/ttslot888new/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/ttslot888new/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/ttslot888new/src/main/res/drawable-hdpi/ic_action_back.png b/ttslot888new/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/ttslot888new/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/ttslot888new/src/main/res/drawable-mdpi/ic_action_back.png b/ttslot888new/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/ttslot888new/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/ttslot888new/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ttslot888new/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/ttslot888new/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/drawable-xhdpi/ic_action_back.png b/ttslot888new/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/ttslot888new/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/ttslot888new/src/main/res/drawable-xxhdpi/ic_action_back.png b/ttslot888new/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/ttslot888new/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ttslot888new/src/main/res/drawable/ic_launcher_background.xml b/ttslot888new/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/ttslot888new/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ttslot888new/src/main/res/drawable/input_bg.xml b/ttslot888new/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/ttslot888new/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ttslot888new/src/main/res/drawable/pass_word_bg.xml b/ttslot888new/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/ttslot888new/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/ttslot888new/src/main/res/drawable/pass_word_bg1.xml b/ttslot888new/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/ttslot888new/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/drawable/pass_word_bg2.xml b/ttslot888new/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/ttslot888new/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/drawable/shape_btn_bg.xml b/ttslot888new/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/ttslot888new/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/drawable/shape_dialog_bg2.xml b/ttslot888new/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/ttslot888new/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/drawable/shape_dialog_bg3.xml b/ttslot888new/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/ttslot888new/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ttslot888new/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/mipmap-hdpi/ic_empty.png b/ttslot888new/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/ttslot888new/src/main/res/mipmap-hdpi/ic_pull_down.png b/ttslot888new/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_close.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_facebook.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_hometo.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_link.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_menu.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_shousuo.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_tel.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/ttslot888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/ttslot888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/ttslot888new/src/main/res/mipmap-xxhdpi/app_logo.png b/ttslot888new/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..0ac7f9e Binary files /dev/null and b/ttslot888new/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/ttslot888new/src/main/res/values-en/strings.xml b/ttslot888new/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..31875da --- /dev/null +++ b/ttslot888new/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TTSLOT888 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + App not installed + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/values-night/themes.xml b/ttslot888new/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/ttslot888new/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/values/colors.xml b/ttslot888new/src/main/res/values/colors.xml new file mode 100644 index 0000000..ec06067 --- /dev/null +++ b/ttslot888new/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + #DC1927 + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/values/strings.xml b/ttslot888new/src/main/res/values/strings.xml new file mode 100644 index 0000000..b282601 --- /dev/null +++ b/ttslot888new/src/main/res/values/strings.xml @@ -0,0 +1,77 @@ + + TTSLOT888 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 应用未安装 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/values/style.xml b/ttslot888new/src/main/res/values/style.xml new file mode 100644 index 0000000..bf1389c --- /dev/null +++ b/ttslot888new/src/main/res/values/style.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/values/themes.xml b/ttslot888new/src/main/res/values/themes.xml new file mode 100644 index 0000000..a973841 --- /dev/null +++ b/ttslot888new/src/main/res/values/themes.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/xml/app_updater_paths.xml b/ttslot888new/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ttslot888new/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/xml/network_security_config.xml b/ttslot888new/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ttslot888new/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ttslot888new/src/main/res/xml/provider_paths.xml b/ttslot888new/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ttslot888new/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ttslot888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ttslot888new/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/ttslot888new/ttslotweb.jks b/ttslot888new/ttslotweb.jks new file mode 100644 index 0000000..4f5b457 Binary files /dev/null and b/ttslot888new/ttslotweb.jks differ diff --git a/u88/.gitignore b/u88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/u88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/u88/build.gradle b/u88/build.gradle new file mode 100644 index 0000000..5551933 --- /dev/null +++ b/u88/build.gradle @@ -0,0 +1,87 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + //70 + applicationId "com.web.u88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 104 + versionName "v1.0.4" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('u88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('u88.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/u88/google-services.json b/u88/google-services.json new file mode 100644 index 0000000..0286a0f --- /dev/null +++ b/u88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "150764693015", + "project_id": "u88666-39a65", + "storage_bucket": "u88666-39a65.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:150764693015:android:be8246575bdd4c4ab3de52", + "android_client_info": { + "package_name": "com.web.u88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCp8-o7eCBwSD540-rKwMG8TgGy1jgbG2o" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/u88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/u88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/u88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/u88/proguard-rules.pro b/u88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/u88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/u88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/u88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/u88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/u88/src/main/AndroidManifest.xml b/u88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..642eb04 --- /dev/null +++ b/u88/src/main/AndroidManifest.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/java/com/web/u88/MainActivity2.java b/u88/src/main/java/com/web/u88/MainActivity2.java new file mode 100644 index 0000000..40d6054 --- /dev/null +++ b/u88/src/main/java/com/web/u88/MainActivity2.java @@ -0,0 +1,50 @@ +package com.web.u88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 70; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } +} diff --git a/u88/src/main/java/com/web/u88/MyFirebaseMessageingService.java b/u88/src/main/java/com/web/u88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2f69250 --- /dev/null +++ b/u88/src/main/java/com/web/u88/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.u88; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/u88/src/main/java/com/web/u88/WebApplication.java b/u88/src/main/java/com/web/u88/WebApplication.java new file mode 100644 index 0000000..9cfe36c --- /dev/null +++ b/u88/src/main/java/com/web/u88/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.u88; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/u88/src/main/res/drawable-anydpi/ic_action_back.xml b/u88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/u88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/u88/src/main/res/drawable-hdpi/ic_action_back.png b/u88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/u88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/u88/src/main/res/drawable-mdpi/ic_action_back.png b/u88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/u88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/u88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/u88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/u88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable-xhdpi/ic_action_back.png b/u88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/u88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/u88/src/main/res/drawable-xxhdpi/ic_action_back.png b/u88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/u88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/u88/src/main/res/drawable/ic_launcher_background.xml b/u88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/u88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/u88/src/main/res/drawable/input_bg.xml b/u88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/u88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/u88/src/main/res/drawable/pass_word_bg.xml b/u88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/u88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/u88/src/main/res/drawable/pass_word_bg1.xml b/u88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/u88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable/pass_word_bg2.xml b/u88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/u88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable/shape_btn_bg.xml b/u88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/u88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable/shape_dialog_bg2.xml b/u88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/u88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable/shape_dialog_bg3.xml b/u88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/u88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/drawable/shape_dialog_bg_new.xml b/u88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/u88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/u88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/u88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/u88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/u88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/u88/src/main/res/mipmap-hdpi/ic_empty.png b/u88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/u88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/u88/src/main/res/mipmap-hdpi/ic_pull_down.png b/u88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/u88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/u88/src/main/res/mipmap-xhdpi/ic_close.png b/u88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/u88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/u88/src/main/res/mipmap-xhdpi/ic_menu.png b/u88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/u88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/u88/src/main/res/mipmap-xxhdpi/app_logo.png b/u88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..6ffd609 Binary files /dev/null and b/u88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/u88/src/main/res/values-en/strings.xml b/u88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..072f21a --- /dev/null +++ b/u88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + U88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/u88/src/main/res/values-night/themes.xml b/u88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/u88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/values/colors.xml b/u88/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/u88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/u88/src/main/res/values/strings.xml b/u88/src/main/res/values/strings.xml new file mode 100644 index 0000000..033e2ce --- /dev/null +++ b/u88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + U88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/values/themes.xml b/u88/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/u88/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/xml/app_updater_paths.xml b/u88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/u88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/main/res/xml/network_security_config.xml b/u88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/u88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/u88/src/main/res/xml/provider_paths.xml b/u88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/u88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/u88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/u88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/u88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/u88/u88.jks b/u88/u88.jks new file mode 100644 index 0000000..9ea228d Binary files /dev/null and b/u88/u88.jks differ diff --git a/uwin33/.gitignore b/uwin33/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/uwin33/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/uwin33/build.gradle b/uwin33/build.gradle new file mode 100644 index 0000000..f0cc744 --- /dev/null +++ b/uwin33/build.gradle @@ -0,0 +1,100 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + + defaultConfig { + //72 + applicationId "com.web.uwin33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 105 + versionName "v1.0.5" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { +// debug { +// storeFile file('dskjweb.jks') +// storePassword "dskj2024" +// keyAlias 'dskjalias' +// keyPassword "dskj2024" +// } +// release { +// storeFile file('dskjweb.jks') +// storePassword "dskj2024" +// keyAlias 'dskjalias' +// keyPassword "dskj2024" +// } + + debug { + storeFile file('uwin33.jks') + storePassword "android2014" + keyAlias 'dskjalias' + keyPassword "android2014" + } + release { + storeFile file('uwin33.jks') + storePassword "android2014" + keyAlias 'dskjalias' + keyPassword "android2014" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + //implementation platform('com.google.firebase:firebase-bom:32.7.0') + implementation platform('com.google.firebase:firebase-bom:33.6.0') + // Firebase Cloud Messaging + implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + +// implementation("com.google.firebase:firebase-messaging:23.2.1") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/uwin33/dskjweb.jks b/uwin33/dskjweb.jks new file mode 100644 index 0000000..e69de29 diff --git a/uwin33/google-services.json b/uwin33/google-services.json new file mode 100644 index 0000000..68479ce --- /dev/null +++ b/uwin33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "973174997260", + "project_id": "uwin33-c368e", + "storage_bucket": "uwin33-c368e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:973174997260:android:8e389d9a71b5db0a624929", + "android_client_info": { + "package_name": "com.web.uwin33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDMxztNFW1UOE1mLkMAm8somceNorKpvHQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/uwin33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/uwin33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/uwin33/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/uwin33/proguard-rules.pro b/uwin33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/uwin33/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/uwin33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/uwin33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/uwin33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/uwin33/src/main/AndroidManifest.xml b/uwin33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d4afdb0 --- /dev/null +++ b/uwin33/src/main/AndroidManifest.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/java/com/web/uwin33/MainActivity2.java b/uwin33/src/main/java/com/web/uwin33/MainActivity2.java new file mode 100644 index 0000000..9a9090f --- /dev/null +++ b/uwin33/src/main/java/com/web/uwin33/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.uwin33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 72; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/uwin33/src/main/java/com/web/uwin33/MyFirebaseMessageingService.java b/uwin33/src/main/java/com/web/uwin33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ffc3ee5 --- /dev/null +++ b/uwin33/src/main/java/com/web/uwin33/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.uwin33; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/uwin33/src/main/java/com/web/uwin33/WebApplication.java b/uwin33/src/main/java/com/web/uwin33/WebApplication.java new file mode 100644 index 0000000..f7db20c --- /dev/null +++ b/uwin33/src/main/java/com/web/uwin33/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.uwin33; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/uwin33/src/main/res/drawable-anydpi/ic_action_back.xml b/uwin33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/uwin33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/uwin33/src/main/res/drawable-hdpi/ic_action_back.png b/uwin33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/uwin33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/uwin33/src/main/res/drawable-mdpi/ic_action_back.png b/uwin33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/uwin33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/uwin33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/uwin33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/uwin33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable-xhdpi/ic_action_back.png b/uwin33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/uwin33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/uwin33/src/main/res/drawable-xxhdpi/ic_action_back.png b/uwin33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/uwin33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/uwin33/src/main/res/drawable/ic_launcher_background.xml b/uwin33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/uwin33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uwin33/src/main/res/drawable/input_bg.xml b/uwin33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/uwin33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/uwin33/src/main/res/drawable/pass_word_bg.xml b/uwin33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/uwin33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/uwin33/src/main/res/drawable/pass_word_bg1.xml b/uwin33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/uwin33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable/pass_word_bg2.xml b/uwin33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/uwin33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable/shape_btn_bg.xml b/uwin33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/uwin33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable/shape_dialog_bg2.xml b/uwin33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/uwin33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable/shape_dialog_bg3.xml b/uwin33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/uwin33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/drawable/shape_dialog_bg_new.xml b/uwin33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/uwin33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/uwin33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/mipmap-hdpi/ic_empty.png b/uwin33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/uwin33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/uwin33/src/main/res/mipmap-hdpi/ic_pull_down.png b/uwin33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/uwin33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/uwin33/src/main/res/mipmap-xhdpi/ic_close.png b/uwin33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/uwin33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/uwin33/src/main/res/mipmap-xhdpi/ic_menu.png b/uwin33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/uwin33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/uwin33/src/main/res/mipmap-xxhdpi/app_logo.png b/uwin33/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..18eaea1 Binary files /dev/null and b/uwin33/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/uwin33/src/main/res/values-en/strings.xml b/uwin33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..874c6f7 --- /dev/null +++ b/uwin33/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + UWIN33 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/uwin33/src/main/res/values-night/themes.xml b/uwin33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/uwin33/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/values/colors.xml b/uwin33/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/uwin33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/uwin33/src/main/res/values/strings.xml b/uwin33/src/main/res/values/strings.xml new file mode 100644 index 0000000..3ff667e --- /dev/null +++ b/uwin33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + UWIN33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/values/themes.xml b/uwin33/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/uwin33/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/xml/app_updater_paths.xml b/uwin33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/uwin33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/xml/network_security_config.xml b/uwin33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/uwin33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/uwin33/src/main/res/xml/provider_paths.xml b/uwin33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/uwin33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/uwin33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/uwin33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/uwin33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/uwin33/uwin33.jks b/uwin33/uwin33.jks new file mode 100644 index 0000000..e69de29 diff --git a/vv88/.gitignore b/vv88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/vv88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/vv88/build.gradle b/vv88/build.gradle new file mode 100644 index 0000000..cae3686 --- /dev/null +++ b/vv88/build.gradle @@ -0,0 +1,99 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + + defaultConfig { + //73 + applicationId "com.web.vv88aud" + minSdkVersion 24 + targetSdkVersion 31 + versionCode 105 + versionName "v1.0.5" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { +// debug { +// storeFile file('vv88aud.jks') +// storePassword "dskj2024" +// keyAlias 'key0' +// keyPassword "dskj2024" +// } +// release { +// storeFile file('vv88aud.jks') +// storePassword "dskj2024" +// keyAlias 'key0' +// keyPassword "dskj2024" +// } + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 + implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + // implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:24.0.3") +// implementation("com.google.firebase:firebase-analytics:21.2.1") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + implementation("com.github.bumptech.glide:glide:4.13.1") + implementation project(path: ':base') + +} \ No newline at end of file diff --git a/vv88/dskjweb.jks b/vv88/dskjweb.jks new file mode 100644 index 0000000..e69de29 diff --git a/vv88/google-services.json b/vv88/google-services.json new file mode 100644 index 0000000..53e7414 --- /dev/null +++ b/vv88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "55353180898", + "project_id": "vv88aud-b1ee6", + "storage_bucket": "vv88aud-b1ee6.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:55353180898:android:984d917b0e1a92978494bb", + "android_client_info": { + "package_name": "com.web.vv88aud" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyChV4X7O1XgtTvXFTIVqP6gtF7uM9__N9Q" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/vv88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/vv88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/vv88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/vv88/proguard-rules.pro b/vv88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/vv88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/vv88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/vv88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/vv88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/vv88/src/main/AndroidManifest.xml b/vv88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2badaf0 --- /dev/null +++ b/vv88/src/main/AndroidManifest.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/java/com/web/vv88aud/MainActivity2.java b/vv88/src/main/java/com/web/vv88aud/MainActivity2.java new file mode 100644 index 0000000..3fa4dd8 --- /dev/null +++ b/vv88/src/main/java/com/web/vv88aud/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.vv88aud; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity2 extends com.web.base.MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 73; + saveInt(MainActivity2.this,"user_code",userId); + saveInt(MainActivity2.this,"version_code",getVersion()); + super.onCreate(savedInstanceState); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + String StringversionName = packageInfo.versionName; // 版本号 + int versionCode = packageInfo.versionCode; // 版本码 + // 在这里可以使用versionName和versionCode进行相关的操作 +// Log.d("VersionInfo", "VersionName: " + versionName + ", VersionCode: " + versionCode); + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + + } + +} diff --git a/vv88/src/main/java/com/web/vv88aud/MyFirebaseMessageingService.java b/vv88/src/main/java/com/web/vv88aud/MyFirebaseMessageingService.java new file mode 100644 index 0000000..c949e0d --- /dev/null +++ b/vv88/src/main/java/com/web/vv88aud/MyFirebaseMessageingService.java @@ -0,0 +1,172 @@ +package com.web.vv88aud; + +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; +import com.google.gson.Gson; +import com.web.base.GsonUtils; +import com.web.base.MainActivity2; +import com.web.base.MessageInfo; + +import java.util.Map; +import java.util.Random; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + notifyIntent.putExtra("message", messageInfo); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + +// Intent notifyIntent = new Intent(this, MainActivity2.class); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); +// // notifyIntent.putExtra("message", messageInfo); +// notifyIntent.setAction(Intent.ACTION_VIEW); +// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 +// PendingIntent pendingIntent; +// pendingIntent = PendingIntent.getActivity +// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { + ComponentName launchComponent = null; + launchComponent = getApplication() + .getPackageManager() + .getLaunchIntentForPackage(getApplication().getPackageName()) + .getComponent(); + notifyIntent.setComponent(launchComponent); + } + notifyIntent.putExtra("message", body); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); + notifyIntent.setAction(Intent.ACTION_VIEW); + notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 + + + PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) + .setSmallIcon(com.web.base.R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + //存储数据 + // saveNotifyMessage(body); + } + + +// public void saveNotifyMessage(String body) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); +// if(messageInfo!=null){ +// if(TextUtils.isEmpty(savenotify)){ +// GsonUtils.getListFromJSON(savenotify,) +// } +// } +// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); +// } +// +// /** +// * @param key 要设置的key +// */ +// public static void set(Context activity, String key, String is) { +// SharedPreferences nameSetting = getConfigShared(activity); +// SharedPreferences.Editor namePref = nameSetting.edit(); +// namePref.putString(key, is); +// namePref.commit(); +// } +} diff --git a/vv88/src/main/java/com/web/vv88aud/WebApplication.java b/vv88/src/main/java/com/web/vv88aud/WebApplication.java new file mode 100644 index 0000000..67f9eee --- /dev/null +++ b/vv88/src/main/java/com/web/vv88aud/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.vv88aud; + +import android.app.Application; +import android.content.Context; + +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + HashMap map = new HashMap(); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); + map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true); + QbSdk.initTbsSettings(map); + QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() { + @Override + public void onCoreInitFinished() { + + } + + @Override + public void onViewInitFinished(boolean b) { + + } + }); + QbSdk.setDownloadWithoutWifi(true); + } +} diff --git a/vv88/src/main/res/drawable-anydpi/ic_action_back.xml b/vv88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/vv88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/vv88/src/main/res/drawable-hdpi/ic_action_back.png b/vv88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/vv88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/vv88/src/main/res/drawable-mdpi/ic_action_back.png b/vv88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/vv88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/vv88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/vv88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/vv88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable-xhdpi/ic_action_back.png b/vv88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/vv88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/vv88/src/main/res/drawable-xxhdpi/ic_action_back.png b/vv88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/vv88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/vv88/src/main/res/drawable/ic_launcher_background.xml b/vv88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/vv88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vv88/src/main/res/drawable/input_bg.xml b/vv88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/vv88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/vv88/src/main/res/drawable/pass_word_bg.xml b/vv88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/vv88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/vv88/src/main/res/drawable/pass_word_bg1.xml b/vv88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/vv88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable/pass_word_bg2.xml b/vv88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/vv88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable/shape_btn_bg.xml b/vv88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/vv88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable/shape_dialog_bg2.xml b/vv88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/vv88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable/shape_dialog_bg3.xml b/vv88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/vv88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/drawable/shape_dialog_bg_new.xml b/vv88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/vv88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/vv88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/mipmap-hdpi/ic_empty.png b/vv88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/vv88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/vv88/src/main/res/mipmap-hdpi/ic_pull_down.png b/vv88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/vv88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_close.png b/vv88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_facebook.png b/vv88/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_hometo.png b/vv88/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_link.png b/vv88/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_menu.png b/vv88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_shousuo.png b/vv88/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_tel.png b/vv88/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/vv88/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/vv88/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/vv88/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/vv88/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/vv88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/vv88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..6fcbd8b Binary files /dev/null and b/vv88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/vv88/src/main/res/values-en/strings.xml b/vv88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..3fc530e --- /dev/null +++ b/vv88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + VV88 + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + \ No newline at end of file diff --git a/vv88/src/main/res/values-night/themes.xml b/vv88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/vv88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/values/colors.xml b/vv88/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/vv88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/vv88/src/main/res/values/strings.xml b/vv88/src/main/res/values/strings.xml new file mode 100644 index 0000000..db61bb1 --- /dev/null +++ b/vv88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + VV88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/values/themes.xml b/vv88/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/vv88/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/xml/app_updater_paths.xml b/vv88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/vv88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/main/res/xml/network_security_config.xml b/vv88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/vv88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/vv88/src/main/res/xml/provider_paths.xml b/vv88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/vv88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/vv88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/vv88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/vv88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/vv88/vv88aud.jks b/vv88/vv88aud.jks new file mode 100644 index 0000000..e69de29