diff --git a/boda8/release/boda8au.apk b/boda8/release/boda8au.apk new file mode 100644 index 0000000..74fc287 Binary files /dev/null and b/boda8/release/boda8au.apk differ diff --git a/bp99/.gitignore b/bp99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bp99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bp99/build.gradle b/bp99/build.gradle new file mode 100644 index 0000000..b736643 --- /dev/null +++ b/bp99/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.bp99" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + release { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + applicationVariants.all { variant -> + variant.outputs.all { + def appName = "bp99" + def outputDir = new File(rootProject.ext.outputPath) + // 创建输出目录 + outputDir.mkdirs() + def outputFileName = "${appName}.apk" + // 设置输出文件名 + setOutputFileName(outputFileName) + // 计算新的输出文件 + def newOutputFile = new File(outputDir, outputFileName) + // 如果新的输出目录不存在,则创建它 + newOutputFile.parentFile.mkdirs() + // 在构建完成后将 APK 复制到新位置 + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + println "Success to copy APK !!!" + } catch (java.io.IOException e) { + println "Failed to copy APK: ${e.message}" + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/bp99/google-services.json b/bp99/google-services.json new file mode 100644 index 0000000..6835332 --- /dev/null +++ b/bp99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "807980746813", + "project_id": "bp99s-2629e", + "storage_bucket": "bp99s-2629e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:807980746813:android:176fd233f220b9cb214254", + "android_client_info": { + "package_name": "com.web.bp99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDakmPELYjATEFKB3Tg-GyfTq8UhKG1qIM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bp99/ppn.jks b/bp99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bp99/ppn.jks differ diff --git a/bp99/proguard-rules.pro b/bp99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bp99/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/bp99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bp99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bp99/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/bp99/src/main/AndroidManifest.xml b/bp99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..71916df --- /dev/null +++ b/bp99/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/java/com/web/bp99/MainActivity.java b/bp99/src/main/java/com/web/bp99/MainActivity.java new file mode 100644 index 0000000..ade4185 --- /dev/null +++ b/bp99/src/main/java/com/web/bp99/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.bp99; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 130; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://yiwan5544.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#eb3424"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#f1f1f1"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + int versionCode = packageInfo.versionCode; // 版本码 + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + } +} diff --git a/bp99/src/main/java/com/web/bp99/MyFirebaseMessageingService.java b/bp99/src/main/java/com/web/bp99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d2c7a7f --- /dev/null +++ b/bp99/src/main/java/com/web/bp99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bp99; + +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); + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity.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); + 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(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(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, MainActivity.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(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(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/bp99/src/main/java/com/web/bp99/WebApplication.java b/bp99/src/main/java/com/web/bp99/WebApplication.java new file mode 100644 index 0000000..cb08be8 --- /dev/null +++ b/bp99/src/main/java/com/web/bp99/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.bp99; + +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/bp99/src/main/res/drawable-anydpi/ic_action_back.xml b/bp99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bp99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bp99/src/main/res/drawable-hdpi/ic_action_back.png b/bp99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bp99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bp99/src/main/res/drawable-mdpi/ic_action_back.png b/bp99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bp99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bp99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bp99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bp99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable-xhdpi/ic_action_back.png b/bp99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bp99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bp99/src/main/res/drawable-xxhdpi/ic_action_back.png b/bp99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bp99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/bp99/src/main/res/drawable/big_bg.xml b/bp99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..569db04 --- /dev/null +++ b/bp99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/ic_launcher_background.xml b/bp99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bp99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bp99/src/main/res/drawable/input_bg.xml b/bp99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bp99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bp99/src/main/res/drawable/pass_word_bg.xml b/bp99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bp99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bp99/src/main/res/drawable/pass_word_bg1.xml b/bp99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bp99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/pass_word_bg2.xml b/bp99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bp99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/shape_btn_bg.xml b/bp99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bp99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/shape_dialog_bg2.xml b/bp99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bp99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/shape_dialog_bg3.xml b/bp99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bp99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/drawable/shape_dialog_bg_new.xml b/bp99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bp99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bp99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/mipmap-hdpi/ic_empty.png b/bp99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bp99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bp99/src/main/res/mipmap-hdpi/ic_pull_down.png b/bp99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bp99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bp99/src/main/res/mipmap-xhdpi/ic_close.png b/bp99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bp99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bp99/src/main/res/mipmap-xhdpi/ic_menu.png b/bp99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bp99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bp99/src/main/res/mipmap-xxhdpi/app_logo.png b/bp99/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..8e94023 Binary files /dev/null and b/bp99/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bp99/src/main/res/values-en/strings.xml b/bp99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..df2df76 --- /dev/null +++ b/bp99/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + BP99 + 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/bp99/src/main/res/values-night/themes.xml b/bp99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/bp99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/values/colors.xml b/bp99/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/bp99/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/bp99/src/main/res/values/strings.xml b/bp99/src/main/res/values/strings.xml new file mode 100644 index 0000000..42e833c --- /dev/null +++ b/bp99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BP99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/values/themes.xml b/bp99/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/bp99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/xml/app_updater_paths.xml b/bp99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bp99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/main/res/xml/network_security_config.xml b/bp99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bp99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bp99/src/main/res/xml/provider_paths.xml b/bp99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bp99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bp99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bp99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bp99/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/happyaud668/.gitignore b/happyaud668/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/happyaud668/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/happyaud668/build.gradle b/happyaud668/build.gradle new file mode 100644 index 0000000..6d3814a --- /dev/null +++ b/happyaud668/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.happyaud668" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + release { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + applicationVariants.all { variant -> + variant.outputs.all { + def appName = "happyaud668" + def outputDir = new File(rootProject.ext.outputPath) + // 创建输出目录 + outputDir.mkdirs() + def outputFileName = "${appName}.apk" + // 设置输出文件名 + setOutputFileName(outputFileName) + // 计算新的输出文件 + def newOutputFile = new File(outputDir, outputFileName) + // 如果新的输出目录不存在,则创建它 + newOutputFile.parentFile.mkdirs() + // 在构建完成后将 APK 复制到新位置 + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + println "Success to copy APK !!!" + } catch (java.io.IOException e) { + println "Failed to copy APK: ${e.message}" + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/happyaud668/google-services.json b/happyaud668/google-services.json new file mode 100644 index 0000000..d379490 --- /dev/null +++ b/happyaud668/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "245565330972", + "project_id": "happyaud-2cd16", + "storage_bucket": "happyaud-2cd16.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:245565330972:android:f7e7c1b898f22ee9a671d9", + "android_client_info": { + "package_name": "com.web.happyaud668" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDNc91kDNaSCNHImaw-wb4OS58LjpzzNZ8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/happyaud668/ppn.jks b/happyaud668/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/happyaud668/ppn.jks differ diff --git a/happyaud668/proguard-rules.pro b/happyaud668/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/happyaud668/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/happyaud668/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/happyaud668/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/happyaud668/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/happyaud668/src/main/AndroidManifest.xml b/happyaud668/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f9fa9df --- /dev/null +++ b/happyaud668/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/java/com/web/happyaud668/MainActivity.java b/happyaud668/src/main/java/com/web/happyaud668/MainActivity.java new file mode 100644 index 0000000..b4c5deb --- /dev/null +++ b/happyaud668/src/main/java/com/web/happyaud668/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.happyaud668; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 131; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://happyaud668.biz/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#030203"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#081922"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + int versionCode = packageInfo.versionCode; // 版本码 + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + } +} diff --git a/happyaud668/src/main/java/com/web/happyaud668/MyFirebaseMessageingService.java b/happyaud668/src/main/java/com/web/happyaud668/MyFirebaseMessageingService.java new file mode 100644 index 0000000..87f0998 --- /dev/null +++ b/happyaud668/src/main/java/com/web/happyaud668/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.happyaud668; + +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); + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity.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); + 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(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(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, MainActivity.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(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(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/happyaud668/src/main/java/com/web/happyaud668/WebApplication.java b/happyaud668/src/main/java/com/web/happyaud668/WebApplication.java new file mode 100644 index 0000000..1e187f1 --- /dev/null +++ b/happyaud668/src/main/java/com/web/happyaud668/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.happyaud668; + +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/happyaud668/src/main/res/drawable-anydpi/ic_action_back.xml b/happyaud668/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/happyaud668/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/happyaud668/src/main/res/drawable-hdpi/ic_action_back.png b/happyaud668/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/happyaud668/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/happyaud668/src/main/res/drawable-mdpi/ic_action_back.png b/happyaud668/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/happyaud668/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/happyaud668/src/main/res/drawable-v24/ic_launcher_foreground.xml b/happyaud668/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/happyaud668/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable-xhdpi/ic_action_back.png b/happyaud668/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/happyaud668/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/happyaud668/src/main/res/drawable-xxhdpi/ic_action_back.png b/happyaud668/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/happyaud668/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/happyaud668/src/main/res/drawable/big_bg.xml b/happyaud668/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2ab7b15 --- /dev/null +++ b/happyaud668/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/ic_launcher_background.xml b/happyaud668/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/happyaud668/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/happyaud668/src/main/res/drawable/input_bg.xml b/happyaud668/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/happyaud668/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/happyaud668/src/main/res/drawable/pass_word_bg.xml b/happyaud668/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/happyaud668/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/happyaud668/src/main/res/drawable/pass_word_bg1.xml b/happyaud668/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/happyaud668/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/pass_word_bg2.xml b/happyaud668/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/happyaud668/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/shape_btn_bg.xml b/happyaud668/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/happyaud668/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/shape_dialog_bg2.xml b/happyaud668/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/happyaud668/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/shape_dialog_bg3.xml b/happyaud668/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/happyaud668/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/drawable/shape_dialog_bg_new.xml b/happyaud668/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/happyaud668/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/happyaud668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/mipmap-hdpi/ic_empty.png b/happyaud668/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/happyaud668/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/happyaud668/src/main/res/mipmap-hdpi/ic_pull_down.png b/happyaud668/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/happyaud668/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/happyaud668/src/main/res/mipmap-xhdpi/ic_close.png b/happyaud668/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/happyaud668/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/happyaud668/src/main/res/mipmap-xhdpi/ic_menu.png b/happyaud668/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/happyaud668/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/happyaud668/src/main/res/mipmap-xxhdpi/app_logo.jpg b/happyaud668/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..ebf2401 Binary files /dev/null and b/happyaud668/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/happyaud668/src/main/res/values-en/strings.xml b/happyaud668/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..98a3de1 --- /dev/null +++ b/happyaud668/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + HAPPYAUD668 + 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/happyaud668/src/main/res/values-night/themes.xml b/happyaud668/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/happyaud668/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/values/colors.xml b/happyaud668/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/happyaud668/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/happyaud668/src/main/res/values/strings.xml b/happyaud668/src/main/res/values/strings.xml new file mode 100644 index 0000000..337c552 --- /dev/null +++ b/happyaud668/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + HAPPYAUD668 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/values/themes.xml b/happyaud668/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/happyaud668/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/xml/app_updater_paths.xml b/happyaud668/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/happyaud668/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/xml/network_security_config.xml b/happyaud668/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/happyaud668/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/happyaud668/src/main/res/xml/provider_paths.xml b/happyaud668/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/happyaud668/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/happyaud668/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/happyaud668/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/happyaud668/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/mudahking/.gitignore b/mudahking/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/mudahking/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/mudahking/build.gradle b/mudahking/build.gradle new file mode 100644 index 0000000..0c4ddac --- /dev/null +++ b/mudahking/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.mudahking" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + release { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + applicationVariants.all { variant -> + variant.outputs.all { + def appName = "mudahking" + def outputDir = new File(rootProject.ext.outputPath) + // 创建输出目录 + outputDir.mkdirs() + def outputFileName = "${appName}.apk" + // 设置输出文件名 + setOutputFileName(outputFileName) + // 计算新的输出文件 + def newOutputFile = new File(outputDir, outputFileName) + // 如果新的输出目录不存在,则创建它 + newOutputFile.parentFile.mkdirs() + // 在构建完成后将 APK 复制到新位置 + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + println "Success to copy APK !!!" + } catch (java.io.IOException e) { + println "Failed to copy APK: ${e.message}" + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/mudahking/google-services.json b/mudahking/google-services.json new file mode 100644 index 0000000..a10f03b --- /dev/null +++ b/mudahking/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "627478897427", + "project_id": "mudahking", + "storage_bucket": "mudahking.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:627478897427:android:275b0b68c9f10af79470e6", + "android_client_info": { + "package_name": "com.web.mudahking" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBDjgRYnsZF-IDttgwyDR1iCc2ZWbtbuxk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mudahking/ppn.jks b/mudahking/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/mudahking/ppn.jks differ diff --git a/mudahking/proguard-rules.pro b/mudahking/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mudahking/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/mudahking/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/mudahking/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/mudahking/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/mudahking/src/main/AndroidManifest.xml b/mudahking/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b0ef617 --- /dev/null +++ b/mudahking/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/java/com/web/mudahking/MainActivity.java b/mudahking/src/main/java/com/web/mudahking/MainActivity.java new file mode 100644 index 0000000..4f9cac1 --- /dev/null +++ b/mudahking/src/main/java/com/web/mudahking/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.mudahking; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 129; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://mudahking.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fefeff"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fefeff"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + int versionCode = packageInfo.versionCode; // 版本码 + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + } +} diff --git a/mudahking/src/main/java/com/web/mudahking/MyFirebaseMessageingService.java b/mudahking/src/main/java/com/web/mudahking/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5e808c9 --- /dev/null +++ b/mudahking/src/main/java/com/web/mudahking/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.mudahking; + +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); + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity.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); + 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(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(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, MainActivity.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(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(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/mudahking/src/main/java/com/web/mudahking/WebApplication.java b/mudahking/src/main/java/com/web/mudahking/WebApplication.java new file mode 100644 index 0000000..06637a8 --- /dev/null +++ b/mudahking/src/main/java/com/web/mudahking/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.mudahking; + +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/mudahking/src/main/res/drawable-anydpi/ic_action_back.xml b/mudahking/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/mudahking/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/mudahking/src/main/res/drawable-hdpi/ic_action_back.png b/mudahking/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/mudahking/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/mudahking/src/main/res/drawable-mdpi/ic_action_back.png b/mudahking/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/mudahking/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/mudahking/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mudahking/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mudahking/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable-xhdpi/ic_action_back.png b/mudahking/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/mudahking/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/mudahking/src/main/res/drawable-xxhdpi/ic_action_back.png b/mudahking/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/mudahking/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/mudahking/src/main/res/drawable/big_bg.xml b/mudahking/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..0d002c5 --- /dev/null +++ b/mudahking/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/ic_launcher_background.xml b/mudahking/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mudahking/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mudahking/src/main/res/drawable/input_bg.xml b/mudahking/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/mudahking/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/mudahking/src/main/res/drawable/pass_word_bg.xml b/mudahking/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/mudahking/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/mudahking/src/main/res/drawable/pass_word_bg1.xml b/mudahking/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/mudahking/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/pass_word_bg2.xml b/mudahking/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/mudahking/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/shape_btn_bg.xml b/mudahking/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/mudahking/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/shape_dialog_bg2.xml b/mudahking/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/mudahking/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/shape_dialog_bg3.xml b/mudahking/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/mudahking/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/drawable/shape_dialog_bg_new.xml b/mudahking/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/mudahking/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mudahking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/mipmap-hdpi/ic_empty.png b/mudahking/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/mudahking/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/mudahking/src/main/res/mipmap-hdpi/ic_pull_down.png b/mudahking/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/mudahking/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/mudahking/src/main/res/mipmap-xhdpi/ic_close.png b/mudahking/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/mudahking/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/mudahking/src/main/res/mipmap-xhdpi/ic_menu.png b/mudahking/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/mudahking/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/mudahking/src/main/res/mipmap-xxhdpi/app_logo.jpg b/mudahking/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..b37f5e1 Binary files /dev/null and b/mudahking/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/mudahking/src/main/res/values-en/strings.xml b/mudahking/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..e00cf40 --- /dev/null +++ b/mudahking/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + MudahKing + 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/mudahking/src/main/res/values-night/themes.xml b/mudahking/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/mudahking/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/values/colors.xml b/mudahking/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/mudahking/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/mudahking/src/main/res/values/strings.xml b/mudahking/src/main/res/values/strings.xml new file mode 100644 index 0000000..8f6c64b --- /dev/null +++ b/mudahking/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MudahKing + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/values/themes.xml b/mudahking/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/mudahking/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/xml/app_updater_paths.xml b/mudahking/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mudahking/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/xml/network_security_config.xml b/mudahking/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mudahking/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mudahking/src/main/res/xml/provider_paths.xml b/mudahking/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mudahking/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mudahking/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/mudahking/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/mudahking/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 index 1d4e87d..0012b04 100644 --- a/settings.gradle +++ b/settings.gradle @@ -49,4 +49,8 @@ include ':emu668' include ':dapatcuci' include ':ufo9' include ':dn99' -include ':FreeAUD' \ No newline at end of file +include ':FreeAUD' +include ':mudahking' +include ':bp99' +include ':happyaud668' +include ':sking668' \ No newline at end of file diff --git a/sking668/.gitignore b/sking668/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sking668/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sking668/build.gradle b/sking668/build.gradle new file mode 100644 index 0000000..3978f2b --- /dev/null +++ b/sking668/build.gradle @@ -0,0 +1,78 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.sking668" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + release { + storeFile file('ppn.jks') + storePassword "2014123456" + keyAlias 'key0' + keyPassword "2014123456" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + applicationVariants.all { variant -> + variant.outputs.all { + def appName = "sking668" + def outputDir = new File(rootProject.ext.outputPath) + // 创建输出目录 + outputDir.mkdirs() + def outputFileName = "${appName}.apk" + // 设置输出文件名 + setOutputFileName(outputFileName) + // 计算新的输出文件 + def newOutputFile = new File(outputDir, outputFileName) + // 如果新的输出目录不存在,则创建它 + newOutputFile.parentFile.mkdirs() + // 在构建完成后将 APK 复制到新位置 + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + println "Success to copy APK !!!" + } catch (java.io.IOException e) { + println "Failed to copy APK: ${e.message}" + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/sking668/google-services.json b/sking668/google-services.json new file mode 100644 index 0000000..51672f9 --- /dev/null +++ b/sking668/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "563249922677", + "project_id": "sking668", + "storage_bucket": "sking668.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:563249922677:android:4f1a9cf79d82cea8f32e3c", + "android_client_info": { + "package_name": "com.web.sking668" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDAJ4p-dLJYr5oGFiLvopwQC5h5M716zk4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sking668/ppn.jks b/sking668/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sking668/ppn.jks differ diff --git a/sking668/proguard-rules.pro b/sking668/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sking668/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/sking668/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sking668/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sking668/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/sking668/src/main/AndroidManifest.xml b/sking668/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d0d9811 --- /dev/null +++ b/sking668/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/java/com/web/sking668/MainActivity.java b/sking668/src/main/java/com/web/sking668/MainActivity.java new file mode 100644 index 0000000..82e2f8e --- /dev/null +++ b/sking668/src/main/java/com/web/sking668/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.sking668; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 132; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sking668.online/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#e9e9e9"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#FFFFFF"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); + } + + public int getVersion(){ + try { + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + int versionCode = packageInfo.versionCode; // 版本码 + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + } +} diff --git a/sking668/src/main/java/com/web/sking668/MyFirebaseMessageingService.java b/sking668/src/main/java/com/web/sking668/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5fd5597 --- /dev/null +++ b/sking668/src/main/java/com/web/sking668/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sking668; + +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); + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity.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); + 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(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(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, MainActivity.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(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(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/sking668/src/main/java/com/web/sking668/WebApplication.java b/sking668/src/main/java/com/web/sking668/WebApplication.java new file mode 100644 index 0000000..a5dd9e1 --- /dev/null +++ b/sking668/src/main/java/com/web/sking668/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sking668; + +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/sking668/src/main/res/drawable-anydpi/ic_action_back.xml b/sking668/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sking668/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sking668/src/main/res/drawable-hdpi/ic_action_back.png b/sking668/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sking668/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sking668/src/main/res/drawable-mdpi/ic_action_back.png b/sking668/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sking668/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sking668/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sking668/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sking668/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable-xhdpi/ic_action_back.png b/sking668/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sking668/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sking668/src/main/res/drawable-xxhdpi/ic_action_back.png b/sking668/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sking668/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sking668/src/main/res/drawable/big_bg.xml b/sking668/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/sking668/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/ic_launcher_background.xml b/sking668/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sking668/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sking668/src/main/res/drawable/input_bg.xml b/sking668/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sking668/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sking668/src/main/res/drawable/pass_word_bg.xml b/sking668/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sking668/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sking668/src/main/res/drawable/pass_word_bg1.xml b/sking668/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sking668/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/pass_word_bg2.xml b/sking668/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sking668/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/shape_btn_bg.xml b/sking668/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sking668/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/shape_dialog_bg2.xml b/sking668/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sking668/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/shape_dialog_bg3.xml b/sking668/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sking668/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/drawable/shape_dialog_bg_new.xml b/sking668/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sking668/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sking668/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/mipmap-hdpi/ic_empty.png b/sking668/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sking668/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sking668/src/main/res/mipmap-hdpi/ic_pull_down.png b/sking668/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sking668/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sking668/src/main/res/mipmap-xhdpi/ic_close.png b/sking668/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sking668/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sking668/src/main/res/mipmap-xhdpi/ic_menu.png b/sking668/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sking668/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sking668/src/main/res/mipmap-xxhdpi/app_logo.jpg b/sking668/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..b381e14 Binary files /dev/null and b/sking668/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/sking668/src/main/res/values-en/strings.xml b/sking668/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..6da9f05 --- /dev/null +++ b/sking668/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + SKING668 + 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/sking668/src/main/res/values-night/themes.xml b/sking668/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/sking668/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/values/colors.xml b/sking668/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/sking668/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/sking668/src/main/res/values/strings.xml b/sking668/src/main/res/values/strings.xml new file mode 100644 index 0000000..bcfc62c --- /dev/null +++ b/sking668/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SKING668 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/values/themes.xml b/sking668/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/sking668/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/xml/app_updater_paths.xml b/sking668/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sking668/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/main/res/xml/network_security_config.xml b/sking668/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sking668/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sking668/src/main/res/xml/provider_paths.xml b/sking668/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sking668/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sking668/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sking668/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sking668/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/release/output-metadata.json b/toto88new/release/output-metadata.json new file mode 100644 index 0000000..351b7e7 --- /dev/null +++ b/toto88new/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.tt88", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 112, + "versionName": "v1.1.2", + "outputFile": "toto88.apk" + } + ] +} \ No newline at end of file diff --git a/toto88new/release/toto88.apk b/toto88new/release/toto88.apk new file mode 100644 index 0000000..abe3e73 Binary files /dev/null and b/toto88new/release/toto88.apk differ diff --git a/toto88new/src/main/java/com/web/tt88/MainActivity2.java b/toto88new/src/main/java/com/web/tt88/MainActivity2.java new file mode 100644 index 0000000..0772a24 --- /dev/null +++ b/toto88new/src/main/java/com/web/tt88/MainActivity2.java @@ -0,0 +1,51 @@ +package com.web.tt88; + + +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/toto88.jks b/toto88new/toto88.jks new file mode 100644 index 0000000..28889f2 Binary files /dev/null and b/toto88new/toto88.jks differ diff --git a/ttslot888new/build.gradle b/ttslot888new/build.gradle index 502d08f..d1c41c6 100644 --- a/ttslot888new/build.gradle +++ b/ttslot888new/build.gradle @@ -10,11 +10,11 @@ android { defaultConfig { //102 - applicationId "com.web.ttslot" + applicationId "com.web.slottt" minSdkVersion 24 targetSdkVersion 31 - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName + versionCode 113 + versionName "1.1.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/ttslot888new/google-services.json b/ttslot888new/google-services.json index f708527..e975681 100644 --- a/ttslot888new/google-services.json +++ b/ttslot888new/google-services.json @@ -7,47 +7,9 @@ "client": [ { "client_info": { - "mobilesdk_app_id": "1:1098406701837:android:b572337dad631768355e44", + "mobilesdk_app_id": "1:1098406701837:android:c90e9b7b4d15bf84355e44", "android_client_info": { - "package_name": "com.web.ttslot" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyBIeR89kn0Q-5TN7yyCQnUehnQYmmVpEqk" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:1098406701837:android:bcb6a76a6acfafb1355e44", - "android_client_info": { - "package_name": "com.web.ttslot888" - } - }, - "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.ttslot888new" + "package_name": "com.web.slottt" } }, "oauth_client": [], diff --git a/ttslot888new/src/main/AndroidManifest.xml b/ttslot888new/src/main/AndroidManifest.xml index 7722ea0..2c36db4 100644 --- a/ttslot888new/src/main/AndroidManifest.xml +++ b/ttslot888new/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.web.slottt"> 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/slottt/WebApplication.java b/ttslot888new/src/main/java/com/web/slottt/WebApplication.java new file mode 100644 index 0000000..ed79d58 --- /dev/null +++ b/ttslot888new/src/main/java/com/web/slottt/WebApplication.java @@ -0,0 +1,37 @@ +package com.web.slottt; + +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); + } +}