Add Discord APKTool decompilation (Smali source for modding)

- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3
- APKTool decompilation (Smali bytecode) for modding and rebuilding APK
- Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures
- Includes full Smali source, resources, and native libraries
- Ready to rebuild APK after modifications with apktool b command
- Added comprehensive README-apktool.md with modding guide

This branch complements the JADX branches:
- Use JADX (main/discord-community) to UNDERSTAND code (readable Java)
- Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali)

Total: 44,417 files, 538.51 MB Smali source code
This commit is contained in:
2026-02-18 16:13:44 -08:00
parent c080f0d97f
commit f3960ee359
44288 changed files with 10998761 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/campaign_state.proto";
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/session_counters.proto";
import "gatewayprotocol/v1/static_device_info.proto";
option swift_prefix = "Gateway";
message AdDataRefreshRequest {
// Session Counters tracked by the SDK
SessionCounters session_counters = 1;
// Static Device Info collected during SDK initialization. Information collected here doesn't change during session.
StaticDeviceInfo static_device_info = 2;
// Dynamic Device Info collected at request time. Information collected here can change during session.
DynamicDeviceInfo dynamic_device_info = 3;
// List of campaigns currently loaded
CampaignState campaign_state = 4;
// Impression Opportunity ID
bytes impression_opportunity_id = 5;
// Ad Data Refresh Token
bytes ad_data_refresh_token = 6;
}

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/error.proto";
option swift_prefix = "Gateway";
message AdDataRefreshResponse {
// non empty if fill otherwise empty
bytes ad_data = 1;
// version of the ad markup. Use to determine which parser to use.
int32 ad_data_version = 2;
// non empty if fill otherwise empty
bytes tracking_token = 3;
// Ad Data Refresh Token to be used to refresh ad markup
bytes ad_data_refresh_token = 4;
// If set, there was an error processing the request.
optional Error error = 5;
}

View File

@@ -0,0 +1,17 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message AdPlayerConfigRequest {
// A configuration token which can be exchanged for a ad player configuration and tracking token.
// Retrieved from Header Bidding Ad Markup
bytes configuration_token = 1;
// The Placement ID for which Ad Markup is being loaded.
string placement_id = 2;
// Locally cached WebView version
optional int32 webview_version = 9;
// Impression Opportunity ID
bytes impression_opportunity_id = 4;
}

View File

@@ -0,0 +1,23 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/error.proto";
import "gatewayprotocol/v1/webview_configuration.proto";
option swift_prefix = "Gateway";
message AdPlayerConfigResponse {
// Tracking Token is used to track operative events during impression opportunity.
bytes tracking_token = 1;
// Impression Configuration is used by Ad Player(WebView) to render the ad.
bytes impression_configuration = 2;
// A version of the impression configuration.
int32 impression_configuration_version = 3;
// WebView configuration which should be used by Native to start Ad Player.
optional WebViewConfiguration webview_configuration = 4;
// Ad Data Refresh Token is used to refresh the ad if impression occurred.
bytes ad_data_refresh_token = 5;
// If set, there was an error processing the request.
optional Error error = 6;
}

View File

@@ -0,0 +1,50 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/campaign_state.proto";
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/session_counters.proto";
import "gatewayprotocol/v1/static_device_info.proto";
option swift_prefix = "Gateway";
enum AdRequestType {
AD_REQUEST_TYPE_UNSPECIFIED = 0;
AD_REQUEST_TYPE_FULLSCREEN = 1;
AD_REQUEST_TYPE_BANNER = 2;
}
message BannerSize {
int32 width = 1;
int32 height = 2;
}
// AdRequest is the request sent from the SDK to the Gateway
// It contains all the information needed to make a decision on what ad to return
message AdRequest {
// Session Counters tracked by the SDK
SessionCounters session_counters = 1;
// Static Device Info collected during SDK initialization. Information collected here doesn't change during session.
StaticDeviceInfo static_device_info = 2;
// Dynamic Device Info collected at request time. Information collected here can change during session.
DynamicDeviceInfo dynamic_device_info = 3;
// Current campaign state in the SDK, will be populated only for full screen video ads and contain information about them
CampaignState campaign_state = 4;
// Impression Opportunity ID
bytes impression_opportunity_id = 5;
// Placement ID which is requested to be loaded
string placement_id = 6;
// Flag which indicates if Impression Configuration should be returned in the ad response on fill
bool request_impression_configuration = 7;
// SCAR Signal
bytes scar_signal = 8;
// Locally cached WebView version
optional int32 webview_version = 9;
// TCF String provided by Publisher
optional bytes tcf = 10;
// Ad Request Type
optional AdRequestType ad_request_type = 11;
// Banner Size
optional BannerSize banner_size = 12;
}

View File

