feat: merge rustore test UI and unify SKU format across channels
- Merge VK login/link/check and Review test buttons from dev_rustore - Unify Rustore/GooglePlay SKU format via ChannelHelpers.normalizeSkuList() - Fix ChannelConfig runtime sync: Java InitSDK sets channel from ChannelHelpers.CHANNEL - Fix AndroidMinSdkVersion 25→26 for tuyoosdk compatibility - Fix Flexion AndroidManifest tools:replace missing fullBackupContent value - Add [CHANNEL-VERIFY] debug logs for channel verification Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -6,4 +6,8 @@ public class ChannelHelpers {
|
||||
static void register() {
|
||||
// GooglePlay uses default behavior, no additional SDKHelper
|
||||
}
|
||||
|
||||
public static String normalizeSkuList(String msg) {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +77,16 @@ public class SDKManager {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static void InitSDK(Activity activity, String ch) {
|
||||
channel = ch != null ? ch : "GooglePlay";
|
||||
channel = ChannelHelpers.CHANNEL;
|
||||
ChannelHelpers.register();
|
||||
if (!channel.equals(ChannelHelpers.CHANNEL)) {
|
||||
Log.e(TAG, "Channel mismatch! Helpers=" + ChannelHelpers.CHANNEL + " expected=" + channel);
|
||||
}
|
||||
sdkHelper = helperMap.get(channel);
|
||||
Log.i(TAG, "InitSDK channel=" + channel + " helper=" + (sdkHelper != null ? sdkHelper.getClass().getSimpleName() : "none"));
|
||||
Log.i(TAG, "[CHANNEL-VERIFY] Java InitSDK channel=" + channel
|
||||
+ " fromCSharp=" + ch
|
||||
+ " helper=" + (sdkHelper != null ? sdkHelper.getClass().getSimpleName() : "default"));
|
||||
|
||||
// Sync channel to C# ChannelConfig
|
||||
UnityPlayer.UnitySendMessage(ConfigManager.UNITY_FACADE_NAME,
|
||||
"SetChannelFromNative", channel);
|
||||
|
||||
if (sdkHelper != null) {
|
||||
sdkHelper.init(activity);
|
||||
@@ -422,7 +425,7 @@ public class SDKManager {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", code);
|
||||
if (code == SDKCallBack.Extend.EXTEND_CODE_SUCCESS) {
|
||||
result.put("respObj", msg);
|
||||
result.put("respObj", ChannelHelpers.normalizeSkuList(msg));
|
||||
} else {
|
||||
Log.e(TAG, "thirdExtend failed: " + msg);
|
||||
result.put("thirdExtend_errStr", msg);
|
||||
|
||||
@@ -138,6 +138,13 @@ namespace tysdk
|
||||
#endif
|
||||
}
|
||||
|
||||
// Called from Java SDKManager.InitSDK to sync channel
|
||||
public void SetChannelFromNative(string ch)
|
||||
{
|
||||
ChannelConfig.SetChannel(ch);
|
||||
UnityEngine.Debug.Log($"[CHANNEL-VERIFY] C# SetChannelFromNative → channel={ch}, payType={ChannelConfig.PayType}, loginTimeout={ChannelConfig.LoginTimeoutSeconds}");
|
||||
}
|
||||
|
||||
/*================================================
|
||||
_ _
|
||||
/ \ ___ ___ ___ _ _ _ __ | |_
|
||||
|
||||
@@ -94,17 +94,11 @@ namespace tysdk
|
||||
public string price_currency_code;
|
||||
public string title;
|
||||
public string type;
|
||||
|
||||
// RuStore specific
|
||||
public string currency;
|
||||
public string price_amount;
|
||||
|
||||
public string ProdPriceStr => ChannelConfig.Channel == "Rustore"
|
||||
? $"₽{ProdPrice}"
|
||||
: price;
|
||||
public float ProdPrice => ChannelConfig.Channel == "Rustore"
|
||||
? float.Parse(price) / 100
|
||||
: float.Parse(price_amount_micros) / 1000000;
|
||||
public string ProdPriceStr => price;
|
||||
public float ProdPrice => float.Parse(price_amount_micros) / 1000000;
|
||||
public string ProdID => ourProductId;
|
||||
public string ProdKey => productId;
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace tysdk
|
||||
using (var activityCls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
{
|
||||
var activity = activityCls.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
UnityEngine.Debug.Log("[CHANNEL-VERIFY] C# InitSDK → ChannelConfig.Channel=" + ChannelConfig.Channel);
|
||||
sdkManager.CallStatic("InitSDK", activity, ChannelConfig.Channel);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user