Branch_DNA
zhangjiannan 2025-09-04 10:13:50 +08:00
parent ca5b7bd94e
commit 1a606aa74f
174 changed files with 5426 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

View File

@ -0,0 +1,146 @@
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
ext {
agp_version = '8.2.2'
}
repositories {
maven{
url 'https://repo.huaweicloud.com/repository/maven/'
}
mavenCentral()
google()
jcenter()
maven {
allowInsecureProtocol= true
url "http://repo.wingsdk.cn:8081/repository/winga-group/"
}
}
dependencies {
classpath "com.android.tools.build:gradle:$agp_version"
classpath 'com.google.gms:google-services:4.4.2'
}
}
allprojects {
repositories {
maven{
url 'https://repo.huaweicloud.com/repository/maven/'
}
mavenCentral()
google()
jcenter()
maven {
allowInsecureProtocol= true
url "http://repo.wingsdk.cn:8081/repository/winga-group/"
}
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
//androidx
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
// €?
implementation 'cn.leancloud:storage-android:8.2.19'
// ??
implementation 'cn.leancloud:realtime-android:8.2.19'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.wa.sdk:wa-sdk-appsflyer:4.5.0'
implementation 'com.wa.sdk:wa-sdk-core:4.5.0'
implementation 'com.wa.sdk:wa-sdk-facebook:4.5.0'
implementation 'com.wa.sdk:wa-sdk-google:4.5.0'
implementation 'com.wa.sdk:wa-sdk-base:4.5.0'
implementation 'com.wa.sdk:wa-sdk-aihelp:4.2.0'
implementation 'com.wa.sdk:wa-sdk-firebase:4.2.0'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.annotation:annotation:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
}
android {
namespace "com.f5game.ms"
compileSdkVersion 35
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 24
targetSdkVersion 35
applicationId 'com.f5game.ms'
ndk {
abiFilters 'armeabi-v7a','arm64-v8a'
}
versionCode 13
versionName '1.2.13'
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb', 'android/resources/dotweensettings.asset', 'android/resources/emptyctrllerforil2cpp.controller', 'android/resources/emptytimelineforil2cpp.playable', 'android/resources/emptytimelineforil2cppprefab.prefab', 'android/resources/language.json', 'android/resources/sdkchannelconfig.txt', 'android/resources/version.txt']
}
buildTypes {
debug {
minifyEnabled false
// useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
jniDebuggable true
}
release {
minifyEnabled false
// useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
signingConfig signingConfigs.debug
}
}
packagingOptions {
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
}
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}
buildFeatures {
viewBinding true
}
}

