diff --git a/2U8OB/.gitignore b/2U8OB/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/2U8OB/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/2U8OB/build.gradle b/2U8OB/build.gradle new file mode 100644 index 0000000..ebb3d2b --- /dev/null +++ b/2U8OB/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "xofun88" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.xizhcozzc.xoxau" + + //app大背景色 + resValue('color', 'windows_color', '#1A1A1A') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#1A1A1A') + //app 名字 + resValue('string', 'app_name', 'XOFUN88') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "274" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "false" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/2U8OB/google-services.json b/2U8OB/google-services.json new file mode 100644 index 0000000..921af0d --- /dev/null +++ b/2U8OB/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "531093842148", + "project_id": "xoxau-73987", + "storage_bucket": "xoxau-73987.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:531093842148:android:900f21468e3a0b3cd0a4f1", + "android_client_info": { + "package_name": "com.xizhcozzc.xoxau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC-hKTovaVgvbDbnwcHt-IOvXU2goYVjrk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/2U8OB/justlet.jks b/2U8OB/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/2U8OB/justlet.jks differ diff --git a/2U8OB/proguard-rules.pro b/2U8OB/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/2U8OB/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/2U8OB/src/main/AndroidManifest.xml b/2U8OB/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/2U8OB/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2U8OB/src/main/java/com/webclip/base/IndexActivity.java b/2U8OB/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/2U8OB/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/2U8OB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/2U8OB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/2U8OB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/2U8OB/src/main/java/com/webclip/base/WebApplication.java b/2U8OB/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/2U8OB/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/2U8OB/src/main/res/drawable/big_bg.xml b/2U8OB/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/2U8OB/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/2U8OB/src/main/res/mipmap-xxhdpi/app_logo.jpg b/2U8OB/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..899585d Binary files /dev/null and b/2U8OB/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/2U8OB/src/main/res/values/themes.xml b/2U8OB/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/2U8OB/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2U8OB/src/main/res/xml/app_updater_paths.xml b/2U8OB/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/2U8OB/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/2U8OB/src/main/res/xml/network_security_config.xml b/2U8OB/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/2U8OB/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/2U8OB/src/main/res/xml/provider_paths.xml b/2U8OB/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/2U8OB/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/2U8OB/telur33.jks b/2U8OB/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/2U8OB/telur33.jks differ 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..ebb3d2b --- /dev/null +++ b/2UOB/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "xofun88" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.xizhcozzc.xoxau" + + //app大背景色 + resValue('color', 'windows_color', '#1A1A1A') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#1A1A1A') + //app 名字 + resValue('string', 'app_name', 'XOFUN88') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "274" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "false" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/2UOB/google-services.json b/2UOB/google-services.json new file mode 100644 index 0000000..921af0d --- /dev/null +++ b/2UOB/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "531093842148", + "project_id": "xoxau-73987", + "storage_bucket": "xoxau-73987.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:531093842148:android:900f21468e3a0b3cd0a4f1", + "android_client_info": { + "package_name": "com.xizhcozzc.xoxau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC-hKTovaVgvbDbnwcHt-IOvXU2goYVjrk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/2UOB/justlet.jks b/2UOB/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/2UOB/justlet.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/main/AndroidManifest.xml b/2UOB/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/2UOB/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/2UOB/src/main/java/com/webclip/base/IndexActivity.java b/2UOB/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/2UOB/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/2UOB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/2UOB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/2UOB/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/2UOB/src/main/java/com/webclip/base/WebApplication.java b/2UOB/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/2UOB/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} 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..aa44959 --- /dev/null +++ b/2UOB/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file 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..dda8564 Binary files /dev/null and b/2UOB/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/2UOB/src/main/res/values/themes.xml b/2UOB/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/2UOB/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/telur33.jks b/2UOB/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/2UOB/telur33.jks differ diff --git a/88Malaysia/.gitignore b/88Malaysia/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/88Malaysia/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/88Malaysia/build.gradle b/88Malaysia/build.gradle new file mode 100644 index 0000000..b83a025 --- /dev/null +++ b/88Malaysia/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "aipokies" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.jagjsdba.aipokies" + + //app大背景色 + resValue('color', 'windows_color', '#240439') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#240439') + //app 名字 + resValue('string', 'app_name', 'AIPOKIES') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "286" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "false" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/88Malaysia/google-services.json b/88Malaysia/google-services.json new file mode 100644 index 0000000..44d8f3b --- /dev/null +++ b/88Malaysia/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "660521947502", + "project_id": "aipokies", + "storage_bucket": "aipokies.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:660521947502:android:a1db845a2ead75ae4af17f", + "android_client_info": { + "package_name": "com.jagjsdba.aipokies" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCgetr6A38NRm6_mnrv4Dvs616w_z79W9I" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/88Malaysia/justlet.jks b/88Malaysia/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/88Malaysia/justlet.jks differ diff --git a/88Malaysia/proguard-rules.pro b/88Malaysia/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/88Malaysia/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/88Malaysia/src/main/AndroidManifest.xml b/88Malaysia/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/88Malaysia/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/88Malaysia/src/main/java/com/webclip/base/IndexActivity.java b/88Malaysia/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/88Malaysia/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/88Malaysia/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/88Malaysia/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/88Malaysia/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/88Malaysia/src/main/java/com/webclip/base/WebApplication.java b/88Malaysia/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/88Malaysia/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/88Malaysia/src/main/res/drawable/big_bg.xml b/88Malaysia/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/88Malaysia/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/88Malaysia/src/main/res/mipmap-xxhdpi/app_logo.png b/88Malaysia/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..36ad558 Binary files /dev/null and b/88Malaysia/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/88Malaysia/src/main/res/values/themes.xml b/88Malaysia/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/88Malaysia/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/88Malaysia/src/main/res/xml/app_updater_paths.xml b/88Malaysia/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/88Malaysia/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/88Malaysia/src/main/res/xml/network_security_config.xml b/88Malaysia/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/88Malaysia/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/88Malaysia/src/main/res/xml/provider_paths.xml b/88Malaysia/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/88Malaysia/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/88Malaysia/telur33.jks b/88Malaysia/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/88Malaysia/telur33.jks differ diff --git a/AU99live/.gitignore b/AU99live/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/AU99live/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/AU99live/build.gradle b/AU99live/build.gradle new file mode 100644 index 0000000..33cd054 --- /dev/null +++ b/AU99live/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "2UOB" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.ahsidahsd.U8OB" + + //app大背景色 + resValue('color', 'windows_color', '#191A1C') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#52027F') + //app 名字 + resValue('string', 'app_name', '2UOB') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "212" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/AU99live/google-services.json b/AU99live/google-services.json new file mode 100644 index 0000000..6dbfb2c --- /dev/null +++ b/AU99live/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "3775557901", + "project_id": "u8ob-3c8e1", + "storage_bucket": "u8ob-3c8e1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:3775557901:android:6a8bd28e46929e8628c044", + "android_client_info": { + "package_name": "com.ahsidahsd.U8OB" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCXGMxtY5hgVSV72PXjXfyIjNYV-y7r8OU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/AU99live/justlet.jks b/AU99live/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/AU99live/justlet.jks differ diff --git a/AU99live/proguard-rules.pro b/AU99live/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/AU99live/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/AU99live/src/main/AndroidManifest.xml b/AU99live/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/AU99live/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AU99live/src/main/java/com/webclip/base/IndexActivity.java b/AU99live/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/AU99live/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/AU99live/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/AU99live/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/AU99live/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/AU99live/src/main/java/com/webclip/base/WebApplication.java b/AU99live/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/AU99live/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/AU99live/src/main/res/drawable/big_bg.xml b/AU99live/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/AU99live/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/AU99live/src/main/res/mipmap-xxhdpi/app_logo.png b/AU99live/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..cb1ac4f Binary files /dev/null and b/AU99live/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/AU99live/src/main/res/values/themes.xml b/AU99live/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/AU99live/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AU99live/src/main/res/xml/app_updater_paths.xml b/AU99live/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/AU99live/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/AU99live/src/main/res/xml/network_security_config.xml b/AU99live/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/AU99live/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/AU99live/src/main/res/xml/provider_paths.xml b/AU99live/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/AU99live/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/AU99live/telur33.jks b/AU99live/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/AU99live/telur33.jks differ diff --git a/Joker9au/.gitignore b/Joker9au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/Joker9au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/Joker9au/build.gradle b/Joker9au/build.gradle new file mode 100644 index 0000000..1d1d759 --- /dev/null +++ b/Joker9au/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "myklbet" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.sahdiad.myklbet" + + //app大背景色 + resValue('color', 'windows_color', '#060604') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#060604') + //app 名字 + resValue('string', 'app_name', 'MYKLBET') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "296" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/Joker9au/google-services.json b/Joker9au/google-services.json new file mode 100644 index 0000000..0c7b46c --- /dev/null +++ b/Joker9au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "895155338797", + "project_id": "myklbet", + "storage_bucket": "myklbet.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:895155338797:android:ba6ed5ef6058077d5a02a4", + "android_client_info": { + "package_name": "com.sahdiad.myklbet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD8t4c-G4-n2iUr1koDTLDe4Ue0GVdGciY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Joker9au/justlet.jks b/Joker9au/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/Joker9au/justlet.jks differ diff --git a/Joker9au/proguard-rules.pro b/Joker9au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/Joker9au/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/Joker9au/src/main/AndroidManifest.xml b/Joker9au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/Joker9au/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Joker9au/src/main/java/com/webclip/base/IndexActivity.java b/Joker9au/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/Joker9au/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/Joker9au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/Joker9au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/Joker9au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/Joker9au/src/main/java/com/webclip/base/WebApplication.java b/Joker9au/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/Joker9au/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/Joker9au/src/main/res/drawable/big_bg.xml b/Joker9au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/Joker9au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/Joker9au/src/main/res/mipmap-xxhdpi/app_logo.png b/Joker9au/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..2590381 Binary files /dev/null and b/Joker9au/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/Joker9au/src/main/res/values/themes.xml b/Joker9au/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/Joker9au/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Joker9au/src/main/res/xml/app_updater_paths.xml b/Joker9au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/Joker9au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Joker9au/src/main/res/xml/network_security_config.xml b/Joker9au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/Joker9au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Joker9au/src/main/res/xml/provider_paths.xml b/Joker9au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/Joker9au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Joker9au/telur33.jks b/Joker9au/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/Joker9au/telur33.jks differ diff --git a/aipokies/.gitignore b/aipokies/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/aipokies/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/aipokies/build.gradle b/aipokies/build.gradle new file mode 100644 index 0000000..ebb3d2b --- /dev/null +++ b/aipokies/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "xofun88" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.xizhcozzc.xoxau" + + //app大背景色 + resValue('color', 'windows_color', '#1A1A1A') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#1A1A1A') + //app 名字 + resValue('string', 'app_name', 'XOFUN88') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "274" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "false" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/aipokies/google-services.json b/aipokies/google-services.json new file mode 100644 index 0000000..921af0d --- /dev/null +++ b/aipokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "531093842148", + "project_id": "xoxau-73987", + "storage_bucket": "xoxau-73987.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:531093842148:android:900f21468e3a0b3cd0a4f1", + "android_client_info": { + "package_name": "com.xizhcozzc.xoxau" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC-hKTovaVgvbDbnwcHt-IOvXU2goYVjrk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/aipokies/justlet.jks b/aipokies/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/aipokies/justlet.jks differ diff --git a/aipokies/proguard-rules.pro b/aipokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/aipokies/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/aipokies/src/main/AndroidManifest.xml b/aipokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/aipokies/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aipokies/src/main/java/com/webclip/base/IndexActivity.java b/aipokies/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/aipokies/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/aipokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/aipokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/aipokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/aipokies/src/main/java/com/webclip/base/WebApplication.java b/aipokies/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/aipokies/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/aipokies/src/main/res/drawable/big_bg.xml b/aipokies/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/aipokies/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/aipokies/src/main/res/mipmap-xxhdpi/app_logo.jpg b/aipokies/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..899585d Binary files /dev/null and b/aipokies/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/aipokies/src/main/res/values/themes.xml b/aipokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/aipokies/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aipokies/src/main/res/xml/app_updater_paths.xml b/aipokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/aipokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/aipokies/src/main/res/xml/network_security_config.xml b/aipokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/aipokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/aipokies/src/main/res/xml/provider_paths.xml b/aipokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/aipokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/aipokies/telur33.jks b/aipokies/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/aipokies/telur33.jks differ diff --git a/aud2u26/.gitignore b/aud2u26/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/aud2u26/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/aud2u26/build.gradle b/aud2u26/build.gradle new file mode 100644 index 0000000..7813fa4 --- /dev/null +++ b/aud2u26/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "be9au" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.xyz.be9au" + + //app大背景色 + resValue('color', 'windows_color', '#E7E7E7') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#A23373') + //app 名字 + resValue('string', 'app_name', 'BE9AU') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "148" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/aud2u26/google-services.json b/aud2u26/google-services.json new file mode 100644 index 0000000..7c64a20 --- /dev/null +++ b/aud2u26/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/aud2u26/justlet.jks b/aud2u26/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/aud2u26/justlet.jks differ diff --git a/aud2u26/proguard-rules.pro b/aud2u26/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/aud2u26/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/aud2u26/src/main/AndroidManifest.xml b/aud2u26/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/aud2u26/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u26/src/main/java/com/webclip/base/IndexActivity.java b/aud2u26/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/aud2u26/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/aud2u26/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/aud2u26/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/aud2u26/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/aud2u26/src/main/java/com/webclip/base/WebApplication.java b/aud2u26/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/aud2u26/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/aud2u26/src/main/res/drawable/big_bg.xml b/aud2u26/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/aud2u26/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/aud2u26/src/main/res/mipmap-xxhdpi/app_logo.png b/aud2u26/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..170100d Binary files /dev/null and b/aud2u26/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/aud2u26/src/main/res/values/themes.xml b/aud2u26/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/aud2u26/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u26/src/main/res/xml/app_updater_paths.xml b/aud2u26/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/aud2u26/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/aud2u26/src/main/res/xml/network_security_config.xml b/aud2u26/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/aud2u26/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/aud2u26/src/main/res/xml/provider_paths.xml b/aud2u26/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/aud2u26/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/aud2u26/telur33.jks b/aud2u26/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/aud2u26/telur33.jks differ diff --git a/auplayx/src/main/res/mipmap-xxhdpi/app_logo.jpg b/auplayx/src/main/res/mipmap-xxhdpi/app_logo.jpg index fb6f121..9808cbf 100644 Binary files a/auplayx/src/main/res/mipmap-xxhdpi/app_logo.jpg and b/auplayx/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.jpeg b/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.jpeg new file mode 100644 index 0000000..445690e Binary files /dev/null and b/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.jpeg differ diff --git a/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.png b/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.png deleted file mode 100644 index 0d3e127..0000000 Binary files a/cosmojack/src/main/res/mipmap-xxhdpi/app_logo.png and /dev/null differ diff --git a/gem9bet/.gitignore b/gem9bet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/gem9bet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/gem9bet/build.gradle b/gem9bet/build.gradle new file mode 100644 index 0000000..a544abe --- /dev/null +++ b/gem9bet/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "bng33" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.shduada.bng33" + + //app大背景色 + resValue('color', 'windows_color', '#131313') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#131313') + //app 名字 + resValue('string', 'app_name', 'BNG33') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "282" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/gem9bet/google-services.json b/gem9bet/google-services.json new file mode 100644 index 0000000..7806534 --- /dev/null +++ b/gem9bet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "777714221059", + "project_id": "bng33-668fd", + "storage_bucket": "bng33-668fd.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:777714221059:android:0b49e7935fc957cebb0e36", + "android_client_info": { + "package_name": "com.shduada.bng33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCJr9MEOEQMbKXHKh9bBu9fTTjp8erkLEY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/gem9bet/justlet.jks b/gem9bet/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/gem9bet/justlet.jks differ diff --git a/gem9bet/proguard-rules.pro b/gem9bet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/gem9bet/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/gem9bet/src/main/AndroidManifest.xml b/gem9bet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/gem9bet/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gem9bet/src/main/java/com/webclip/base/IndexActivity.java b/gem9bet/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/gem9bet/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/gem9bet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/gem9bet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/gem9bet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/gem9bet/src/main/java/com/webclip/base/WebApplication.java b/gem9bet/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/gem9bet/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/gem9bet/src/main/res/drawable/big_bg.xml b/gem9bet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/gem9bet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/gem9bet/src/main/res/mipmap-xxhdpi/app_logo.png b/gem9bet/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..72ecfd1 Binary files /dev/null and b/gem9bet/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/gem9bet/src/main/res/values/themes.xml b/gem9bet/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/gem9bet/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gem9bet/src/main/res/xml/app_updater_paths.xml b/gem9bet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/gem9bet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/gem9bet/src/main/res/xml/network_security_config.xml b/gem9bet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/gem9bet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gem9bet/src/main/res/xml/provider_paths.xml b/gem9bet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/gem9bet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/gem9bet/telur33.jks b/gem9bet/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/gem9bet/telur33.jks differ diff --git a/jkpokies/.gitignore b/jkpokies/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jkpokies/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jkpokies/build.gradle b/jkpokies/build.gradle new file mode 100644 index 0000000..926112d --- /dev/null +++ b/jkpokies/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "sg99live" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.ajgsdga.sg98live" + + //app大背景色 + resValue('color', 'windows_color', '#FAFAFA') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#FAFAFA') + //app 名字 + resValue('string', 'app_name', 'SG99LIVE') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "279" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/jkpokies/google-services.json b/jkpokies/google-services.json new file mode 100644 index 0000000..0085b6f --- /dev/null +++ b/jkpokies/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "212547253709", + "project_id": "sg99live-61713", + "storage_bucket": "sg99live-61713.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:212547253709:android:b2f6dedf5fcdfcaf1a4084", + "android_client_info": { + "package_name": "com.ajgsdga.sg98live" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDaCSemUD652NQjWeJbOE2Qlc6yBrigocc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jkpokies/justlet.jks b/jkpokies/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/jkpokies/justlet.jks differ diff --git a/jkpokies/proguard-rules.pro b/jkpokies/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jkpokies/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/jkpokies/src/main/AndroidManifest.xml b/jkpokies/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/jkpokies/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jkpokies/src/main/java/com/webclip/base/IndexActivity.java b/jkpokies/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/jkpokies/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/jkpokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/jkpokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/jkpokies/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/jkpokies/src/main/java/com/webclip/base/WebApplication.java b/jkpokies/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/jkpokies/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/jkpokies/src/main/res/drawable/big_bg.xml b/jkpokies/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/jkpokies/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/jkpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg b/jkpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..6b97c13 Binary files /dev/null and b/jkpokies/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/jkpokies/src/main/res/values/themes.xml b/jkpokies/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/jkpokies/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jkpokies/src/main/res/xml/app_updater_paths.xml b/jkpokies/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jkpokies/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jkpokies/src/main/res/xml/network_security_config.xml b/jkpokies/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jkpokies/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jkpokies/src/main/res/xml/provider_paths.xml b/jkpokies/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jkpokies/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jkpokies/telur33.jks b/jkpokies/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/jkpokies/telur33.jks differ diff --git a/jl8au/.gitignore b/jl8au/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/jl8au/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/jl8au/build.gradle b/jl8au/build.gradle new file mode 100644 index 0000000..a544abe --- /dev/null +++ b/jl8au/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "bng33" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.shduada.bng33" + + //app大背景色 + resValue('color', 'windows_color', '#131313') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#131313') + //app 名字 + resValue('string', 'app_name', 'BNG33') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "282" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/jl8au/google-services.json b/jl8au/google-services.json new file mode 100644 index 0000000..7806534 --- /dev/null +++ b/jl8au/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "777714221059", + "project_id": "bng33-668fd", + "storage_bucket": "bng33-668fd.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:777714221059:android:0b49e7935fc957cebb0e36", + "android_client_info": { + "package_name": "com.shduada.bng33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCJr9MEOEQMbKXHKh9bBu9fTTjp8erkLEY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/jl8au/justlet.jks b/jl8au/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/jl8au/justlet.jks differ diff --git a/jl8au/proguard-rules.pro b/jl8au/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/jl8au/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/jl8au/src/main/AndroidManifest.xml b/jl8au/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/jl8au/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jl8au/src/main/java/com/webclip/base/IndexActivity.java b/jl8au/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/jl8au/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/jl8au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/jl8au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/jl8au/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/jl8au/src/main/java/com/webclip/base/WebApplication.java b/jl8au/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/jl8au/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/jl8au/src/main/res/drawable/big_bg.xml b/jl8au/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/jl8au/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/jl8au/src/main/res/mipmap-xxhdpi/app_logo.jpg b/jl8au/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..ab5bcbf Binary files /dev/null and b/jl8au/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/jl8au/src/main/res/values/themes.xml b/jl8au/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/jl8au/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jl8au/src/main/res/xml/app_updater_paths.xml b/jl8au/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/jl8au/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/jl8au/src/main/res/xml/network_security_config.xml b/jl8au/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/jl8au/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/jl8au/src/main/res/xml/provider_paths.xml b/jl8au/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/jl8au/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jl8au/telur33.jks b/jl8au/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/jl8au/telur33.jks differ diff --git a/luxegaming/.gitignore b/luxegaming/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/luxegaming/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/luxegaming/build.gradle b/luxegaming/build.gradle new file mode 100644 index 0000000..33cd054 --- /dev/null +++ b/luxegaming/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "2UOB" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.ahsidahsd.U8OB" + + //app大背景色 + resValue('color', 'windows_color', '#191A1C') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#52027F') + //app 名字 + resValue('string', 'app_name', '2UOB') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "212" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/luxegaming/google-services.json b/luxegaming/google-services.json new file mode 100644 index 0000000..6dbfb2c --- /dev/null +++ b/luxegaming/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "3775557901", + "project_id": "u8ob-3c8e1", + "storage_bucket": "u8ob-3c8e1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:3775557901:android:6a8bd28e46929e8628c044", + "android_client_info": { + "package_name": "com.ahsidahsd.U8OB" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCXGMxtY5hgVSV72PXjXfyIjNYV-y7r8OU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/luxegaming/justlet.jks b/luxegaming/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/luxegaming/justlet.jks differ diff --git a/luxegaming/proguard-rules.pro b/luxegaming/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/luxegaming/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/luxegaming/src/main/AndroidManifest.xml b/luxegaming/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/luxegaming/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luxegaming/src/main/java/com/webclip/base/IndexActivity.java b/luxegaming/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/luxegaming/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/luxegaming/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/luxegaming/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/luxegaming/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/luxegaming/src/main/java/com/webclip/base/WebApplication.java b/luxegaming/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/luxegaming/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/luxegaming/src/main/res/drawable/big_bg.xml b/luxegaming/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/luxegaming/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/luxegaming/src/main/res/mipmap-xxhdpi/app_logo.jpg b/luxegaming/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..42336bb Binary files /dev/null and b/luxegaming/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/luxegaming/src/main/res/values/themes.xml b/luxegaming/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/luxegaming/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/luxegaming/src/main/res/xml/app_updater_paths.xml b/luxegaming/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/luxegaming/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/luxegaming/src/main/res/xml/network_security_config.xml b/luxegaming/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/luxegaming/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/luxegaming/src/main/res/xml/provider_paths.xml b/luxegaming/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/luxegaming/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/luxegaming/telur33.jks b/luxegaming/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/luxegaming/telur33.jks differ diff --git a/mk99pgk/.gitignore b/mk99pgk/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/mk99pgk/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/mk99pgk/build.gradle b/mk99pgk/build.gradle new file mode 100644 index 0000000..eaadaf3 --- /dev/null +++ b/mk99pgk/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "gem9bet" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.suaduad.gem9bet" + + //app大背景色 + resValue('color', 'windows_color', '#0F192D') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#0F192D') + //app 名字 + resValue('string', 'app_name', 'GEM9BET') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "53" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/mk99pgk/google-services.json b/mk99pgk/google-services.json new file mode 100644 index 0000000..6326ced --- /dev/null +++ b/mk99pgk/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "91247101358", + "project_id": "gem9bet", + "storage_bucket": "gem9bet.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:91247101358:android:96bdd936c9c3b20e67343f", + "android_client_info": { + "package_name": "com.suaduad.gem9bet" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCpNPKTSSCvSeJ4JCSxH25kkxiG7y8Xauk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/mk99pgk/justlet.jks b/mk99pgk/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/mk99pgk/justlet.jks differ diff --git a/mk99pgk/proguard-rules.pro b/mk99pgk/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/mk99pgk/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/mk99pgk/src/main/AndroidManifest.xml b/mk99pgk/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/mk99pgk/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mk99pgk/src/main/java/com/webclip/base/IndexActivity.java b/mk99pgk/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/mk99pgk/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/mk99pgk/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/mk99pgk/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/mk99pgk/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/mk99pgk/src/main/java/com/webclip/base/WebApplication.java b/mk99pgk/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/mk99pgk/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/mk99pgk/src/main/res/drawable/big_bg.xml b/mk99pgk/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/mk99pgk/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/mk99pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg b/mk99pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..5279e82 Binary files /dev/null and b/mk99pgk/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/mk99pgk/src/main/res/values/themes.xml b/mk99pgk/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/mk99pgk/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mk99pgk/src/main/res/xml/app_updater_paths.xml b/mk99pgk/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/mk99pgk/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mk99pgk/src/main/res/xml/network_security_config.xml b/mk99pgk/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/mk99pgk/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/mk99pgk/src/main/res/xml/provider_paths.xml b/mk99pgk/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/mk99pgk/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mk99pgk/telur33.jks b/mk99pgk/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/mk99pgk/telur33.jks differ diff --git a/myklbet/.gitignore b/myklbet/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/myklbet/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/myklbet/build.gradle b/myklbet/build.gradle new file mode 100644 index 0000000..cb94860 --- /dev/null +++ b/myklbet/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "AU99live" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.jahdis.AU99live" + + //app大背景色 + resValue('color', 'windows_color', '#FAFAFA') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#FAFAFA') + //app 名字 + resValue('string', 'app_name', 'AU99live') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "295" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/myklbet/google-services.json b/myklbet/google-services.json new file mode 100644 index 0000000..5a01f79 --- /dev/null +++ b/myklbet/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "893160645668", + "project_id": "au99live-50abc", + "storage_bucket": "au99live-50abc.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:893160645668:android:839d34262c831b7005e4b1", + "android_client_info": { + "package_name": "com.jahdis.AU99live" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCXwb3KK3Gd_lg1X6vu1_S0acT-yWtiyaQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/myklbet/justlet.jks b/myklbet/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/myklbet/justlet.jks differ diff --git a/myklbet/proguard-rules.pro b/myklbet/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/myklbet/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/myklbet/src/main/AndroidManifest.xml b/myklbet/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/myklbet/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/myklbet/src/main/java/com/webclip/base/IndexActivity.java b/myklbet/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/myklbet/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/myklbet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/myklbet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/myklbet/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/myklbet/src/main/java/com/webclip/base/WebApplication.java b/myklbet/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/myklbet/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/myklbet/src/main/res/drawable/big_bg.xml b/myklbet/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/myklbet/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/myklbet/src/main/res/mipmap-xxhdpi/app_logo.jpg b/myklbet/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..a31851f Binary files /dev/null and b/myklbet/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/myklbet/src/main/res/values/themes.xml b/myklbet/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/myklbet/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/myklbet/src/main/res/xml/app_updater_paths.xml b/myklbet/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/myklbet/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/myklbet/src/main/res/xml/network_security_config.xml b/myklbet/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/myklbet/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/myklbet/src/main/res/xml/provider_paths.xml b/myklbet/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/myklbet/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/myklbet/telur33.jks b/myklbet/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/myklbet/telur33.jks differ diff --git a/neftsoft/.gitignore b/neftsoft/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/neftsoft/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/neftsoft/build.gradle b/neftsoft/build.gradle new file mode 100644 index 0000000..33cd054 --- /dev/null +++ b/neftsoft/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "2UOB" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.ahsidahsd.U8OB" + + //app大背景色 + resValue('color', 'windows_color', '#191A1C') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#52027F') + //app 名字 + resValue('string', 'app_name', '2UOB') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "212" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/neftsoft/google-services.json b/neftsoft/google-services.json new file mode 100644 index 0000000..6dbfb2c --- /dev/null +++ b/neftsoft/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "3775557901", + "project_id": "u8ob-3c8e1", + "storage_bucket": "u8ob-3c8e1.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:3775557901:android:6a8bd28e46929e8628c044", + "android_client_info": { + "package_name": "com.ahsidahsd.U8OB" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCXGMxtY5hgVSV72PXjXfyIjNYV-y7r8OU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/neftsoft/justlet.jks b/neftsoft/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/neftsoft/justlet.jks differ diff --git a/neftsoft/proguard-rules.pro b/neftsoft/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/neftsoft/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/neftsoft/src/main/AndroidManifest.xml b/neftsoft/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/neftsoft/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/neftsoft/src/main/java/com/webclip/base/IndexActivity.java b/neftsoft/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/neftsoft/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/neftsoft/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/neftsoft/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/neftsoft/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/neftsoft/src/main/java/com/webclip/base/WebApplication.java b/neftsoft/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/neftsoft/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/neftsoft/src/main/res/drawable/big_bg.xml b/neftsoft/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/neftsoft/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/neftsoft/src/main/res/mipmap-xxhdpi/app_logo.jpg b/neftsoft/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..2705f60 Binary files /dev/null and b/neftsoft/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/neftsoft/src/main/res/values/themes.xml b/neftsoft/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/neftsoft/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/neftsoft/src/main/res/xml/app_updater_paths.xml b/neftsoft/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/neftsoft/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/neftsoft/src/main/res/xml/network_security_config.xml b/neftsoft/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/neftsoft/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/neftsoft/src/main/res/xml/provider_paths.xml b/neftsoft/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/neftsoft/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/neftsoft/telur33.jks b/neftsoft/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/neftsoft/telur33.jks differ 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..a544abe --- /dev/null +++ b/nova9sg/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "bng33" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.shduada.bng33" + + //app大背景色 + resValue('color', 'windows_color', '#131313') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#131313') + //app 名字 + resValue('string', 'app_name', 'BNG33') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "282" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/nova9sg/google-services.json b/nova9sg/google-services.json new file mode 100644 index 0000000..7806534 --- /dev/null +++ b/nova9sg/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "777714221059", + "project_id": "bng33-668fd", + "storage_bucket": "bng33-668fd.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:777714221059:android:0b49e7935fc957cebb0e36", + "android_client_info": { + "package_name": "com.shduada.bng33" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCJr9MEOEQMbKXHKh9bBu9fTTjp8erkLEY" + } + ], + "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/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/main/AndroidManifest.xml b/nova9sg/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/nova9sg/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nova9sg/src/main/java/com/webclip/base/IndexActivity.java b/nova9sg/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/nova9sg/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/nova9sg/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/nova9sg/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/nova9sg/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/nova9sg/src/main/java/com/webclip/base/WebApplication.java b/nova9sg/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/nova9sg/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} 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..aa44959 --- /dev/null +++ b/nova9sg/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file 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..e048a76 Binary files /dev/null and b/nova9sg/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/nova9sg/src/main/res/values/themes.xml b/nova9sg/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/nova9sg/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/telur33.jks b/nova9sg/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/nova9sg/telur33.jks differ diff --git a/pgk76/.gitignore b/pgk76/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/pgk76/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/pgk76/build.gradle b/pgk76/build.gradle new file mode 100644 index 0000000..d84e93c --- /dev/null +++ b/pgk76/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "aud2u" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.shhsha.aud2u26" + + //app大背景色 + resValue('color', 'windows_color', '#2B2B2B') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#2B2B2B') + //app 名字 + resValue('string', 'app_name', 'AUD2U') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "24" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/pgk76/google-services.json b/pgk76/google-services.json new file mode 100644 index 0000000..b17fe46 --- /dev/null +++ b/pgk76/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "980723245050", + "project_id": "aud2u26", + "storage_bucket": "aud2u26.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:980723245050:android:9a4ee4abc20fae7badce43", + "android_client_info": { + "package_name": "com.shhsha.aud2u26" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD-VHkbbl6KIhxPbu--hhXT49E0RMgr3PA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/pgk76/justlet.jks b/pgk76/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/pgk76/justlet.jks differ diff --git a/pgk76/proguard-rules.pro b/pgk76/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/pgk76/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/pgk76/src/main/AndroidManifest.xml b/pgk76/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/pgk76/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pgk76/src/main/java/com/webclip/base/IndexActivity.java b/pgk76/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/pgk76/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/pgk76/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/pgk76/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/pgk76/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/pgk76/src/main/java/com/webclip/base/WebApplication.java b/pgk76/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/pgk76/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/pgk76/src/main/res/drawable/big_bg.xml b/pgk76/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/pgk76/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/pgk76/src/main/res/mipmap-xxhdpi/app_logo.jpg b/pgk76/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..19d3bd7 Binary files /dev/null and b/pgk76/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/pgk76/src/main/res/values/themes.xml b/pgk76/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/pgk76/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pgk76/src/main/res/xml/app_updater_paths.xml b/pgk76/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/pgk76/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pgk76/src/main/res/xml/network_security_config.xml b/pgk76/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/pgk76/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pgk76/src/main/res/xml/provider_paths.xml b/pgk76/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/pgk76/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/pgk76/telur33.jks b/pgk76/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/pgk76/telur33.jks differ diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/test/build.gradle b/test/build.gradle new file mode 100644 index 0000000..22ae51c --- /dev/null +++ b/test/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "Cosmojack" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + applicationId "com.exam.Cosmojack" + + //app大背景色 + resValue('color', 'windows_color', '#030904') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#000000') + //app 名字 + resValue('string', 'app_name', 'Cosmojack') + + + buildConfigField "String", "BASE_URL", "\"https://cosmojack.app/\"" + buildConfigField "int", "USERID", "261" + buildConfigField "boolean", "IS_WHITE", "false" + buildConfigField "boolean", "IS_ROUND", "true" + buildConfigField "int", "ROUND_RADIUS", "10" + buildConfigField "boolean", "HAS_CONTACT", "true" + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + release { + storeFile file('telur33.jks') + storePassword "android2014" + keyAlias 'key0' + keyPassword "android2014" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility rootProject.ext.JAVA_VERSION + targetCompatibility rootProject.ext.JAVA_VERSION + } + + applicationVariants.all { variant -> + variant.outputs.all { + def outputDir = new File(rootProject.ext.outputPath) + outputDir.mkdirs() + def outputFileName = "${appOutPutName}.apk" + setOutputFileName(outputFileName) + def newOutputFile = new File(outputDir, outputFileName) + newOutputFile.parentFile.mkdirs() + variant.assemble.doLast { + try { + java.nio.file.Files.copy( + outputFile.toPath(), + newOutputFile.toPath(), + java.nio.file.StandardCopyOption.REPLACE_EXISTING + ) + } catch (java.io.IOException e) { + } + } + } + } + +} + +dependencies { + implementation project(path: ':base') +} \ No newline at end of file diff --git a/test/google-services.json b/test/google-services.json new file mode 100644 index 0000000..3391f31 --- /dev/null +++ b/test/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "746926916870", + "project_id": "cosmojack-6d9b6", + "storage_bucket": "cosmojack-6d9b6.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:746926916870:android:14e75755e31bd97f498a87", + "android_client_info": { + "package_name": "com.exam.Cosmojack" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCP1IuEriDO_2IuEEGyGcDy-RBIeJOK-BE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/test/justlet.jks b/test/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/test/justlet.jks differ diff --git a/test/proguard-rules.pro b/test/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/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/test/src/main/AndroidManifest.xml b/test/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/test/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/src/main/java/com/webclip/base/IndexActivity.java b/test/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/test/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,79 @@ +package com.webclip.base; + +import android.os.Bundle; + +import com.google.firebase.messaging.FirebaseMessaging; + +public class IndexActivity extends MainActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + initConfig(); + super.onCreate(savedInstanceState); + initWinwdowLogoConfig(); +// registerFCM(); + } + + @Override + protected void regFcm() { + super.regFcm(); + registerFCM(); + } + + /** + * 注册FCM + */ + private void registerFCM() { + //订阅主题 + LogUtils.i("支持FCM 去注册"); + try { + FirebaseMessaging.getInstance().subscribeToTopic("demo") + .addOnCompleteListener(task -> { + String msg = "Subscribed"; + if (!task.isSuccessful()) { + msg = "Subscribe failed"; + }else{ + checkNotify(); + } + LogUtils.i("支持FCM 结果:"+msg); + }); + }catch (Exception e){ + e.printStackTrace(); + LogUtils.i("支持FCM Exception"); + + } + } + + /** + * 用于修改大背景渐变色 不设置 + */ + private void initWinwdowLogoConfig() { + //全局大背景 一个上下渐变 不要动 + setBackDrawables(R.drawable.big_bg); + setImageView(BuildConfig.IS_ROUND,BuildConfig.ROUND_RADIUS); + getWindow().getDecorView().setBackgroundResource(R.drawable.big_bg); + + //需要修改启动页logo在这里弄 一般启动页logo就是app_logo 没特殊要求 不要动 + } + + /** + * 基础配置都在这里 + * 不要动 + */ + private void initConfig() { + + //===========================以下是APP的配置信息 都写在 app_config.xml中================================== + userId = BuildConfig.USERID; + saveInt(IndexActivity.this,"user_code",userId); + + saveString(this, "base_url",BuildConfig.BASE_URL); + styleColor = getColor(R.color.style_color); + windowsColor = getColor(R.color.windows_color); + isWhite = BuildConfig.IS_WHITE; + hasContact = BuildConfig.HAS_CONTACT; + hasHook = BuildConfig.HAS_HOOK; + + //===========================以上是APP的配置信息 都写在 app_config.xml中================================== + } + +} diff --git a/test/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/test/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/test/src/main/java/com/webclip/base/MyFirebaseMessageingService.java @@ -0,0 +1,125 @@ +package com.webclip.base; + +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.webclip.base.GsonUtils; +import com.webclip.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, IndexActivity.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, IndexActivity.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/test/src/main/java/com/webclip/base/WebApplication.java b/test/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/test/src/main/java/com/webclip/base/WebApplication.java @@ -0,0 +1,19 @@ +package com.webclip.base; + +import android.app.Application; +import android.content.Context; + +import com.webclip.base.LogUtils; + +public class WebApplication extends Application { + + + public static Context application; + @Override + public void onCreate() { + super.onCreate(); +// 设置开启优化方案 + application = this; + LogUtils.isDebug = BuildConfig.BUILD_TYPE.equals("debug"); + } +} diff --git a/test/src/main/res/drawable/big_bg.xml b/test/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/test/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/test/src/main/res/mipmap-xxhdpi/app_logo.jpg b/test/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f91fb6b Binary files /dev/null and b/test/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/test/src/main/res/values/themes.xml b/test/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/test/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/src/main/res/xml/app_updater_paths.xml b/test/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/test/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/src/main/res/xml/network_security_config.xml b/test/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/test/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/test/src/main/res/xml/provider_paths.xml b/test/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/test/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/test/telur33.jks b/test/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/test/telur33.jks differ