diff --git a/1xsands/.gitignore b/1xsands/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/1xsands/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/1xsands/build.gradle b/1xsands/build.gradle new file mode 100644 index 0000000..a6fac9a --- /dev/null +++ b/1xsands/build.gradle @@ -0,0 +1,98 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "1xsgdsdgsdlgfsdgdflgdfh" + +android { + namespace rootProject.ext.namespace + compileSdk 36 + defaultConfig { + minSdkVersion 24 + targetSdk 36 + versionCode 141 + versionName "v1.4.1" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + //包名 + applicationId "com.xyz.xsgd1" + //app大背景色 + resValue('color', 'windows_color', '#400e15') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#121212') + //app 名字 + resValue('string', 'app_name', '1XSGD') + //预埋订阅网址 + buildConfigField "String", "BASE_URL", "\"https://1xsgd.org/\"" + //后台唯一ID + buildConfigField "int", "USERID", "255" + //状态栏文字颜色是否为白色 + buildConfigField "boolean", "IS_WHITE", "true" + //是否强转启动图为圆形 + buildConfigField "boolean", "IS_ROUND", "false" + //IS_ROUND 为 true时 圆角启动logo的 圆角大小 为0 表示为圆形 否则为ROUND_RADIUS的 dp2px的 数字大小 + buildConfigField "int", "ROUND_RADIUS", "0" + //已废弃 + buildConfigField "boolean", "HAS_CONTACT", "false" + //已废弃 + buildConfigField "boolean", "HAS_HOOK", "false" + + } + buildFeatures { + buildConfig = true + } + + signingConfigs { + debug { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + release { + storeFile file('justlet.jks') + storePassword "123456" + keyAlias 'key0' + keyPassword "123456" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility 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/1xsands/google-services.json b/1xsands/google-services.json new file mode 100644 index 0000000..cf7594f --- /dev/null +++ b/1xsands/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "905177738214", + "project_id": "xsgd-b0ad7", + "storage_bucket": "xsgd-b0ad7.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:905177738214:android:c3252140ede0027bf70427", + "android_client_info": { + "package_name": "com.xyz.xsgd1" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDdzd2lTSj86yRmSfW2l0c7Ud5cJpk9BXg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/1xsands/justlet.jks b/1xsands/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/1xsands/justlet.jks differ diff --git a/1xsands/proguard-rules.pro b/1xsands/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/1xsands/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/1xsands/src/main/AndroidManifest.xml b/1xsands/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f129a21 --- /dev/null +++ b/1xsands/src/main/AndroidManifest.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1xsands/src/main/java/com/webclip/base/IndexActivity.java b/1xsands/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..50f5597 --- /dev/null +++ b/1xsands/src/main/java/com/webclip/base/IndexActivity.java @@ -0,0 +1,80 @@ +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); + activityMain2Binding.showTopV1.setImageResource(R.mipmap.start_logo); + //需要修改启动页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/1xsands/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/1xsands/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/1xsands/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/1xsands/src/main/java/com/webclip/base/WebApplication.java b/1xsands/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/1xsands/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/1xsands/src/main/res/drawable/big_bg.xml b/1xsands/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..b058f1e --- /dev/null +++ b/1xsands/src/main/res/drawable/big_bg.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/1xsands/src/main/res/mipmap-xxhdpi/app_logo.jpg b/1xsands/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..f2c2ff3 Binary files /dev/null and b/1xsands/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/1xsands/src/main/res/mipmap-xxhdpi/start_logo.jpg b/1xsands/src/main/res/mipmap-xxhdpi/start_logo.jpg new file mode 100644 index 0000000..f2c2ff3 Binary files /dev/null and b/1xsands/src/main/res/mipmap-xxhdpi/start_logo.jpg differ diff --git a/1xsands/src/main/res/values/themes.xml b/1xsands/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/1xsands/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1xsands/src/main/res/xml/app_updater_paths.xml b/1xsands/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/1xsands/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/1xsands/src/main/res/xml/network_security_config.xml b/1xsands/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/1xsands/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/1xsands/src/main/res/xml/provider_paths.xml b/1xsands/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/1xsands/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/JiliRaja99/google-services.json b/JiliRaja99/google-services.json new file mode 100644 index 0000000..4112f77 --- /dev/null +++ b/JiliRaja99/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "896693649626", + "project_id": "jiliraja99-3c875", + "storage_bucket": "jiliraja99-3c875.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:896693649626:android:57e6a00c6994ded42965e3", + "android_client_info": { + "package_name": "com.xhcizjcosa.JiliRaja99" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyD2XZbCYY0riKeDS_-wCPIhh6yCXirwzng" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/JiliRaja99/src/main/res/mipmap-xxhdpi/app_logo.jpg b/JiliRaja99/src/main/res/mipmap-xxhdpi/app_logo.jpg new file mode 100644 index 0000000..1a1ace0 Binary files /dev/null and b/JiliRaja99/src/main/res/mipmap-xxhdpi/app_logo.jpg differ diff --git a/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.jpg b/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.jpg deleted file mode 100644 index c12e0b8..0000000 Binary files a/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.jpg and /dev/null differ diff --git a/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.png b/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..46eb6ae Binary files /dev/null and b/mgmhotram/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/petron777/google-services.json b/petron777/google-services.json new file mode 100644 index 0000000..d7146ec --- /dev/null +++ b/petron777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "58444174936", + "project_id": "petron777-7720f", + "storage_bucket": "petron777-7720f.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:58444174936:android:cbed18389c63a6b1c8dc2d", + "android_client_info": { + "package_name": "com.web.petron777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBwhI_8NkjpJWrvnuETE-HhKnuh1Rv2qKc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/petronas777/.gitignore b/petronas777/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/petronas777/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/petronas777/build.gradle b/petronas777/build.gradle new file mode 100644 index 0000000..9125155 --- /dev/null +++ b/petronas777/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "live22" + +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.daidn.live22" + + //app大背景色 + resValue('color', 'windows_color', '#440F6F') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#360B58') + //app 名字 + resValue('string', 'app_name', 'LIVE22') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "262" + 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/petronas777/google-services.json b/petronas777/google-services.json new file mode 100644 index 0000000..a0a4dbf --- /dev/null +++ b/petronas777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "717557626585", + "project_id": "live22-997e3", + "storage_bucket": "live22-997e3.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:717557626585:android:4bd86e3e5e825bb85f70c8", + "android_client_info": { + "package_name": "com.daidn.live22" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBL6vtzuXlVfoSWiKHtk4p-TiLts0faqUQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/petronas777/justlet.jks b/petronas777/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/petronas777/justlet.jks differ diff --git a/petronas777/proguard-rules.pro b/petronas777/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/petronas777/proguard-rules.pro @@ -0,0 +1,32 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn dalvik.** +-dontwarn com.tencent.smtt.** + +-keep class com.tencent.smtt.** { + *; +} + +-keep class com.tencent.tbs.** { + *; +} \ No newline at end of file diff --git a/petronas777/src/main/AndroidManifest.xml b/petronas777/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/petronas777/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/java/com/webclip/base/IndexActivity.java b/petronas777/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/petronas777/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/petronas777/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/petronas777/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/petronas777/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/petronas777/src/main/java/com/webclip/base/WebApplication.java b/petronas777/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/petronas777/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/petronas777/src/main/res/drawable/big_bg.xml b/petronas777/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/petronas777/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png b/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..ff4978c Binary files /dev/null and b/petronas777/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/petronas777/src/main/res/values/themes.xml b/petronas777/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/petronas777/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/app_updater_paths.xml b/petronas777/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/petronas777/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/network_security_config.xml b/petronas777/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/petronas777/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/petronas777/src/main/res/xml/provider_paths.xml b/petronas777/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/petronas777/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/petronas777/telur33.jks b/petronas777/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/petronas777/telur33.jks differ diff --git a/petros777/google-services.json b/petros777/google-services.json new file mode 100644 index 0000000..4f92e2a --- /dev/null +++ b/petros777/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "851519485804", + "project_id": "petros777", + "storage_bucket": "petros777.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:851519485804:android:fdb0b9eb6882f5700ca549", + "android_client_info": { + "package_name": "com.expmaewq.petros777" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCr7nq_mC0Ec_cxuIEW_xWtmmOWTjUQGsQ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/toke66a/.gitignore b/toke66a/.gitignore new file mode 100644 index 0000000..956c004 --- /dev/null +++ b/toke66a/.gitignore @@ -0,0 +1,2 @@ +/build +/release \ No newline at end of file diff --git a/toke66a/build.gradle b/toke66a/build.gradle new file mode 100644 index 0000000..9125155 --- /dev/null +++ b/toke66a/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'com.android.application' + id 'com.google.gms.google-services' +} + +def appOutPutName = "live22" + +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.daidn.live22" + + //app大背景色 + resValue('color', 'windows_color', '#440F6F') + //底部导航栏颜色 大背景颜色为 windows_color——style_color的上下渐变色 + resValue('color', 'style_color', '#360B58') + //app 名字 + resValue('string', 'app_name', 'LIVE22') + + + buildConfigField "String", "BASE_URL", "\"https://live22x.com/\"" + buildConfigField "int", "USERID", "262" + 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/toke66a/google-services.json b/toke66a/google-services.json new file mode 100644 index 0000000..e631f39 --- /dev/null +++ b/toke66a/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "124938732028", + "project_id": "toke66a", + "storage_bucket": "toke66a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:124938732028:android:d45c533a59358bdf523279", + "android_client_info": { + "package_name": "com.adabdiad.toke66a" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAUoRhcwkNacnsoD-NwgfJBU0N7glkV1Lw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/toke66a/justlet.jks b/toke66a/justlet.jks new file mode 100644 index 0000000..a33b839 Binary files /dev/null and b/toke66a/justlet.jks differ diff --git a/toke66a/proguard-rules.pro b/toke66a/proguard-rules.pro new file mode 100644 index 0000000..107b7ee --- /dev/null +++ b/toke66a/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/toke66a/src/main/AndroidManifest.xml b/toke66a/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7cbc0e0 --- /dev/null +++ b/toke66a/src/main/AndroidManifest.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toke66a/src/main/java/com/webclip/base/IndexActivity.java b/toke66a/src/main/java/com/webclip/base/IndexActivity.java new file mode 100644 index 0000000..c8e4780 --- /dev/null +++ b/toke66a/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/toke66a/src/main/java/com/webclip/base/MyFirebaseMessageingService.java b/toke66a/src/main/java/com/webclip/base/MyFirebaseMessageingService.java new file mode 100644 index 0000000..36f2d65 --- /dev/null +++ b/toke66a/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/toke66a/src/main/java/com/webclip/base/WebApplication.java b/toke66a/src/main/java/com/webclip/base/WebApplication.java new file mode 100644 index 0000000..36e2512 --- /dev/null +++ b/toke66a/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/toke66a/src/main/res/drawable/big_bg.xml b/toke66a/src/main/res/drawable/big_bg.xml new file mode 100644 index 0000000..aa44959 --- /dev/null +++ b/toke66a/src/main/res/drawable/big_bg.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/toke66a/src/main/res/mipmap-xxhdpi/app_logo.png b/toke66a/src/main/res/mipmap-xxhdpi/app_logo.png new file mode 100644 index 0000000..247fa5e Binary files /dev/null and b/toke66a/src/main/res/mipmap-xxhdpi/app_logo.png differ diff --git a/toke66a/src/main/res/values/themes.xml b/toke66a/src/main/res/values/themes.xml new file mode 100644 index 0000000..f1ef249 --- /dev/null +++ b/toke66a/src/main/res/values/themes.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/toke66a/src/main/res/xml/app_updater_paths.xml b/toke66a/src/main/res/xml/app_updater_paths.xml new file mode 100644 index 0000000..1254450 --- /dev/null +++ b/toke66a/src/main/res/xml/app_updater_paths.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/toke66a/src/main/res/xml/network_security_config.xml b/toke66a/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..dca93c0 --- /dev/null +++ b/toke66a/src/main/res/xml/network_security_config.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/toke66a/src/main/res/xml/provider_paths.xml b/toke66a/src/main/res/xml/provider_paths.xml new file mode 100644 index 0000000..c9a897a --- /dev/null +++ b/toke66a/src/main/res/xml/provider_paths.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/toke66a/telur33.jks b/toke66a/telur33.jks new file mode 100644 index 0000000..f00434d Binary files /dev/null and b/toke66a/telur33.jks differ