@@ -0,0 +1,32 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/error.proto";
import "gatewayprotocol/v1/webview_configuration.proto";
option swift_prefix = "Gateway";
// This is the response from the Gateway when requesting an ad
message AdResponse {
// Tracking Token is used to track operative events during impression opportunity.
bytes tracking_token = 1;
// Impression Configuration is used by Ad Player(WebView) to render the ad.
bytes impression_configuration = 2;
// A version of the impression configuration.
int32 impression_configuration_version = 3;
// WebView configuration which should be used by Native to start Ad Player.
optional gatewayprotocol.v1.WebViewConfiguration webview_configuration = 4;
// Ad Data Refresh Token is used to refresh the ad if impression occurred.
bytes ad_data_refresh_token = 5;
// A blob of data which contains an ad to show.
// This blob should be provided to Ad Player to parse and cache the ad.
// Currently it is a Auction V6 response.
bytes ad_data = 6;
// A version of the ad data. Can be used to determine which parser to use.
int32 ad_data_version = 7;
// If set, there was an error processing the request.
optional Error error = 8;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message AllowedPii {
bool idfa = 1;
bool idfv = 2;
}

View File

@@ -0,0 +1,109 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "google/protobuf/timestamp.proto";
import "gatewayprotocol/v1/header_bidding_token.proto";
option swift_prefix = "Gateway";
message BidRequestEvent {
string mediation_auction_id = 1;
optional string mediation_server = 2;
optional int64 tmax = 3;
optional string game_id = 4;
optional string placement_id = 5;
optional string ad_type = 6;
optional float bid_floor = 7;
optional string bid_floor_currency = 8;
optional bool test = 9;
optional int32 test_id = 10;
optional string bundle = 11;
optional string sdk_version = 12;
optional TokenInfo token_info = 13;
optional string display_manager = 14;
repeated string blocked_apps = 15;
repeated string blocked_categories = 16;
repeated string blocked_domains = 17;
optional App app = 18;
optional User user = 19;
optional Publisher publisher = 20;
optional Device device = 21;
optional Geo geo = 22;
optional GatewayStatus status = 23;
optional string raw_bid_request = 24;
google.protobuf.Timestamp timestamp = 25;
}
message TokenInfo {
optional TokenType token_type = 1;
optional bool is_bold_sdk = 2;
optional HeaderBiddingToken header_bidding_token = 3;
}
message App {
optional string name = 1;
optional string bundle = 2;
repeated string cat = 3;
optional string store_url = 4;
}
message Publisher {
optional string id = 1;
optional string name = 2;
optional string domain = 3;
}
message User {
optional string id = 1;
optional string consent = 2;
}
message Device{
optional string ua = 1;
optional string ip = 2;
optional int32 device_type = 3;
optional string make = 4;
optional string model = 5;
optional string os = 6;
optional string osv = 7;
}
message Geo {
optional float lat = 1;
optional float lon = 2;
optional int32 type = 3;
optional string country = 4;
optional string region = 5;
optional string city = 6;
optional string zip = 7;
}
enum TokenType {
TOKEN_TYPE_UNSPECIFIED = 0;
TOKEN_TYPE_NATIVE = 1;
TOKEN_TYPE_HB = 2;
TOKEN_TYPE_HB_SCAR = 3;
}
message GatewayStatus {
optional bool is_error = 1;
optional GatewayError error = 2;
repeated string message = 3;
}
enum GatewayError {
GATEWAY_ERROR_UNSPECIFIED = 0;
GATEWAY_ERROR_PARSE_REQUEST = 1;
GATEWAY_ERROR_NIL_USER = 2;
GATEWAY_ERROR_NIL_DEVICE = 3;
GATEWAY_ERROR_NIL_TOKEN = 4;
GATEWAY_ERROR_INVALID_IMPRESSION_COUNT = 5;
GATEWAY_ERROR_MISSING_PLACEMENT_ID = 6;
GATEWAY_ERROR_NATIVE_TOKEN_RESOLUTION = 7;
GATEWAY_ERROR_UA_TOKEN_DECRYPTION = 8;
GATEWAY_ERROR_HB_TOKEN_DECODE = 9;
GATEWAY_ERROR_HB_TOKEN_UNMARSHAL = 10;
GATEWAY_ERROR_BANNER_GEO_THROTTLED = 11;
}

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/timestamps.proto";
option swift_prefix = "Gateway";
message Campaign {
// Version of the campaign token
int32 data_version = 1;
// Defined in tracking/v1/loaded_campaign_token.proto
bytes data = 2;
// Placement ID for which this campaign is loaded
string placement_id = 3;
// Impression opportunity ID for which this campaign is loaded
bytes impression_opportunity_id = 4;
// Timestamps for when the campaign was loaded (when Ad Loaded event was fired)
Timestamps load_timestamp = 5;
// Timestamps for when the campaign was shown (when Show call was made and it was moved from loaded_campaigns to shown_campaigns)
optional Timestamps show_timestamp = 6;
}
// This structure will be converted to Loaded Campaigns required by exchange.
message CampaignState {
// List of campaigns currently loaded and ready to be shown by SDK
repeated Campaign loaded_campaigns = 1;
// Last N campaigns shown by SDK in current session
repeated Campaign shown_campaigns = 2;
}

View File

@@ -0,0 +1,51 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
enum Platform {
PLATFORM_UNSPECIFIED = 0;
PLATFORM_ANDROID = 1;
PLATFORM_IOS = 2;
}
enum MediationProvider {
MEDIATION_PROVIDER_UNSPECIFIED = 0;
// Non well-known mediation provider, custom_mediation_name field should contain full mediation name from SDK
MEDIATION_PROVIDER_CUSTOM = 1;
// AdMob Mediation. Should match following values set in mediation.name: AdMob
MEDIATION_PROVIDER_ADMOB = 2;
// MAX Mediation. Should match following values set in mediation.name: MAX, AppLovinSdk_*, max
MEDIATION_PROVIDER_MAX = 3;
// Level Play Mediation. Should match following values set in mediation.name: ironSource, ironsource, IronSource
MEDIATION_PROVIDER_LEVELPLAY = 4;
}
// Information about the client who is making request
message ClientInfo {
// SDK Version represented as integer for example 4710
uint32 sdk_version = 1;
// SDK Version represented as string for example 4.7.1
string sdk_version_name = 2;
// Game ID used to initialize the SDK
string game_id = 3;
// Test Mode flag provided during initialization
bool test = 4;
// Platform of the client
Platform platform = 5;
// The well-known mediation provider used by the client
MediationProvider mediation_provider = 6;
// Non well-known mediation provider name, filled only if mediation_provider equals to MEDIATION_PROVIDER_CUSTOM
optional string custom_mediation_name = 7;
// The mediation provider version
optional string mediation_version = 8;
// The Omid partner version
optional string omid_partner_version = 9;
// The Omid version
optional string omid_version = 10;
// Check SDK development platform (e.g. Unity, Xamarin, Adobe Air, etc.)
optional string sdk_development_platform = 11;
// Admob SDK version if exists
optional string scar_version_name = 12;
}

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
enum DeveloperConsentType {
DEVELOPER_CONSENT_TYPE_UNSPECIFIED = 0;
DEVELOPER_CONSENT_TYPE_CUSTOM = 1;
DEVELOPER_CONSENT_TYPE_NON_BEHAVIORAL = 2; // "user.nonBehavioral.value"
DEVELOPER_CONSENT_TYPE_PIPL_CONSENT = 3; // "pipl.consent.value"
DEVELOPER_CONSENT_TYPE_PRIVACY_CONSENT = 4; // "privacy.consent.value"
DEVELOPER_CONSENT_TYPE_GDPR_CONSENT = 5; // "gdpr.consent.value"
DEVELOPER_CONSENT_TYPE_USER_OVER_AGE_LIMIT = 6; // "privacy.useroveragelimit.value"
}
enum DeveloperConsentChoice {
DEVELOPER_CONSENT_CHOICE_UNSPECIFIED = 0;
DEVELOPER_CONSENT_CHOICE_TRUE = 1;
DEVELOPER_CONSENT_CHOICE_FALSE = 2;
}
// A consent option provided by the developer stored in Public storage via Metadata API.
message DeveloperConsentOption {
// A Consent Type provided by the developer
DeveloperConsentType type = 1;
// A custom consent type provided by the developer, if there is not a defined consent type.
optional string custom_type = 2;
// The developer's choice for this consent type.
DeveloperConsentChoice value = 3;
}
// A developer's consent.
// Because we need to be able to send a list of consent options to the server.
message DeveloperConsent {
// The developer's consent options.
repeated DeveloperConsentOption options = 1;
}

View File

@@ -0,0 +1,83 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/timestamps.proto";
option swift_prefix = "Gateway";
enum DiagnosticEventType {
DIAGNOSTIC_EVENT_TYPE_UNSPECIFIED = 0;
DIAGNOSTIC_EVENT_TYPE_CUSTOM = 1;
}
enum DiagnosticTagType {
DIAGNOSTIC_TAG_TYPE_UNSPECIFIED = 0;
DIAGNOSTIC_TAG_TYPE_CUSTOM = 1;
}
// Severity of diagnostic events which are allowed to be sent
enum DiagnosticEventsSeverity {
DIAGNOSTIC_EVENTS_SEVERITY_UNSPECIFIED = 0;
DIAGNOSTIC_EVENTS_SEVERITY_DEBUG = 1;
DIAGNOSTIC_EVENTS_SEVERITY_INFO = 2;
DIAGNOSTIC_EVENTS_SEVERITY_WARNING = 3;
DIAGNOSTIC_EVENTS_SEVERITY_ERROR = 4;
DIAGNOSTIC_EVENTS_SEVERITY_ALWAYS = 5;
}
enum DiagnosticAdType {
DIAGNOSTIC_AD_TYPE_UNSPECIFIED = 0;
DIAGNOSTIC_AD_TYPE_FULLSCREEN = 1;
DIAGNOSTIC_AD_TYPE_BANNER = 2;
}
// A tag attached to a diagnostic event
message DiagnosticTag {
// Tag type using predefined integer representation
repeated DiagnosticTagType tag_type = 1;
// Tag type represented as string (event_type must be set to
// DIAGNOSTIC_TAG_TYPE_CUSTOM)
optional string custom_tag_type = 2;
// A value attached to a tag
oneof value {
string string_value = 3;
int32 int_value = 4;
}
}
// A diagnostic event
message DiagnosticEvent {
// Event type using predefined integer representation
DiagnosticEventType event_type = 1;
// Event type represented as string (event_type must be set to
// DIAGNOSTIC_EVENT_TYPE_CUSTOM)
optional string custom_event_type = 2;
// Device state when event was created
Timestamps timestamps = 3;
// Optional time value associated with event, in milliseconds
optional double time_value = 4;
// An alternative approach to handle tags
map<string, string> string_tags = 5;
map<string, uint32> int_tags = 6;
// The unique auto-incrementing event id for each event - replaces the batch
// ID to allow for retries to add to batches
int32 event_id = 7;
// Impression Opportunity ID of associated AdObject
optional bytes impression_opportunity_id = 8;
// Placement ID of associated AdObject
optional string placement_id = 9;
// Ad type of associated AdObject
optional DiagnosticAdType ad_type = 10;
// AdObject loaded with header bidding ad markup
optional bool is_header_bidding = 11;
}
message DiagnosticEventRequest {
// A batch of diagnostic events
repeated DiagnosticEvent batch = 1;
}

View File

@@ -0,0 +1,100 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/network_capability_transports.proto";
option swift_prefix = "Gateway";
enum ConnectionType {
CONNECTION_TYPE_UNSPECIFIED = 0;
CONNECTION_TYPE_WIFI = 1;
CONNECTION_TYPE_CELLULAR = 2;
}
message DynamicDeviceInfo {
reserved 4;
message Android {
optional bool network_connected = 1;
optional int32 network_type = 2;
optional bool network_metered = 3;
optional int32 telephony_manager_network_type = 4;
optional bool adb_enabled = 5;
optional bool usb_connected = 6;
optional double volume = 7;
optional double max_volume = 8;
optional int64 device_up_time = 9;
optional int64 device_elapsed_realtime = 10;
optional bool airplane_mode = 11;
optional bool stay_on_while_plugged_in = 12;
optional bool sd_card_present = 13;
// Network capabilities provided by Android API from https://developer.android.com/reference/android/net/NetworkCapabilities
NetworkCapabilityTransports network_capability_transports = 14;
optional int32 charging_type = 15;
}
message Ios {
optional string current_radio_access_technology = 1;
optional uint32 network_reachability_flags = 2;
repeated string nw_path_interfaces = 3;
repeated string locale_list = 4;
optional int32 current_ui_theme = 5;
optional string device_name = 6;
optional double volume = 7;
optional int32 tracking_auth_status = 8;
optional int64 device_up_time_with_sleep = 9;
optional int64 device_up_time_without_sleep = 10;
}
// Language used for UI on the phone
optional string language = 1;
// Network Operator Code if available
optional string network_operator = 2;
// Network Operator Name if available
optional string network_operator_name = 3;
// Total free disk space in kilobytes
optional int64 free_disk_space = 5;
// Total free RAM memory in kilobytes
optional int64 free_ram_memory = 6;
// Is a wired headset connected
optional bool wired_headset = 7;
// Time zone of the device
optional string time_zone = 8;
// Time zone offset of the device
optional int64 time_zone_offset = 9;
// Limited Tracking provided by Apple and Google Play
optional bool limited_tracking = 10;
// Limited Open Advertising Tracking provided by HUAWEI
optional bool limited_open_ad_tracking = 11;
// Battery level
optional double battery_level = 14;
// Battery status
optional int32 battery_status = 15;
// Connection type of the device
optional ConnectionType connection_type = 16;
// Is Application active
optional bool app_active = 17;
// Low power mode status
optional bool low_power_mode = 18;
// The user id used for Iron Source
optional string user_id = 19;
// Screen width in pixels which takes into account the device orientation
optional uint32 screen_width = 20;
// Screen height in pixels which takes into account the device orientation
optional uint32 screen_height = 21;
oneof platform_specific {
// Android specific information
Android android = 12;
// iOS specific information
Ios ios = 13;
}
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// Error is a general error returned from a service. It can be returned via the payload
// to indicate that an error occurred within the service itself, or alongside the response
// to indicate failure to communicate with that service (reachability, timeout, etc.)
message Error {
// The text of the error.
string error_text = 2;
}

View File

@@ -0,0 +1,17 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// The request to upload SCAR signals.
message GetTokenEventRequest {
// SCAR signal for rewarded ads.
optional bytes rewarded = 1;
// SCAR signal for interstitial ads.
optional bytes interstitial = 2;
// SCAR signal for banner ads.
optional bytes banner = 3;
// Token UUID associated with this signals
bytes token_id = 4;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// Ad Markup used in a header bidding integration
message HeaderBiddingAdMarkup {
// A blob of data which contains an ad to show.
// This blob should be provided to Ad Player to parse and cache the ad.
// Currently it is a Auction V6 response.
bytes ad_data = 1;
// A version of the ad data. Can be used to determine which parser to use.
int32 ad_data_version = 2;
// Configuration Token which can be used to fetch Ad Player Configuration.
bytes configuration_token = 3;
}

View File

@@ -0,0 +1,34 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/campaign_state.proto";
import "gatewayprotocol/v1/client_info.proto";
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/pii.proto";
import "gatewayprotocol/v1/session_counters.proto";
import "gatewayprotocol/v1/static_device_info.proto";
import "gatewayprotocol/v1/timestamps.proto";
import "gatewayprotocol/v1/universal_request.proto";
import "gatewayprotocol/v1/initialization_data.proto";
option swift_prefix = "Gateway";
message HeaderBiddingToken {
bytes token_id = 1;
int32 token_number = 2;
bytes session_token = 3;
ClientInfo client_info = 4;
Timestamps timestamps = 5;
SessionCounters session_counters = 6;
StaticDeviceInfo static_device_info = 7;
DynamicDeviceInfo dynamic_device_info = 8;
optional Pii pii = 9;
CampaignState campaign_state = 10;
optional bytes tcf = 11;
optional bool scar_signals_collected = 12;
// Should be set if request is made without session token
optional LimitedSessionToken limited_session_token = 13;
// Should be set if request is made without session token and the SDK is initializing
optional InitializationData initialization_data = 14;
}

View File

@@ -0,0 +1,16 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/static_device_info.proto";
option swift_prefix = "Gateway";
// An event which should be sent as soon as SDK completed initialization.
message InitializationCompletedEventRequest {
// Static Device Info properties
StaticDeviceInfo static_device_info = 1;
// Dynamic Device Info properties
DynamicDeviceInfo dynamic_device_info = 2;
}

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/initialization_request.proto";
import "gatewayprotocol/v1/universal_request.proto";
option swift_prefix = "Gateway";
message InitializationData {
optional InitializationRequest initialization_request = 1;
optional UniversalRequest.SharedData shared_data = 2;
}

View File

@@ -0,0 +1,60 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/client_info.proto";
option swift_prefix = "Gateway";
// InitializationRequest is the request sent by the SDK to the gateway.
// This information is also required to generate Install Event.
message InitializationDeviceInfo {
string bundle_id = 1;
string device_make = 2;
string device_model = 3;
string os_version = 4;
optional int32 tracking_auth_status = 5;
int64 total_disk_space = 6;
int64 total_ram_memory = 7;
string hashed_device_name = 8;
int64 current_ui_theme = 9;
string network_operator = 10;
double battery_level = 11;
int32 battery_status = 12;
int64 system_boot_time = 13;
string language = 14;
string local_list = 15;
string connection_type = 16;
}
// InitializationRequest is the request sent by the SDK to the gateway
message InitializationRequest {
ClientInfo client_info = 1;
// User Consent and privacy context stored on the device
optional bytes privacy = 2;
// Install Identifier stored on the device
string idfi = 3;
// Session ID generated on the device. This can be shared across multiple SDK/products.
bytes session_id = 4;
// Optional cache that can be provided by the gateway and stored locally on
// the SDK this allows for a reduction in cross cluster traffic + latency
// controlled by the gateway
optional bytes cache = 5;
// Optional legacy flow user consent. This structure is locally stored in Storage API
// Stored in private storage with keys `privacy.*`, `pipl.*` and `unity.privacy.permissions.*`; contains JSON with flatten tree
optional string legacy_flow_user_consent = 6;
// AUID provided by Level Play SDK
optional bytes auid = 7;
// Unity Analytics User ID
// from Unity engine Modules/UnityAnalytics/CoreStats/UnityConnectService.cpp
// stored using 'unity.cloud_userid' key
optional string analytics_user_id = 8;
// Device Info which is requried by initialization request
InitializationDeviceInfo device_info = 9;
// Flag which indicates if it is first initialization after install
// Should be backward compatible with legacy flow
// store using Storage API under key configuration.hasInitialized
bool is_first_init = 10;
// AUID provided by Level Play SDK in string format
optional string auid_string = 11;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/error.proto";
import "gatewayprotocol/v1/native_configuration.proto";
option swift_prefix = "Gateway";
enum AdFormat {
AD_FORMAT_UNSPECIFIED = 0;
AD_FORMAT_INTERSTITIAL = 1;
AD_FORMAT_REWARDED = 2;
AD_FORMAT_BANNER = 3;
}
message Placement {
AdFormat ad_format = 1;
}
message InitializationResponse {
// Native Configuration contains feature flags and settings to be consumed by Native SDK
NativeConfiguration native_configuration = 1;
// Can be used to override URL to be used for accessing the gateway
optional string universal_request_url = 2;
// If set, there was an error processing the request.
optional Error error = 3;
// If set, Native SDK must send initialization completed request to the gateway
bool trigger_initialization_completed_request = 4;
// Count of last show campaigns to be tracked and be sent to the gateway in CampaignState
int32 count_of_last_shown_campaigns = 5;
// Placements to be used for SCAR signal collection for waterfall
map<string, Placement> scar_placements = 6;
// AdFormats eligible for SCAR signal collection for header bidding
repeated AdFormat scar_eligible_formats = 7;
}

View File

@@ -0,0 +1,34 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/allowed_pii.proto";
import "gatewayprotocol/v1/session_counters.proto";
option swift_prefix = "Gateway";
message MutableData {
// This current state will be sent on every response from the gateway and will
// be expected to be returned on every request (other than the initial request)
optional bytes current_state = 1;
// The session token will only be returned if it has been modified by the
// server - the majority of requests are expected to not contain the session
// token At least 1 session token will be returned for every session
optional bytes session_token = 10;
// The privacy object will only be returned if the one stored on the device
// should be updated. It contains information about the current consent and privacy context
optional bytes privacy = 11;
// The session counters will only be returned if they need to be updated based
// on gateway logic
optional SessionCounters session_counters = 12;
// Represents the PII types that can be sent to the gateway inside the
// following requests
optional AllowedPii allowed_pii = 13;
// Allows for the gateway to update the cache at any point (most commonly on
// initialization and first add request for identity caching)
optional bytes cache = 14;
// Passes the fsm to the sdk to be provided adViewer/privacyViewer. This can
// be the entire FSM or just an ID/URL to fetch it from a CDN. This should be
// passed to every show request to the adViewer
optional bytes privacy_fsm = 15;
}

View File

@@ -0,0 +1,126 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/diagnostic_event_request.proto";
option swift_prefix = "Gateway";
// Message contains configuration for retry
message RequestRetryPolicy {
// Maximum total elapsed time (ms) for a request including for all retries -
// also provides TTL for local storage, if enabled. For example operative
// events could have a 7 day max duration, and adRequests might have only
// 2000ms (depending on mediator etc)
int32 max_duration = 1;
// The minimum time (ms) before retrying a request
int32 retry_wait_base = 2;
// The maximum time (ms) before retrying a request - any inter-request delay
// should not exceed this value (used on long max duration)
int32 retry_max_interval = 3;
// The jitter percentage (0.0-1.0) that should be applied to the overall delay
float retry_jitter_pct = 4;
// The retry scaling factor that should be used to create the time delay
// between the requests
float retry_scaling_factor = 5;
// Whether or not the native SDK should store the request to be retried at a
// later time (used on long max duration requests)
bool should_store_locally = 6;
// The formula for calculating the delay between retries is:
// interval = (retry_wait_base * retry_scaling_factor * retry_count) +
// (retry_wait_base * random(retry_jitter_pct))
// if interval > retry_max_interval then interval = retry_max_interval
// if elapsed_time + interval > max_duration then don't retry
// Note: A request must always be made at least once, retry_count does
// not need to be preserved between sessions, retry_count must start at 1
}
// Message contains configuration for timeouts on http requests
message RequestTimeoutPolicy {
// Specifies the maximum time allowed for establishing a connection with the
// server
int32 connect_timeout_ms = 1;
// Specifies the maximum time allowed for reading the response from the
// server
int32 read_timeout_ms = 2;
// Specifies the maximum time allowed for writing data to the server
int32 write_timeout_ms = 3;
// The overall timeout for a request - may be a combination of the above, may
// be longer / shorter depending on requirements
int32 overall_timeout_ms = 4;
}
message RequestPolicy {
RequestRetryPolicy retry_policy = 1;
RequestTimeoutPolicy timeout_policy = 2;
}
// Message contains configuration for diagnostic events
message DiagnosticEventsConfiguration {
// Whether or not the native SDK should send diagnostic events
bool enabled = 1;
// Batch size for diagnostic events
int32 max_batch_size = 2;
// Maximum time (ms) to wait before sending a batch of diagnostic events
// regardless of number of events in the batch
int32 max_batch_interval_ms = 3;
// iOS Specific. Whether or not URLSession task transaction metrics should be
// enabled
bool ttm_enabled = 4;
// Severity of diagnostics events which are allowed to send to the server
DiagnosticEventsSeverity severity = 5;
// Diagnostic events which are allowed to send to the server, ignores severity
repeated DiagnosticEventType allowed_events = 6;
// Diagnostic events which are blocked from sending to the server, ignores severity
repeated DiagnosticEventType blocked_events = 7;
}
// Message contains configuration for ad operations
message AdOperationsConfiguration {
// Specifies the maximum time allowed for load to complete
int32 load_timeout_ms = 1;
// Specifies the maximum time allowed for show to start
int32 show_timeout_ms = 2;
// Specifies the maximum time allowed for an asynchonous getToken call to return a token while initialization is in progress
int32 get_token_timeout_ms = 3;
}
// Message which contains all properties which can be consumed by the native
// side
message NativeConfiguration {
// Configuration for diagnostic events
DiagnosticEventsConfiguration diagnostic_events = 1;
// Policies for initialization requests
RequestPolicy init_policy = 2;
// Policies for ad requests (including refresh)
RequestPolicy ad_policy = 3;
// Policies for operative event requests
RequestPolicy operative_event_policy = 4;
// Policies for other requests
RequestPolicy other_policy = 5;
// Policies for ad operations
AdOperationsConfiguration ad_operations = 6;
// Feature flags for experimental features
FeatureFlags feature_flags = 7;
// If set, will enable collection of IAP data
bool enable_iap_event = 8;
// If set, will enable Open-Measurement-SDK
bool enable_om = 9;
// List of additional store package to be queried (later returned in static device info)
repeated string additional_store_packages = 10;
}
// Message which contains all current experimental features that can be enabled
message FeatureFlags {
// Whether or not the native Android SDK should try and use OpenGL to determine the installed GPU
bool opengl_gpu_enabled = 1;
// Validates the loaded campaign to see if opportunity id used in show and placement id provided correlates
bool opportunity_id_placement_validation = 2;
// Whether or not next session should be initialized with bold or legacy flow.
bool bold_sdk_next_session_enabled = 3;
}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// Provided by the Android API NetworkCapabilities https://developer.android.com/reference/android/net/NetworkCapabilities
message NetworkCapabilityTransports {
optional bool bluetooth = 1;
optional bool cellular = 2;
optional bool ethernet = 3;
optional bool lowpan = 4;
optional bool satellite = 5;
optional bool thread = 6;
optional bool usb = 7;
optional bool vpn = 8;
optional bool wifi = 9;
optional bool wifi_aware = 10;
}

View File

@@ -0,0 +1,54 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/campaign_state.proto";
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/session_counters.proto";
import "gatewayprotocol/v1/static_device_info.proto";
option swift_prefix = "Gateway";
enum OperativeEventType {
OPERATIVE_EVENT_TYPE_UNSPECIFIED = 0;
OPERATIVE_EVENT_TYPE_SPECIFIED_BY_AD_PLAYER = 1;
OPERATIVE_EVENT_TYPE_LOAD_ERROR = 2;
OPERATIVE_EVENT_TYPE_SHOW_ERROR = 3;
}
enum OperativeEventErrorType {
OPERATIVE_EVENT_ERROR_TYPE_UNSPECIFIED = 0;
OPERATIVE_EVENT_ERROR_TYPE_TIMEOUT = 1;
}
message OperativeEventErrorData {
OperativeEventErrorType error_type = 1;
string message = 2;
}
// Request sent from WebView to Gateway to report Operative Event
message OperativeEventRequest {
// Unique Event ID (UUID v4) which can be used for deduplication purpose on the backend
bytes event_id = 1;
// Event type using predefined enum
OperativeEventType event_type = 2;
// Impression Opportunity ID
bytes impression_opportunity_id = 3;
// Tracking Token returned in Ad Request or Ad Player Configuration request
bytes tracking_token = 4;
// Additional data which can be encoded inside WebView and passed along Operative Event.
// This may contain click information for example.
// Protobuf Definition can be found in adviewer/v1
bytes additional_data = 5;
// Game Server ID for S2S rewarded callback integration
string sid = 6;
// Event-time session counters
SessionCounters session_counters = 7;
// Static Device Info properties
StaticDeviceInfo static_device_info = 8;
// Dynamic Device Info properties
DynamicDeviceInfo dynamic_device_info = 9;
// List of campaigns currently loaded and shown
CampaignState campaign_state = 10;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// Personal Identifiable Information
message Pii {
// Advertising ID provided by Apple and Google Play
bytes advertising_id = 1;
// Vendor ID provided by Apple
bytes vendor_id = 2;
// Open Advertising ID provided by HUAWEI
bytes open_advertising_tracking_id = 3;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message PrivacyUpdateRequest {
int32 version = 1;
bytes content = 2;
}

View File

@@ -0,0 +1,10 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message PrivacyUpdateResponse {
int32 version = 1;
bytes content = 2;
}

View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message SessionCounters {
// Count of LOAD request
int32 load_requests = 1;
// Count of LOAD request with provided Ad Markup (Header Bidding Load Request)
int32 load_requests_adm = 2;
// Count of banner LOAD request from waterfall
int32 banner_load_requests = 3;
// Count of banner LOAD request with provided Ad Markup (Header Bidding Load Request)
int32 banner_requests_adm = 4;
// Count of impression from banner ads
int32 banner_impressions = 5;
}

View File

@@ -0,0 +1,64 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message StaticDeviceInfo {
message Android {
optional uint32 api_level = 1;
optional uint32 version_code = 2;
optional string android_fingerprint = 3;
optional string app_installer = 4;
optional string apk_developer_signing_certificate_hash = 5;
optional string build_board = 6;
optional string build_brand = 7;
optional string build_device = 8;
optional string build_display = 9;
optional string build_fingerprint = 10;
optional string build_hardware = 11;
optional string build_host = 12;
optional string build_bootloader = 13;
optional string build_product = 14;
optional string build_id = 15;
optional uint32 extension_version = 16;
optional int32 phone_type = 17;
optional string sim_operator = 18;
}
message Ios {
optional int64 system_boot_time = 1;
optional bool simulator = 2;
optional string built_sdk_version = 3;
repeated string skadnetwork_id = 4;
optional uint32 screen_scale = 5;
optional bool can_make_payments = 6;
optional string xcode_version = 7;
optional string xcode_build_version = 8;
optional string xcode_sdk_build_version = 9;
}
optional string bundle_id = 1;
optional string bundle_version = 2;
optional bool app_debuggable = 3;
optional bool rooted = 4;
optional string os_version = 5;
optional string device_make = 6;
optional string device_model = 7;
optional string webview_ua = 8;
optional uint32 screen_density = 9;
optional uint32 screen_width = 10;
optional uint32 screen_height = 11;
optional uint32 screen_size = 12;
repeated string stores = 13;
optional int64 total_disk_space = 14;
optional int64 total_ram_memory = 15;
optional string cpu_model = 16;
optional int64 cpu_count = 17;
optional string gpu_model = 18;
oneof platform_specific {
Android android = 19;
Ios ios = 20;
}
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
message TestData {
optional string force_campaign_id = 1;
optional string force_country = 2;
optional string force_country_subdivision = 3;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "google/protobuf/timestamp.proto";
option swift_prefix = "Gateway";
// Message which contains timestamps of the request or event
message Timestamps {
// Current UTC timestamp in milliseconds
google.protobuf.Timestamp timestamp = 1;
// Milliseconds since SDK was initialized using monotonic timer
int64 session_timestamp = 2;
}

View File

@@ -0,0 +1,50 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/dynamic_device_info.proto";
import "gatewayprotocol/v1/static_device_info.proto";
import "google/protobuf/timestamp.proto";
option swift_prefix = "Gateway";
enum StoreType {
STORE_TYPE_UNSPECIFIED = 0;
STORE_TYPE_CUSTOM = 1;
STORE_TYPE_APPLE_APP_STORE = 2; // "AppleAppStore"
STORE_TYPE_GOOGLE_PLAY = 3; // "GooglePlay"
}
enum TransactionState {
TRANSACTION_STATE_UNSPECIFIED = 0;
TRANSACTION_STATE_PENDING = 1;
TRANSACTION_STATE_PURCHASED = 2;
TRANSACTION_STATE_FAILED = 3;
TRANSACTION_STATE_RESTORED = 4;
TRANSACTION_STATE_DEFERRED = 5;
}
message TransactionData {
google.protobuf.Timestamp timestamp = 1;
string product_id = 2;
bytes event_id = 3; // Unique identifier for the event (e.g. UUID 16 bytes)
string transaction_id = 4;
string product = 5; // Product data as JSON
string transaction = 6; // Transaction data as JSON
optional string receipt = 7; // iOS only
TransactionState transaction_state = 8;
}
// Request sent from WebView to Gateway to report Transaction Event (IAP)
message TransactionEventRequest {
// Static Device Info properties
StaticDeviceInfo static_device_info = 1;
// Dynamic Device Info properties
DynamicDeviceInfo dynamic_device_info = 2;
// "AppleAppStore", "GooglePlay" (shall we consider an enum?)
StoreType app_store = 3;
// Custom store name (e.g. "AmazonAppStore") only used if app_store is STORE_TYPE_CUSTOM
string custom_store = 4;
// Transaction Data
repeated TransactionData transaction_data = 5;
}

View File

@@ -0,0 +1,107 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/ad_data_refresh_request.proto";
import "gatewayprotocol/v1/ad_player_config_request.proto";
import "gatewayprotocol/v1/ad_request.proto";
import "gatewayprotocol/v1/client_info.proto";
import "gatewayprotocol/v1/developer_consent.proto";
import "gatewayprotocol/v1/diagnostic_event_request.proto";
import "gatewayprotocol/v1/get_token_event_request.proto";
import "gatewayprotocol/v1/initialization_completed_event_request.proto";
import "gatewayprotocol/v1/initialization_request.proto";
import "gatewayprotocol/v1/operative_event_request.proto";
import "gatewayprotocol/v1/pii.proto";
import "gatewayprotocol/v1/privacy_update_request.proto";
import "gatewayprotocol/v1/test_data.proto";
import "gatewayprotocol/v1/timestamps.proto";
import "gatewayprotocol/v1/transaction_event_request.proto";
import "google/protobuf/timestamp.proto";
option swift_prefix = "Gateway";
// Limited session token which can be used to get some information on the Gateway, in the case if session token is not available.
message LimitedSessionToken {
// Device Manufacturer
string device_make = 1;
// Device Model
string device_model = 2;
// OS Version
string os_version = 3;
// IDFI
string idfi = 4;
// SDK Version represented as integer
uint32 sdk_version = 5;
// SDK Version represented as string
string sdk_version_name = 7;
// Game ID
string game_id = 8;
// Current Platform
Platform platform = 9;
// The well-known mediation provider used by the client
MediationProvider mediation_provider = 10;
// Non well-known mediation provider name, filled only if mediation_provider equals to MEDIATION_PROVIDER_CUSTOM
optional string custom_mediation_name = 11;
// The mediation provider version
optional string mediation_version = 12;
// Session ID generated on the device. This can be shared across multiple SDK/products.
optional bytes session_id = 13;
}
// Universal Request which contains a shared data and requests specific data.
message UniversalRequest {
message SharedData {
// Latest known session Token provide by SDK Gateway.
optional bytes session_token = 1;
Timestamps timestamps = 2;
// PII if it was allowed to send by SDK Gateway
optional Pii pii = 3;
optional DeveloperConsent developer_consent = 4;
// Currently used WebView version for the impression opportunity, set only if event triggered by the WebView during impression oppourtunity
optional int32 webview_version = 5;
// The last known state of the SDK from the POV of the gateway - not sent if
// not present Will be received on every universal_response
optional bytes current_state = 6;
// The data which can be used for testing purposes
// For example it can force country, campaign ID and etc.bool
// Works only when connected via VPN
optional TestData test_data = 7;
// UTC timestamp when application started in milliseconds
google.protobuf.Timestamp app_start_time = 8;
// UTC timestamp when application called initialize method in milliseconds
google.protobuf.Timestamp sdk_start_time = 9;
// Should be set if request is made without session token
optional LimitedSessionToken limited_session_token = 10;
}
message Payload {
oneof value {
// Data which required for initialization request
InitializationRequest initialization_request = 2;
// Data which required for ad request
AdRequest ad_request = 3;
// Data which required for operative event request
OperativeEventRequest operative_event = 4;
// Data which required for diagnostic event request
DiagnosticEventRequest diagnostic_event_request = 5;
// Request for placement configuration
AdPlayerConfigRequest ad_player_config_request = 6;
// Request for SCAR upload
GetTokenEventRequest get_token_event_request = 7;
// Request for privacy update
PrivacyUpdateRequest privacy_update_request = 8;
// Request for ad data refresh
AdDataRefreshRequest ad_data_refresh_request = 9;
// Initialization Completed Event
InitializationCompletedEventRequest initialization_completed_event_request = 10;
// Transaction event for IAP
TransactionEventRequest transaction_event_request = 11;
}
}
// Shared Data which is filled for each request sent from SDK
SharedData shared_data = 1;
// Payload contains actual request
Payload payload = 2;
}

View File

@@ -0,0 +1,41 @@
syntax = "proto3";
package gatewayprotocol.v1;
import "gatewayprotocol/v1/ad_data_refresh_response.proto";
import "gatewayprotocol/v1/ad_player_config_response.proto";
import "gatewayprotocol/v1/ad_response.proto";
import "gatewayprotocol/v1/error.proto";
import "gatewayprotocol/v1/initialization_response.proto";
import "gatewayprotocol/v1/mutable_data.proto";
import "gatewayprotocol/v1/privacy_update_response.proto";
option swift_prefix = "Gateway";
// The UniversalResponse is the response sent from the server to the client
message UniversalResponse {
message Payload {
oneof value {
// Initialization Response
InitializationResponse initialization_response = 1;
// Ad Response
AdResponse ad_response = 2;
// Response with placement configuration
AdPlayerConfigResponse ad_player_config_response = 3;
// Ad Data Refresh Response
AdDataRefreshResponse ad_data_refresh_response = 4;
// Privacy request response
PrivacyUpdateResponse privacy_update_response = 5;
}
}
// Payload of the response
Payload payload = 1;
// Contains mutable data for the client to use for updating its state
optional MutableData mutable_data = 2;
// If set, there was an error processing the request as a whole. For
// individual services, their responses contain their own Error response.
optional Error error = 3;
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
package gatewayprotocol.v1;
option swift_prefix = "Gateway";
// WebView configuration
message WebViewConfiguration {
// The version of the WebView
int32 version = 1;
// The URL of the WebView entry point
string entry_point = 2;
// Additional files required by the WebView
repeated string additional_files = 3;
}