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:
@@ -7,7 +7,7 @@
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<application android:extractNativeLibs="true" android:name="com.unity3d.player.TYApp"
|
||||
tools:replace="android:usesCleartextTraffic,android:fullBackupContent"
|
||||
tools:replace="android:usesCleartextTraffic"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name="com.unity3d.player.TYUnityActivity"
|
||||
android:theme="@style/UnityThemeSelector">
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.unity3d.player;
|
||||
|
||||
public class ChannelHelpers {
|
||||
|
||||
public static final String CHANNEL = "Flexion";
|
||||
|
||||
static void register() {
|
||||
SDKManager.registerHelper(CHANNEL, new FlexionSDKHelper());
|
||||
}
|
||||
|
||||
|
||||
// Flexion provides price in micros and currency code, so no normalization needed
|
||||
// 支付的变化,可能会修改这里
|
||||
public static String normalizeSkuList(String msg) {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<application android:extractNativeLibs="true" android:name="com.unity3d.player.TYApp"
|
||||
<application android:extractNativeLibs="true" android:name="com.unity3d.player.TYApp"
|
||||
tools:replace="android:usesCleartextTraffic"
|
||||
tools:overrideLibrary="com.tuyoo.gamesdk"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity android:name="com.unity3d.player.TYUnityActivity"
|
||||
android:theme="@style/UnityThemeSelector">
|
||||
|
||||
@@ -1,9 +1,44 @@
|
||||
package com.unity3d.player;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class ChannelHelpers {
|
||||
public static final String CHANNEL = "Rustore";
|
||||
|
||||
static void register() {
|
||||
// Rustore uses default behavior, no additional SDKHelper yet
|
||||
// Rustore uses default behavior, no additional SDKHelper
|
||||
}
|
||||
|
||||
public static String normalizeSkuList(String msg) {
|
||||
if (msg == null || msg.isEmpty()) return msg;
|
||||
try {
|
||||
JSONArray products = new JSONArray(msg);
|
||||
for (int i = 0; i < products.length(); i++) {
|
||||
JSONObject p = products.getJSONObject(i);
|
||||
|
||||
// price is in kopecks, convert to micros: kopecks * 10000
|
||||
String price = p.optString("price", "0");
|
||||
long micros = Long.parseLong(price) * 10000;
|
||||
p.put("price_amount_micros", String.valueOf(micros));
|
||||
|
||||
// Map currency → price_currency_code
|
||||
String currency = p.optString("currency", "");
|
||||
if (!currency.isEmpty()) {
|
||||
p.put("price_currency_code", currency);
|
||||
}
|
||||
|
||||
// Convert display price: "199" → "₽1.99"
|
||||
float rubles = Float.parseFloat(price) / 100;
|
||||
p.put("price", String.format("₽%s", rubles));
|
||||
}
|
||||
return products.toString();
|
||||
} catch (JSONException e) {
|
||||
Log.e("ChannelHelpers", "normalizeSkuList error: " + e.getMessage());
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user