getGameSignature
Get Game Signature
The getGameSignature method retrieves a game's launch signature, including its metadata and signature hash. The returned string can be passed to startGameBySignature.
Prerequisites
Before calling either overload, call SUDOP.initSDK and wait for initialization to succeed. Retrieving a signature does not require calling auth; launching a game still requires successful authentication.
Method Declaration
// Get a signature without specifying a language
public static void getGameSignature(String gameID, SUDOPGetGameSignatureListener listener);
// Get a signature with an optional language
public static void getGameSignature(String gameId, String language, SUDOPGetGameSignatureListener listener);The original overload remains available and is equivalent to passing null for language.
Parameters
| Parameter | Type | Description |
|---|---|---|
| gameId / gameID | String | The unique identifier of the game to obtain a signature for. |
| language | String | Optional language for retrieving the game signature. Use a BCP 47 language tag, such as zh-CN or en-US. |
| listener | SUDOPGetGameSignatureListener | Listener for the signature retrieval result. |
Use the original overload or pass null to retrieve a signature without specifying a language.
SUDOPGetGameSignatureListener
void onSuccess(String gameSignature): Retrieval succeeded. Pass the returned signature string unchanged to the launch API.void onFailure(int retCode, String retMsg): Retrieval failed. The callback provides an error code and description.
Multilingual Metadata
The returned gameSignature JSON contains game_meta_str, which is itself a serialized JSON string. Its multilingual fields include:
| Field in game_meta_str | JSON Type | Description |
|---|---|---|
| game_name | object | Game names by language. |
| icon | object | Game icon URLs by language, using the same map structure as game_name. |
| game_icon | string | Legacy game icon URL, available as a fallback. |
Language tags such as zh-CN and en-US are map keys; default identifies the default value. For example, the relevant fields after parsing game_meta_str may be:
{
"game_name": {
"default": "Game",
"zh-CN": "游戏"
},
"icon": {
"default": "https://example.com/icon.png",
"zh-CN": "https://example.com/icon-zh-CN.png"
},
"game_icon": "https://example.com/legacy-icon.png"
}This example shows only selected metadata fields. Pass the original signature unchanged to the launch API. See startGame for loading view language selection and icon fallback.
Example Code
String gameId = "game_101";
String language = "zh-CN";
SUDOP.getGameSignature(gameId, language, new SUDOPGetGameSignatureListener() {
@Override
public void onSuccess(String gameSignature) {
// Pass gameSignature unchanged to SUDOP.startGameBySignature when needed.
// Do not log the signature or its sensitive contents.
}
@Override
public void onFailure(int retCode, String retMsg) {
Log.e("SUDOP", "Failed to get game signature: " + retCode + ", " + retMsg);
}
});Pass your app's selected BCP 47 language tag, using the same value as getGameInformation.
Notes
- Security:
gameSignaturecontains sensitive authorization information. Pass it only in memory and avoid logging or persisting it. - Validity: The signature has a limited validity period. If launch returns a signature-expired error, retrieve a new signature.
- Loading view language: Pass the returned signature unchanged to startGameBySignature(signature, language, listener), supplying the current Activity language to select the loading view game name and icon. The two-argument method, or a null or empty
language, uses the loading view's current locale. For launching by game ID, use startGame(gameId, language, listener).