View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "718090349988",
"project_id": "mutant-summoners",
"storage_bucket": "mutant-summoners.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:718090349988:android:3d1dd9bec733b08de52531",
"android_client_info": {
"package_name": "com.f5game.ms"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyAO9Fv9MJMXPFpMb3z4EzIUEYedzsaa1CU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx4096M
android.enableJetifier=true
android.useAndroidX=true

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.f5game.ms" xmlns:tools="http://schemas.android.com/tools" android:installLocation="auto">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application
android:name="android.app.Application"
android:theme="@style/UnityThemeSelector"
android:icon="@mipmap/app_icon"
android:usesCleartextTraffic="true"
android:label="@string/app_name">
<activity android:exported="true" android:label="@string/app_name" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false" android:name="com.f5game.ms.MyActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<receiver android:name=".PushReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.wa.sdk.push.intent.NOTIFICATION_OPENED" />
</intent-filter>
</receiver>
<!--与Galaxy S8类似的屏幕处理-->
<meta-data android:name="android.max_aspect" android:value="2.1" />
<meta-data android:name="unity.build-id" android:value="a64232a6-7841-46d6-9a35-2b2715f6d45d" />
<meta-data android:name="unity.splash-mode" android:value="2" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<!-- sdk的appid -->
<meta-data android:name="com.wa.sdk.APP_ID" android:value="0977b6d3e84611ef8f2202c85f0429f5" />
<!-- sdk的appkey -->
<meta-data android:name="com.wa.sdk.APP_KEY" android:value="4KFXCMH1dyTMrzBQbbkLFEOY3DCTtHOD" />
<!-- sdk平台请求的host地址所有请求的前面公共部分 -->
<meta-data android:name="com.wa.sdk.HTTP_BASE_URL" android:value="https://api.wingsdk.com/sdkapi" />
<!-- 数据收集请求地址 -->
<meta-data android:name="com.wa.sdk.track.BASE_URL" android:value="https://api.wingsdk.com/data"/>
<meta-data android:name="com.wa.sdk.CONSENT_NOTICE_ID" android:value="bmr2znLU" />
<!-- Facebook Start -->
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider1145531583704800"
android:exported="true" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!-- Facebook End -->
</application>
<uses-feature android:glEsVersion="0x00020000" />
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>

View File

@ -0,0 +1 @@
{"sdk_jar.apk":{"code":"sdk_jar","plugin_name":"第三方稳定jar","update_desc":"sdk核心库","url":"","version":8.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"2822163d753a2d6fd6b7b2d15b5e93d3","type":1,"has_so":0},"sdk_dl.apk":{"code":"sdk_dl","plugin_name":"dl加载库","update_desc":"sdk核心库","url":"","version":8.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"cf5b86e85172b84d290d6df5e0cff06f","type":2,"has_so":1},"sdk_pay.apk":{"code":"sdk_pay","plugin_name":"sdk支付","update_desc":"sdk核心库","url":"","version":8.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"95a81473da2f50b4fa2fc13c4a25dadd","type":100,"has_so":0},"sdk_native.apk":{"code":"sdk_native","plugin_name":"火速native认证","update_desc":"sdk核心库","url":"","version":8.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"a6c849ecb44ab63624ec22f64098d261","type":200,"has_so":2},"sdk_web.apk":{"code":"sdk_web","plugin_name":"火速网页插件","update_desc":"sdk核心库","url":"","version":8.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"856750fa00f5deea09f684b1b531d950","type":201,"has_so":0},"sdk_core.apk":{"code":"sdk_core","plugin_name":"sdk核心库","update_desc":"sdk核心库","url":"","version":12.0,"sign":"DB5D37D97E777290EA76B928D2E8F8B4","md5":"4ae5ca061764c3f9dabfc3da9c3793cb","type":202,"has_so":0}}

View File

@ -0,0 +1,17 @@
{
"supplier":{
"vivo":{
"appid":"100215079"
},
"xiaomi":{
},
"huawei":{
},
"oppo":{
}
}
}

View File

@ -0,0 +1,346 @@
package com.bluewhale.androidutils;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
import com.ktgame.ktdeviceutil.KTGameDeviceUtil;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
@SuppressLint({"NewApi"})
public class AndroidDeviceInfo {
private static AndroidDeviceInfo _instance = null;
private static Context mContext;
public static AndroidDeviceInfo instance() {
if (_instance == null)
_instance = new AndroidDeviceInfo();
return _instance;
}
public void Init(Context context) {
mContext = context;
}
public static String GetDeviceBrand() {
return Build.BRAND;
}
public static String GetDeviceModel() {
return Build.MODEL;
}
public static String GetSystemVersion() {
return Build.VERSION.RELEASE;
}
public static String GetScreenRatio(Context context) {
WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
int width = metrics.widthPixels;
int height = metrics.heightPixels;
return String.format("%s*%s", new Object[] { Integer.valueOf(height), Integer.valueOf(width) });
}
public static String GetOperatorName(Context context) {
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
return telephonyManager.getSimOperatorName();
}
public static String GetNetworkType(Context context) {
ConnectivityManager connManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connManager == null)
return "NoneNetWork ";
NetworkInfo activeNetInfo = connManager.getActiveNetworkInfo();
if (activeNetInfo == null || !activeNetInfo.isAvailable())
return "NoneNetWork ";
NetworkInfo wifiInfo = connManager.getNetworkInfo(1);
if (wifiInfo != null) {
NetworkInfo.State state = wifiInfo.getState();
if (state != null && (
state == NetworkInfo.State.CONNECTED || state == NetworkInfo.State.CONNECTING))
return "WIFI";
}
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
int networkType = 1;
switch (networkType) {
case 1:
case 2:
case 4:
case 7:
case 11:
return "2G";
case 3:
case 5:
case 6:
case 8:
case 9:
case 10:
case 12:
case 14:
case 15:
return "3G";
case 13:
return "4G";
}
return "Unknown";
}
public static String GetLocalIpAddress(Context context) {
NetworkInfo info = ((ConnectivityManager)context
.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (info != null && info.isConnected())
if (info.getType() == 0) {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress() && inetAddress instanceof java.net.Inet4Address)
return inetAddress.getHostAddress();
}
}
} catch (SocketException e) {
e.printStackTrace();
}
} else if (info.getType() == 1) {
WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
String ipAddress = intIP2StringIP(wifiInfo.getIpAddress());
return ipAddress;
}
return "0.0.0.0";
}
public static String intIP2StringIP(int ip) {
return String.valueOf(ip & 0xFF) + "." + (
ip >> 8 & 0xFF) + "." + (
ip >> 16 & 0xFF) + "." + (
ip >> 24 & 0xFF);
}
public static void CopyToClipBoard(String str) {
ClipboardManager cm = (ClipboardManager)mContext.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData mClipData = ClipData.newPlainText("PlayerInfo", str);
cm.setPrimaryClip(mClipData);
}
public static String PasteFromClipBoard() {
ClipboardManager cm = (ClipboardManager)mContext.getSystemService(Context.CLIPBOARD_SERVICE);
String result = "";
ClipData clipData = cm.getPrimaryClip();
ClipData.Item item = clipData.getItemAt(0);
CharSequence charSequence = item.coerceToText(mContext.getApplicationContext());
result = charSequence.toString();
return result;
}
public static String GetIMEICode() {
return KTGameDeviceUtil.getIMEI(mContext);
}
public static String GetDeviceID() {
return KTGameDeviceUtil.getDeviceID(mContext);
}
/**
*
*/
public static synchronized String getAppName() {
try {
PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
mContext.getPackageName(), 0);
int labelRes = packageInfo.applicationInfo.labelRes;
return mContext.getResources().getString(labelRes);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* []
* @return
*/
public static synchronized String getVersionName() {
try {
PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
mContext.getPackageName(), 0);
return packageInfo.versionName;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* []
* @return
*/
public static synchronized int getVersionCode() {
try {
PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
mContext.getPackageName(), 0);
return packageInfo.versionCode;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
/**
* []
* @return
*/
public static synchronized String getPackageName() {
try {
PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
mContext.getPackageName(), 0);
return packageInfo.packageName;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* bitmap
*/
public static synchronized Bitmap getBitmap() {
PackageManager packageManager = null;
ApplicationInfo applicationInfo = null;
try {
packageManager = mContext.getApplicationContext()
.getPackageManager();
applicationInfo = packageManager.getApplicationInfo(
mContext.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
applicationInfo = null;
}
Drawable d = packageManager.getApplicationIcon(applicationInfo); //xxx根据自己的情况获取drawable
BitmapDrawable bd = (BitmapDrawable) d;
Bitmap bm = bd.getBitmap();
return bm;
}
}

View File

@ -0,0 +1,498 @@
package com.f5game.ms;
import android.Manifest;
import android.app.AlertDialog;
import android.app.FragmentManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.game.base.IUnityPlayerActivity;
import com.wa.sdk.WAConstants;
import com.wa.sdk.ad.WAAdProxy;
import com.wa.sdk.ad.model.WAAdCachedCallback;
import com.wa.sdk.cmp.WACmpProxy;
import com.wa.sdk.common.WACommonProxy;
import com.wa.sdk.common.WASharedPrefHelper;
import com.wa.sdk.common.model.WACallback;
import com.wa.sdk.common.model.WAPermissionCallback;
import com.wa.sdk.common.model.WAResult;
import com.wa.sdk.common.utils.LogUtil;
import com.wa.sdk.common.utils.StringUtil;
import com.wa.sdk.core.WACoreProxy;
import com.wa.sdk.csc.WACscProxy;
import com.wa.sdk.pay.WAPayProxy;
import com.wa.sdk.pay.model.WAPurchaseResult;
import com.wa.sdk.track.WATrackProxy;
import com.wa.sdk.track.model.WAInitiatedPurchaseEvent;
import com.wa.sdk.track.model.WALevelAchievedEvent;
import com.wa.sdk.track.model.WAUserImportEvent;
import com.wa.sdk.user.WAUserProxy;
import com.wa.sdk.user.model.WAAccountCallback;
import com.wa.sdk.user.model.WABindResult;
import com.wa.sdk.user.model.WACertificationInfo;
import com.wa.sdk.user.model.WAGameReviewCallback;
import com.wa.sdk.user.model.WALoginResult;
import com.wa.sdk.user.model.WAShortUrlResult;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MyActivity extends IUnityPlayerActivity {
boolean isInit = false;
WALoginResult result;
String createTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
printLog("执行oncreate");
// SDK初始化
WACoreProxy.initialize(MyActivity.this, new WACallback<Void>() {
@Override
public void onSuccess(int code, String message, Void result) {
printLog("wacore初始化成功");
// 支付初始化
WAPayProxy.initialize(MyActivity.this, new WACallback<WAResult>() {
@Override
public void onSuccess(int code, String message, WAResult result) {
WAPayProxy.queryInventory(null);
}
@Override
public void onCancel() {
}
@Override
public void onError(int code, String message, WAResult result, Throwable throwable) {
}
});
}
@Override
public void onCancel() {
printLog("wacore初始化Cancel");
}
@Override
public void onError(int code, String message, Void result, Throwable throwable) {
printLog("wacore初始化Error");
}
});
}
@Override
protected void onRestart() {
super.onRestart();
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (WACommonProxy.onActivityResult(requestCode, resultCode, data)) {
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode,permissions,grantResults);
/*
//申请权限的回调(结果)这是一个类似生命周期的回调
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//申请成功
// printLog("申請成功");
login();
} else {
//失败 这里逻辑以游戏为准 这里只是模拟申请失败 cp方可改为继续申请权限 或者退出游戏 或者其他逻辑
// printLog("申請失敗");
login();
}
*/
}
@Override
public void Init() {
callUnityFunc("InitCallback",SUCCESS);
}
@Override
public void Login() {
if (result != null){
String tokens = result.getToken();
String uid = result.getUserId();
callUnityFunc("LoginCallback", String.valueOf(1) + "#" + uid + "#" + "" + "#" + tokens);
result = null;
printLog("登录成功");
return;
}
if (Build.VERSION.SDK_INT >= 33) {
runOnUiThread(new Runnable() {
@Override
public void run() {
//向用户申请通知权限 Manifest.permission.POST_NOTIFICATIONS
WACommonProxy.checkSelfPermission(MyActivity.this, Manifest.permission.POST_NOTIFICATIONS, false, null, null, new WAPermissionCallback() {
@Override
public void onCancel() {
callUnityFunc("DebugSdk", "开始登录");
login();
}
@Override
public void onRequestPermissionResult(String[] strings, boolean[] booleans) {
callUnityFunc("DebugSdk", "开始登录");
login();
}
});
}});
}else {
callUnityFunc("DebugSdk", "开始登录");
login();
//系统低于 Android 13 无需授权通知权限
}
/*
try {
if(ActivityCompat.shouldShowRequestPermissionRationale(this,Manifest.permission.WRITE_EXTERNAL_STORAGE))
{
// printLog("沒有开启权限");
login();
}
else {
//check权限
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
//没有 申请权限 权限数组
// printLog("要求申请权限");
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
} else {
// 有 则执行初始化
// printLog("已经有权限");
login();
}
}
} catch (Exception e) {
//异常 继续申请
//ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.READ_PHONE_STATE ,Manifest.permission.WRITE_EXTERNAL_STORAGE }, 1);
Login();
}
*/
printLog("开始登录");
}
private void login()
{
runOnUiThread(new Runnable() {
@Override
public void run() {
WAUserProxy.loginUI(MyActivity.this, true, new WACallback<WALoginResult>() {
@Override
public void onSuccess(int code, String message, WALoginResult result) {
String text = "code:" + code + "\nmessage:" + message;
if (null == result) {
text = "Login failed->" + text;
} else {
text = "Login success->" + text
+ "\nplatform:" + result.getPlatform()
+ "\nuserId:" + result.getUserId()
+ "\ntoken:" + result.getToken()
+ "\nplatformUserId:" + result.getPlatformUserId()
+ "\nplatformToken:" + result.getPlatformToken()
+ "\nisBindMobile: " + result.isBindMobile()
+ "\nisBindAccount: " + result.getIsBindAccount()
+ "\nisGuestAccount: " + result.getIsGuestAccount()
+ "\nisFistLogin: " + result.isFirstLogin();
String tokens = result.getToken();
String uid = result.getUserId();
callUnityFunc("LoginCallback", String.valueOf(1) + "#" + uid + "#" + "" + "#" + tokens);
printLog("登录成功");
}
}
@Override
public void onCancel() {
printLog("登录取消");
AlertDialog.Builder builder = new AlertDialog.Builder(MyActivity.this);
builder.setTitle("Tips")
.setMessage("Please login first!")
.setPositiveButton("Login", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
login();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
@Override
public void onError(int code, String message, WALoginResult result, Throwable throwable) {
printLog("登录出错");
}
});
}
});
}
@Override
public void SwitchLogin() {
}
@Override
public void Logout() {
runOnUiThread(new Runnable() {
@Override
public void run() {
WAUserProxy.openAccountManager(MyActivity.this, new WAAccountCallback() {
@Override
public void onLoginAccountChanged(WALoginResult waLoginResult) {
result = waLoginResult;
callUnityFunc("LogoutCallback",SUCCESS);
}
@Override
public void onBoundAccountChanged(boolean b, WABindResult waBindResult) {
}
@Override
public void onRealNameAuthChanged(WAResult<WACertificationInfo> waResult) {
}
});
}
});
}
@Override
public boolean IsSupportExit() {
return true;
}
@Override
public void ExitGame() {
}
@Override
public void SubmitExtraData(
final int dataType,
final int serverId,//服务器ID
final String serverName,//服务器名
final String zoneID,
final String zoneName,
final String roleID,//玩家ID
final String roleName,//玩家姓名
final String roleLevel,//玩家等级
String guildlD,//公会ID
String Vip,//VIP等级
final int moneyNum,//钱币数量
final String roleCreateTime,//创角时间
final String roleLevelUpTime) {
int level = Integer.parseInt(roleLevel);
if(dataType == 2){
runOnUiThread(new Runnable() {
@Override
public void run() {
// 进入游戏
WACoreProxy.setServerId(serverId+"");
WACoreProxy.setGameUserId(roleID);
WACoreProxy.setNickname(roleName);
//创角事件
WAUserImportEvent event = new WAUserImportEvent(serverId+"", roleID, roleName, level, true);
WATrackProxy.trackEvent(MyActivity.this, event);
}
});
} else if (dataType == 3) {
runOnUiThread(new Runnable() {
@Override
public void run() {
// 进入游戏
WACoreProxy.setServerId(serverId+"");
WACoreProxy.setGameUserId(roleID);
WACoreProxy.setNickname(roleName);
//进入服务器事件
WAUserImportEvent event = new WAUserImportEvent(serverId+"", roleID, roleName, level, false);
WATrackProxy.trackEvent(MyActivity.this, event);
}
});
} else if (dataType == 4) {
runOnUiThread(new Runnable() {
@Override
public void run() {
//等级增长事件
WALevelAchievedEvent event = new WALevelAchievedEvent(level);
WATrackProxy.trackEvent(MyActivity.this, event);
}
});
}
}
@Override
public void Relation(String a){
Intent intent = new Intent(MyActivity.this,MyFragment.class);
startActivity(intent);
}
@Override
public void Community(){
runOnUiThread(new Runnable() {
@Override
public void run() {
WAUserProxy.showUserCenterNoticeUI(MyActivity.this, new WACallback<WAShortUrlResult>() {
@Override
public void onSuccess(int code, String message, WAShortUrlResult result) {
// 此方法不会被调用
}
@Override
public void onCancel() {
}
@Override
public void onError(int code, String message, WAShortUrlResult result, Throwable throwable) {
}
});
}
});
}
@Override
public void CustomerService(){
runOnUiThread(new Runnable() {
@Override
public void run() {
if (WACscProxy.isOpenAiHelp()) {
WACscProxy.openAiHelpV2();
}
}
});
}
@Override
public void Cancellation(){
WAUserProxy.requestDeleteAccountUI(MyActivity.this, new WACallback<WAResult>() {
@Override
public void onSuccess(int code, String message, WAResult result) {
//Log.d("","申请账号注销成功!\nCP需要退出sdk然后再退出游戏到登录页");
// 退出sdk内部的登录
WAUserProxy.logout();
callUnityFunc("LogoutCallback",SUCCESS);
// 退出游戏到登录页面
}
@Override
public void onCancel() {
// 取消
}
@Override
public void onError(int code, String message, WAResult result, Throwable throwable) {
// 失败
}
});
}
@Override
public void Pay(
final String rechargeId,//支付项ID
final int showType,
final int productId,//产品ID
final String productName,//商品名称
final String productDesc,//商品描述
final String price,//价格
final String currencyType,
final int ratio,//比率
final int buyNum,//购买数量
final int coinNum,//金钱数量
final String zoneId,
final String serverID,//服务器ID
final String serverName,//服务器名
final String accounted,
final String roleID,//玩家ID
final String roleName,//玩家名
final int roleLevel,//玩家等级
final String vip,//vip
final String guildlD,//公会ID
final String payNotifyUrl,
final String extension,//额外参数
final String orderID) {
//购买事件
WAInitiatedPurchaseEvent event = new WAInitiatedPurchaseEvent();
//关键等级事件
//WALvXEvent event = new WALvXEvent(level);
//新手任务事件
//WATutorialCompletedEvent event = new WATutorialCompletedEvent();
runOnUiThread(new Runnable() {
@Override
public void run() {
WATrackProxy.trackEvent(MyActivity.this, event);
WAPayProxy.payUI(MyActivity.this, rechargeId, orderID+"", new WACallback<WAPurchaseResult>() {
@Override
public void onSuccess(int code, String message, WAPurchaseResult result) {
callUnityFunc("PayCallback",SUCCESS + "#" + result.getOrderId());
printLog("支付成功");
}
@Override
public void onCancel() {
}
@Override
public void onError(int code, String message, WAPurchaseResult result, Throwable throwable) {
callUnityFunc("PayCallback",FAILED + "#" + result.getOrderId());
printLog("支付失败");
}
});
}
});
}
@Override
public void CustomEvent(int type,String param) {
}
}

View File

@ -0,0 +1,25 @@
package com.f5game.ms;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import com.wa.sdk.cmp.WACmpProxy;
public class MyFragment extends FragmentActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
runOnUiThread(new Runnable() {
@Override
public void run() {
WACmpProxy.showConsentPreferences(MyFragment.this);
}
});
}
}

View File

@ -0,0 +1,28 @@
package com.f5game.ms;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.wa.sdk.WAConstants;
import com.wa.sdk.common.utils.LogUtil;
public class PushReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if(null == intent || !WAConstants.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
return;
}
Bundle bundle = intent.getExtras();
if(null == bundle) {
LogUtil.e("PushReceiver", "通知打开,没有数据");
} else {
LogUtil.e("PushReceiver", "通知打开,包含的数据");
for(String key : bundle.keySet()) {
LogUtil.e("PushReceiver", key + " -- " + bundle.get(key));
}
}
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fromYDelta="100%p" />
</set>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:toYDelta="100%p" />
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="30dp"/>
<solid android:color="@color/huosdk_float_bg"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Some files were not shown because too many files have changed in this diff Show More