Commit 7ee9abc2 authored by 王雪伟's avatar 王雪伟

加密

parent 68b2e1ed
......@@ -43,8 +43,11 @@ public class AdManager
return activity;
}
#if UNITY_IOS
[DllImport("__Internal")]
public static extern void InitCSJSDK(string appId); // ios初始化穿山甲SDK
#endif
private bool IsInitAd = false;
......
......@@ -14,8 +14,8 @@ public class ZXADConfig
}
}
public const int ZXAD_VC = 130;
public const string ZXAD_VN = "1.3.0";
public const int ZXAD_VC = 131;
public const string ZXAD_VN = "1.3.1";
public const string ADManagerTAG = "AdManager";
public const string PLANTFORM_AD_TT = "chuanshanjia"; //穿山甲
......
using System;
using System.Collections.Generic;
using UnityEngine;
public class AdUtils
{
private AdUtils() { }
private static readonly AdUtils singleInstance = new AdUtils();
public static AdUtils Instance
{
get
{
return singleInstance;
}
}
private void InitAd()
{
AdManager.Instance.InitAd(new Action<bool>((cb)=> {
if (cb)
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
}
}));
}
/// <summary>
/// 播放开屏广告
/// </summary>
public void ShowSplashAd(Action<bool> callback)
{
AdManager.Instance.LoadSplashAd(new SplshAdListener(callback));
}
/// <summary>
/// 播放激励视频广告
/// </summary>
public void ShowRewardAd(string action,Action<bool> callback)
{
AdManager.Instance.PlayCacheRewardVideoAd("video", "test", new RewardAdListener(callback));
}
private sealed class SplshAdListener : ZXADSplashListener
{
private Action<bool> callback;
public SplshAdListener(Action<bool> callback)
{
this.callback = callback;
}
public void onAdShow()
{
}
public void onAdSkip()
{
callback(true);
}
public void onError(string errorMsg)
{
}
public void onLastError()
{
callback(true);
}
}
public sealed class RewardAdListener : ZXADRewardVideoListener
{
private Action<bool> callback;
public RewardAdListener(Action<bool> callback)
{
this.callback = callback;
}
public void onAdClose(AdEntity entity)
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
callback(true);
}
public void onAdShow()
{
}
public void onAdVideoBarClick()
{
}
public void onError(string errorMsg)
{
AdManager.Instance.LoadCacheRewardVideoAd("video");
callback(false);
}
public void onSuccess()
{
}
}
}
fileFormatVersion: 2
guid: 7254c6703a47f6f438d80ec0dc944695
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -34,7 +34,7 @@ public class FSSplashUtil
/// <summary>
/// ZXHC开屏回调
/// 风行开屏回调
/// </summary>
private sealed class SplshAdListener : IFSSplashAdListener
{
......@@ -75,11 +75,13 @@ public class FSSplashUtil
public void onAdShow()
{
EventUtils.onEventShowSuccess(entity);
callback(true);
}
public void onAdSkip()
{
EventUtils.onEventAdComplete(entity);
this.listener.onAdSkip();
}
......
......@@ -5,9 +5,13 @@ public class IOSDemoUtils
{
public static void ShowView(IntPtr view)
{
#if UNITY_IOS
GDT_UnionPlatform_Ad_ShowAdView(view);
#endif
}
#if UNITY_IOS
[DllImport("__Internal")]
private static extern void GDT_UnionPlatform_Ad_ShowAdView(IntPtr adView);
#endif
}
\ No newline at end of file
fileFormatVersion: 2
guid: 699ec949cb5539f48b04345cd60af6dd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &232745211
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2853166085728200632, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_Name
value: HTTP
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2853166085728200635, guid: 1053be02c113a7a45adf322c929b0cb6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1053be02c113a7a45adf322c929b0cb6, type: 3}
--- !u!1 &1990259245
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1990259248}
- component: {fileID: 1990259247}
- component: {fileID: 1990259246}
- component: {fileID: 1990259249}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1990259246
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1990259245}
m_Enabled: 1
--- !u!20 &1990259247
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1990259245}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1990259248
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1990259245}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1990259249
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1990259245}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 788e2a3a769e26b459cd63d4a5de7d76, type: 3}
m_Name:
m_EditorClassIdentifier:
fileFormatVersion: 2
guid: b0fdeff412c9a1f4e82faa8ef0aeb063
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8006bcf66346a264bb1eefc0548c6ca6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 07cdf040ed2d37a4bb8260af8551d74f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e7c06331de9f6354f8a22454284824aa
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 231e41b78eb80914b987134df2a038a7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
package com.ym.zxhcsdkaar;
public interface ITdListener {
void getTd(String s);
}
fileFormatVersion: 2
guid: 976956d15672917479773f9be77e1221
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
using LitJson;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Android;
using UnityEngine.SceneManagement;
public class InitProject : MonoBehaviour
{
private string[] strs = new string[] { "android.permission.READ_PHONE_STATE",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.READ_EXTERNAL_STORAGE",
};
// Start is called before the first frame update
void Start()
{
#if UNITY_ANDROID
StartCoroutine(StartApp());
#endif
}
private IEnumerator StartApp()
{
yield return GetPermission();
#if UNITY_ANDROID && !UNITY_EDITOR
//Android初始化参数
var jc = new AndroidJavaClass("com.unity.adcommon.unity.AndroidConfig");
jc.CallStatic("init");
#elif UNITY_IOS && !UNITY_EDITOR
#endif
if (IsOk())
{
Gettd();
}
else
{
Application.Quit();
}
}
public object GetPermission()
{
#if UNITY_ANDROID
strs.ToList().ForEach(s =>
{
if (!Permission.HasUserAuthorizedPermission(s))
{
Permission.RequestUserPermission(s);
}
else
{
}
});
#elif UNITY_IOS
#endif
return null;
}
private static void Gettd()
{
#if UNITY_ANDROID
AndroidJavaObject util = new AndroidJavaObject("com.ym.zxhcsdkaar.TDUtils");
util.Call("TD", GetActivity(), new TdListenerProxy((s)=> {
//td 上报
Dictionary<string, string> map = new Dictionary<string, string>();
map["event"] = "";
map["action"] = "checkDevice";
map["data"] = "";
HttpTool.Instance.TdEvent(JsonMapper.ToJson(map), s);
//加载游戏场景
SceneManager.LoadSceneAsync(1);
}));
#else
callback("不支持");
#endif
}
private bool IsOk()
{
#if UNITY_EDITOR
return true;
#endif
#if UNITY_ANDROID
// 获取Android的PackageManager
AndroidJavaClass Player = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject Activity = Player.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject PackageManager = Activity.Call<AndroidJavaObject>("getPackageManager");
// 获取当前Android应用的包名
string packageName = Activity.Call<string>("getPackageName");
// 调用PackageManager的getPackageInfo方法来获取签名信息数组
int GET_SIGNATURES = PackageManager.GetStatic<int>("GET_SIGNATURES");
AndroidJavaObject PackageInfo = PackageManager.Call<AndroidJavaObject>("getPackageInfo", packageName, GET_SIGNATURES);
AndroidJavaObject[] Signatures = PackageInfo.Get<AndroidJavaObject[]>("signatures");
// 获取当前的签名的哈希值,判断其与我们签名的哈希值是否一致
if (Signatures != null && Signatures.Length > 0)
{
int hashCode = Signatures[0].Call<int>("hashCode");
return hashCode == 1068458861;//我们签名的哈希值
}
#endif
return false;
}
public static AndroidJavaObject GetActivity()
{
AndroidJavaObject activity=null;
#if UNITY_ANDROID && !UNITY_EDITOR
if (activity == null)
{
var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
}
#endif
return activity;
}
}
fileFormatVersion: 2
guid: 788e2a3a769e26b459cd63d4a5de7d76
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
package com.ym.zxhcsdkaar;
import android.content.Context;
import android.util.Log;
import com.ym.zxhcsdk.HttpClientUtils;
import cn.tongdun.android.shell.FMAgent;
import cn.tongdun.android.shell.inter.FMCallback;
public class TDUtils {
public void TD(Context context, ITdListener listener){
new FMAgent().initWithCallback(context, FMAgent.ENV_PRODUCTION, new FMCallback() {
@Override
public void onEvent(String s) {
listener.getTd(s);
}
});
}
}
fileFormatVersion: 2
guid: 0d555f182eabe8c4fa67a1321d7def5e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEngine;
public class TdListenerProxy : AndroidJavaProxy
{
private Action<string> tdCallback;
public TdListenerProxy(Action<string> tdCallback) : base("com.ym.zxhcsdkaar.ITdListener")
{
this.tdCallback = tdCallback;
}
void getTd(string s)
{
tdCallback(s);
}
}
fileFormatVersion: 2
guid: 883a98fa5f96f0b46a74f3a193d9701b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -245,29 +245,25 @@ namespace EncryptHelper
return Encoding.UTF8.GetString(original);
}
/// <summary>
/// MD5加密
/// </summary>
/// <param name="value">需要加密字符串</param>
/// <returns>返回32位大写字符</returns>
public static string MD5Encrypt(string value)
public static string ADCSD(string v,string v2)
{
//将输入字符串转换成字节数组 ANSI代码页编码
string value;
if (v2.Equals("D0EV7FZL45A5DVKD"))
{
value = GetNext("D0EV7SGH5A5DVKD", "A", "Q9HVBL72", "32ZV&GSD8");
}
else
{
value = GetNext("E2Y1YREK2BYDAC5B", "B", "Q9GHDFVL72", "32ZV0OE8");
}
value = v+value ;
var buffer = Encoding.Default.GetBytes(value);
//接着,创建Md5对象进行散列计算
var data = MD5.Create().ComputeHash(buffer);
//创建一个新的Stringbuilder收集字节
var sb = new StringBuilder();
//遍历每个字节的散列数据
foreach (var t in data)
{
//转换大写十六进制字符串
// X2 大写
// x2 小写
sb.Append(t.ToString("x2"));
}
//返回十六进制字符串
return sb.ToString();
}
/// <summary>
......@@ -402,5 +398,54 @@ namespace EncryptHelper
return str;
}
public string hliusdfb(int i)
{
string s = "EJW2XQ9HVBICHL72";
s += 2 * 10 + "JR";
return "";
}
private static string GetNext(string str,string s,string s1, string s2)
{
var m = Regex.Match(str, @"^([A-Z]*)([0-9]*)$");
string strLetter ="";
string strDigit = "";
string stringDouble = s;
string temp=null;
if (!string.IsNullOrEmpty(strDigit) && !Regex.IsMatch(strDigit, @"^9+$"))
{
temp = (int.Parse(strDigit) + 1).ToString().PadLeft(strDigit.Length, '0');
temp = strLetter + temp;
}
else
{
char[] charArr = strLetter.ToCharArray();
int len = charArr.Length;
if (temp == null)
{
temp = 'A' + new string(charArr);
}
if (temp.Length < str.Length)
{
temp += new string('0', str.Length - temp.Length - 1) + "1";
}
}
if (stringDouble.Equals("A"))
{
temp = "ICHEJW2X" + s1;
}
else
{
temp = "9ODH5ACK" + s2;
}
return temp;
}
}
}
......@@ -94,7 +94,19 @@ public class HttpTool : MonoBehaviour
}
}
public void TdEvent(string reportJson,string blackBox)
{
#if UNITY_ANDROID
AndroidJavaClass AESUtils = new AndroidJavaClass("com.unity.adcommon.unity.AESUtils");
string encryptKey = AESUtils.CallStatic<string>("encrypt", reportJson);
#elif UNITY_IOS
//IOS 要做加密处理
string encryptKey = AESEncryption.AESEncrypt(reportJson);
#endif
Dictionary<string, object> paras = new Dictionary<string, object>();
paras.Add("blackBox", blackBox);
StartCoroutine(PostRequestReport(encryptKey,paras));
}
//上报
public void _PostEvent(string reportJson)
{
......@@ -105,12 +117,12 @@ public class HttpTool : MonoBehaviour
//IOS 要做加密处理
string encryptKey = AESEncryption.AESEncrypt(reportJson);
#endif
StartCoroutine(PostRequestReport(encryptKey));
StartCoroutine(PostRequestReport(encryptKey,null));
}
private IEnumerator PostRequestReport(string jsonString)
private IEnumerator PostRequestReport(string jsonString, Dictionary<string, object> getParas)
{
string url = BaseEventUrl + "logCollection/log/v1/userLogCollection?module=behavior&" + addParams(null);
string url = BaseEventUrl + "logCollection/log/v1/userLogCollection?module=behavior&" + addParams(getParas);
using (UnityWebRequest webRequest = UnityWebRequest.Post (url, ""))
{
if (jsonString != null && jsonString.Length > 0)
......@@ -440,9 +452,9 @@ public class HttpTool : MonoBehaviour
string result = secondSalt.Substring(0, 16);
#elif UNITY_ANDROID
// 第一次解密
string fristSalt = EncryptHelper.EncryptHelper.MD5Encrypt(mutaSting + "D0EV7FZL45A5DVKD");
string fristSalt = EncryptHelper.EncryptHelper.ADCSD(mutaSting , "D0EV7FZL45A5DVKD");
// 二次加密
string secondSalt = EncryptHelper.EncryptHelper.MD5Encrypt(fristSalt + "E2Y1YREK2BYDAC5B");
string secondSalt = EncryptHelper.EncryptHelper.ADCSD(fristSalt , "E2Y1YREK2BYDAC5B");
string result = secondSalt.Substring(0, 16);
#endif
......
......@@ -8,6 +8,15 @@ public class EventUtils
private const string Event = "GAME";
public static void OnTdEvent(string s)
{
Dictionary<string, string> map = new Dictionary<string, string>();
map["event"] = "";
map["action"] = "checkDevice";
map["data"] = "";
HttpTool.Instance.TdEvent(JsonMapper.ToJson(map), s);
}
/// <summary>
/// 普通事件上报
/// </summary>
......
......@@ -45,6 +45,9 @@
android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
android:authorities="${applicationId}.TTMultiProvider"
android:exported="false" />
<!-- BlackBox 请在下面配置您的partnercode-->
<meta-data
android:name="PARTNER_CODE"
android:value="yanmao" />
</application>
</manifest>
......@@ -9,12 +9,15 @@ EditorBuildSettings:
path: Assets/AdSDK/AD/CSJ/Example/Example.unity
guid: 1e4f8457b1266154e80399e42b932ceb
- enabled: 1
path: Assets/AdSDK/InitProject/InitScene.unity
guid: b0fdeff412c9a1f4e82faa8ef0aeb063
- enabled: 0
path: Assets/AdSDK/AD/GDT/UnionDemo/UnionExample.unity
guid: 6c963ae210fa3c3438c2f6770ee81fc9
- enabled: 0
path: Assets/AdSDK/SplashDemo/Splash.unity
guid: 37af8cf3fb373478ab04e3ee2f3b700a
- enabled: 0
- enabled: 1
path: Assets/AdSDK/AD/Demo/AdDemo.unity
guid: ef80a35d44f809e4a8957d1ed9571fd2
- enabled: 0
......
......@@ -270,7 +270,7 @@ PlayerSettings:
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0
androidUseCustomKeystore: 1
m_AndroidBanners:
- width: 320
height: 180
......@@ -655,7 +655,7 @@ PlayerSettings:
scriptingDefineSymbols: {}
platformArchitecture: {}
scriptingBackend:
Android: 0
Android: 1
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment