├── .eslintrc.js ├── .gitignore ├── .nvmrc ├── .prettierrc.js ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── Readme.md ├── jest.config.js ├── package-lock.json ├── package.json ├── payload-types.txt ├── proto ├── authfiles │ ├── remember_device_file.proto │ └── user_dat_file.proto ├── google │ └── protobuf │ │ ├── any.proto │ │ ├── descriptor.proto │ │ ├── source_context.proto │ │ ├── type.proto │ │ └── wrappers.proto ├── proto_channel │ └── channel.proto ├── proto_chat_message_data │ └── chat_message_data.proto ├── proto_client_configuration │ └── client_configuration.proto ├── proto_cloudsave_service │ └── cloudsave_service.proto ├── proto_club_cache │ └── club_cache.proto ├── proto_configuration │ └── configuration.proto ├── proto_control_panel │ └── control_panel.proto ├── proto_conversations_cache │ └── conversations_cache.proto ├── proto_crash_reporter │ └── crash_reporter.proto ├── proto_demux │ └── demux.proto ├── proto_denuvo_service │ └── denuvo_service.proto ├── proto_download │ └── download.proto ├── proto_download_cache │ └── download_cache.proto ├── proto_download_install_state │ └── download_install_state.proto ├── proto_download_service │ └── download_service.proto ├── proto_filesystem_blob │ └── filesystem_blob.proto ├── proto_friends │ └── friends.proto ├── proto_game_activations_cache │ └── game_activations_cache.proto ├── proto_game_starter │ └── game_starter.proto ├── proto_game_stats_cache │ └── game_stats_cache.proto ├── proto_installation_backup │ └── installation_backup.proto ├── proto_new_channel │ └── new_channel.proto ├── proto_offline │ └── offline.proto ├── proto_orbitdll │ └── OrbitDll.proto ├── proto_overlay │ └── overlay.proto ├── proto_ownership │ └── ownership.proto ├── proto_ownership_cache │ └── ownership_cache.proto ├── proto_party │ └── party.proto ├── proto_pcbang │ └── pcbang.proto ├── proto_playtime │ └── playtime.proto ├── proto_playtime_cache │ └── playtime_cache.proto ├── proto_recently_played │ └── recently_played.proto ├── proto_settings │ └── settings.proto ├── proto_statistics │ └── Statistics.proto ├── proto_steam_service │ └── steam_service.proto ├── proto_store │ └── store.proto ├── proto_uplay │ └── Uplay.proto ├── proto_uplay_protocol │ └── uplay_protocol.proto ├── proto_uplay_service │ └── uplay_service.proto ├── proto_uplayauxdll │ └── UplayAuxDll.proto ├── proto_uplaydll │ └── UplayDll.proto ├── proto_user_login_cache │ └── user_login_cache.proto ├── proto_user_settings │ └── user_settings.proto ├── proto_utility │ └── utility.proto ├── proto_wegame_service │ └── wegame_service.proto └── protos │ ├── perfetto │ ├── common │ │ ├── android_log_constants.proto │ │ ├── builtin_clock.proto │ │ ├── perf_events.proto │ │ └── sys_stats_counters.proto │ ├── config │ │ ├── android │ │ │ ├── android_log_config.proto │ │ │ ├── android_polled_state_config.proto │ │ │ └── packages_list_config.proto │ │ ├── chrome │ │ │ └── chrome_config.proto │ │ ├── data_source_config.proto │ │ ├── ftrace │ │ │ └── ftrace_config.proto │ │ ├── gpu │ │ │ ├── gpu_counter_config.proto │ │ │ └── vulkan_memory_config.proto │ │ ├── inode_file │ │ │ └── inode_file_config.proto │ │ ├── interceptor_config.proto │ │ ├── interceptors │ │ │ └── console_config.proto │ │ ├── power │ │ │ └── android_power_config.proto │ │ ├── process_stats │ │ │ └── process_stats_config.proto │ │ ├── profiling │ │ │ ├── heapprofd_config.proto │ │ │ ├── java_hprof_config.proto │ │ │ └── perf_event_config.proto │ │ ├── sys_stats │ │ │ └── sys_stats_config.proto │ │ ├── test_config.proto │ │ ├── trace_config.proto │ │ └── track_event │ │ │ └── track_event_config.proto │ └── trace │ │ └── track_event │ │ ├── chrome_application_state_info.proto │ │ ├── chrome_compositor_scheduler_state.proto │ │ ├── chrome_content_settings_event_info.proto │ │ ├── chrome_frame_reporter.proto │ │ ├── chrome_histogram_sample.proto │ │ ├── chrome_keyed_service.proto │ │ ├── chrome_latency_info.proto │ │ ├── chrome_legacy_ipc.proto │ │ ├── chrome_message_pump.proto │ │ ├── chrome_mojo_event_info.proto │ │ ├── chrome_renderer_scheduler_state.proto │ │ ├── chrome_user_event.proto │ │ ├── chrome_window_handle_event_info.proto │ │ ├── debug_annotation.proto │ │ ├── log_message.proto │ │ ├── source_location.proto │ │ ├── task_execution.proto │ │ └── track_event.proto │ └── third_party │ └── chromium │ └── chrome_track_event.proto ├── src ├── generated │ └── proto │ │ └── proto_demux │ │ └── demux.ts └── index.ts └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'airbnb-base', 8 | 'plugin:@typescript-eslint/recommended', 9 | 'plugin:prettier/recommended', 10 | ], 11 | parser: '@typescript-eslint/parser', 12 | parserOptions: { 13 | project: './tsconfig.json', 14 | sourceType: 'module' 15 | }, 16 | plugins: ['@typescript-eslint'], 17 | rules: { 18 | 'import/extensions': 0, 19 | 'import/prefer-default-export': 0, 20 | 'no-shadow': 'off', 21 | '@typescript-eslint/no-shadow': ['error'], 22 | 'import/named': 0, 23 | 'import/no-named-as-default': 0, 24 | 'import/no-named-as-default-member': 0, 25 | 'import/no-cycle': 0, 26 | }, 27 | settings: { 28 | 'import/extensions': ['.js', '.ts',], 29 | 'import/parsers': { 30 | '@typescript-eslint/parser': ['.ts'] 31 | }, 32 | 'import/resolver': { 33 | node: { 34 | extensions: ['.js', '.ts',] 35 | } 36 | }, 37 | }, 38 | ignorePatterns: ['dist/**', '.eslintrc.js', 'jest.config.js', 'src/types/generated/**'] 39 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | test-output 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | lerna-debug.log* 11 | .pnpm-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | node_modules/ 46 | jspm_packages/ 47 | 48 | # Snowpack dependency directory (https://snowpack.dev/) 49 | web_modules/ 50 | 51 | # TypeScript cache 52 | *.tsbuildinfo 53 | 54 | # Optional npm cache directory 55 | .npm 56 | 57 | # Optional eslint cache 58 | .eslintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variables file 76 | .env 77 | .env.test 78 | .env.production 79 | 80 | # parcel-bundler cache (https://parceljs.org/) 81 | .cache 82 | .parcel-cache 83 | 84 | # Next.js build output 85 | .next 86 | out 87 | 88 | # Nuxt.js build / generate output 89 | .nuxt 90 | dist 91 | 92 | # Gatsby files 93 | .cache/ 94 | # Comment in the public line in if your project uses Gatsby and not Next.js 95 | # https://nextjs.org/blog/next-9-1#public-directory-support 96 | # public 97 | 98 | # vuepress build output 99 | .vuepress/dist 100 | 101 | # Serverless directories 102 | .serverless/ 103 | 104 | # FuseBox cache 105 | .fusebox/ 106 | 107 | # DynamoDB Local files 108 | .dynamodb/ 109 | 110 | # TernJS port file 111 | .tern-port 112 | 113 | # Stores VSCode versions used for testing VSCode extensions 114 | .vscode-test 115 | 116 | # yarn v2 117 | .yarn/cache 118 | .yarn/unplugged 119 | .yarn/build-state.yml 120 | .yarn/install-state.gz 121 | .pnp.* 122 | deduped-dmx-upc.json 123 | decoded-payloads.json 124 | decodes.json 125 | definition.json 126 | dmx-upc.json 127 | download-decodes.json 128 | tls-payloads.json 129 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 100, 3 | singleQuote: true, 4 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Debug Main", 11 | "runtimeArgs": [ 12 | "-r", 13 | "ts-node/register" 14 | ], 15 | "args": [ 16 | "${workspaceFolder}/src/index.ts" 17 | ], 18 | "outputCapture": "std", 19 | "console": "integratedTerminal" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "typescript" 5 | ], 6 | "editor.codeActionsOnSave": { 7 | "source.fixAll.eslint": true 8 | }, 9 | "editor.formatOnSave": true, 10 | "[javascript]": { 11 | "editor.formatOnSave": false, 12 | }, 13 | "[typescript]": { 14 | "editor.formatOnSave": false, 15 | }, 16 | "[json]": { 17 | "files.insertFinalNewline": true 18 | }, 19 | "typescript.tsdk": "node_modules/typescript/lib", 20 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Simon Cambier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # ubisoft-dmx-decode 2 | 3 | ## How to capture requests from Ubisoft Connect 4 | 5 | ### 1. Keydumping Setup 6 | 7 | 1. Prerequesites: 8 | - Windows 10 or Windows 11 9 | - Python 3.9 (I used pyenv) 10 | - Wireshark 11 | 1. If you're on Windows 11: ([source](https://github.com/ngo/win-frida-scripts/issues/2)) 12 | - Search for "Exploit protection" and open 13 | - Click "Program settings" 14 | - Click "Add program to customize" 15 | - Click "Add program by name" 16 | - Enter `lsass.exe` and continue 17 | - Scroll to "Hardware-enforced Stack Protection", turn it **Off**, and click Apply 18 | - Restart your computer 19 | 1. Install [frida](https://github.com/frida/frida#1-install-from-prebuilt-binaries) and ensure it works 20 | 21 | ```ps 22 | > pip install frida-tools 23 | > frida --version 24 | 15.1.15 25 | ``` 26 | 27 | 1. Save [`keylog.js`](https://raw.githubusercontent.com/ngo/win-frida-scripts/master/lsasslkeylog-easy/keylog.js) somewhere you'll remember 28 | 29 | ### 2. Capturing Keys 30 | 31 | 1. Close Ubisoft Connect 32 | 1. Search for "Windows PowerShell", right-click it and **Run as administrator** 33 | 1. Start capturing keys with 34 | 35 | ```ps 36 | frida --no-pause lsass.exe -l \path\to\keylog.js 37 | ``` 38 | 39 | - If frida can't find `lsass.exe`, get its process ID from the Task Manager Details tab, or by running `Get-Process -Name lsass` and use that instead of `lsass.exe` in the `frida` command 40 | 41 | 1. You should see `C:\keylog.log` beginning to populate. Keep `frida` running until you're done capturing packets 42 | 43 | ### 3. Capturing Packets 44 | 45 | 1. Open Wireshark 46 | 1. Go to Edit > Preferences > Protocols > TLS > (Pre)-Master-Secret log filename > Browse... > navigate to `C:\keylog.log`, then click OK 47 | 1. View > Name Resolution > Check "Resolve Network Addresses" 48 | 1. Click your adapter in the "Capture" list to begin capturing (I use "Ethernet") 49 | 1. Open Ubisoft Connect and do some things 50 | 1. Click the 🟥 button to stop capture 51 | 1. In the filter bar, enter `(ip.dst_host == dmx.upc.ubisoft.com) || (ip.src_host == dmx.upc.ubisoft.com)` 52 | 1. Press CTRL+R to reload the packets to ensure decryption applies 53 | 1. Right click a TLSv1.2 packet > Follow > TLS Stream, a window containing some readable text should appear. This means the decryption is working. 54 | 1. Set "Show data as" to `YAML`, click "Save as...", and save as `tls-stream.yml`. 55 | 1. Once saved, click the "Filter out this stream" button. Typically there are multiple demux TLS streams in one capture, and you'll need to repeat the above step for each one. Keep saving and filtering until none remain. 56 | 57 | ### 4. Decoding the requests 58 | 59 | 1. Clone this project 60 | 1. `npm i` 61 | 1. Move `tls-stream.yml` to the root of the project 62 | 1. `npm start`. The output will be written to `decodes.json` 63 | 64 | ## How to get the .proto's 65 | 66 | Only needed if you need to update the protos 67 | 68 | 1. [Follow steps 1-3 of this guide](https://github.com/claabs/uplay-install-reverse#protobuf-schema). 69 | 1. Copy the `upc_protos` folder here and rename it to `proto` 70 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testPathIgnorePatterns: ['/node_modules/', '/dist/'], 4 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ubisoft-dmx-decode", 3 | "version": "1.0.0", 4 | "description": "Decode the values sent in Ubisoft's dmx.upc.ubisoft.com API", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start": "ts-node src/index.ts", 8 | "gen-demux": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=src/generated/. --ts_proto_opt=oneof=unions --ts_proto_opt=outputEncodeMethods=false --ts_proto_opt=outputJsonMethods=false --ts_proto_opt=esModuleInterop=true --ts_proto_opt=env=node ./proto/proto_demux/demux.proto" 9 | }, 10 | "author": { 11 | "name": "Charlie Laabs", 12 | "url": "https://github.com/claabs" 13 | }, 14 | "keywords": [ 15 | "ubisoft", 16 | "ubi", 17 | "ubisoft connect", 18 | "uplay", 19 | "grpc", 20 | "protobuf", 21 | "protocol buffer" 22 | ], 23 | "license": "MIT", 24 | "engines": { 25 | "node": ">=14" 26 | }, 27 | "dependencies": { 28 | "fs-extra": "^10.0.0", 29 | "glob": "^7.2.0", 30 | "protobufjs": "^6.11.2", 31 | "yaml": "^2.1.1" 32 | }, 33 | "devDependencies": { 34 | "@types/fs-extra": "^9.0.13", 35 | "@types/glob": "^7.2.0", 36 | "@types/node": "^17.0.15", 37 | "@typescript-eslint/eslint-plugin": "^5.10.1", 38 | "@typescript-eslint/parser": "^5.10.1", 39 | "eslint": "^8.8.0", 40 | "eslint-config-airbnb-base": "^15.0.0", 41 | "eslint-config-prettier": "^8.3.0", 42 | "eslint-plugin-import": "^2.25.4", 43 | "eslint-plugin-prettier": "^4.0.0", 44 | "prettier": "^2.5.1", 45 | "rimraf": "^3.0.2", 46 | "ts-node": "^10.4.0", 47 | "ts-proto": "^1.105.0", 48 | "typescript": "^4.5.5" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /payload-types.txt: -------------------------------------------------------------------------------- 1 | 2022-01-29T21:57:47.858Z 2 | mg.protocol.demux.Upstream 3 | GetPatchInfoReq 4 | 5 | 2022-01-29T21:57:47.858Z 6 | mg.protocol.demux.Upstream 7 | ClientVersionPush 8 | 9 | 2022-01-29T21:57:47.858Z 10 | mg.protocol.demux.Upstream 11 | ServiceReq 12 | "service": "utility_service", 13 | data: mg.protocol.utility.Req 14 | 15 | { 16 | "request": { 17 | "requestId": 0, 18 | "serviceRequest": { 19 | "service": "utility_service", 20 | "data": "CgIKAA==" 21 | } 22 | } 23 | }, 24 | 25 | 2022-01-29T21:57:47.884Z 26 | mg.protocol.demux.Downstream 27 | GetPatchInfoRsp 28 | 29 | 2022-01-29T21:57:47.884Z 30 | mg.protocol.demux.Downstream 31 | ServiceRsp 32 | data: mg.protocol.utility.Rsp 33 | 34 | { 35 | "response": { 36 | "requestId": 0, 37 | "serviceRsp": { 38 | "success": true, 39 | "data": "CgoKCAoCVVMSAk5B" 40 | } 41 | } 42 | }, 43 | 44 | 2022-01-29T21:57:59.214Z 45 | mg.protocol.demux.Upstream 46 | AuthenticateReq 47 | 48 | 2022-01-29T21:57:59.336Z 49 | unknown 50 | 51 | 2022-01-29T21:57:59.336Z 52 | mg.protocol.demux.Upstream 53 | ServiceReq -------------------------------------------------------------------------------- /proto/authfiles/remember_device_file.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.remember_device_file; 4 | 5 | message User { 6 | oneof _account_id { 7 | string account_id = 1; 8 | } 9 | 10 | oneof _email_hash { 11 | string email_hash = 2; 12 | } 13 | 14 | oneof _rd_ticket { 15 | string rd_ticket = 3; 16 | } 17 | } 18 | 19 | message UserLoginCache { 20 | repeated User users = 2; 21 | 22 | oneof _version { 23 | uint32 version = 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /proto/authfiles/user_dat_file.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.user_dat_file; 4 | 5 | message UserInfo { 6 | oneof _username { 7 | string username = 1; 8 | } 9 | 10 | oneof _ubi_account_id { 11 | string ubi_account_id = 3; 12 | } 13 | 14 | oneof _email { 15 | string email = 5; 16 | } 17 | 18 | oneof _name { 19 | string name = 6; 20 | } 21 | 22 | oneof _password_salt { 23 | bytes password_salt = 8; 24 | } 25 | 26 | oneof _password_hash { 27 | bytes password_hash = 7; 28 | } 29 | 30 | oneof _migration_email_hash { 31 | string migration_email_hash = 9; 32 | } 33 | 34 | oneof _remember_me_ticket { 35 | string remember_me_ticket = 10; 36 | } 37 | 38 | oneof _hash_iterations_offset { 39 | uint32 hash_iterations_offset = 11; 40 | } 41 | } 42 | 43 | message LegacyVulnerableUnversionedCache { 44 | repeated UserInfo users = 1; 45 | } 46 | 47 | message StartupEntry { 48 | oneof _is_remember_me { 49 | bool is_remember_me = 1; 50 | } 51 | 52 | oneof _is_restart_credentials { 53 | bool is_restart_credentials = 2; 54 | } 55 | 56 | oneof _user_index { 57 | uint32 user_index = 3; 58 | } 59 | } 60 | 61 | message EnvironmentCache { 62 | repeated UserInfo users = 1; 63 | 64 | oneof _startup_entry { 65 | StartupEntry startup_entry = 2; 66 | } 67 | } 68 | 69 | message Cache { 70 | oneof _prod { 71 | EnvironmentCache prod = 1; 72 | } 73 | 74 | oneof _uat { 75 | EnvironmentCache uat = 2; 76 | } 77 | 78 | oneof _dev { 79 | EnvironmentCache dev = 3; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /proto/google/protobuf/any.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package google.protobuf; 4 | 5 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 6 | option objc_class_prefix = "GPB"; 7 | option go_package = "google.golang.org/protobuf/types/known/anypb"; 8 | option java_multiple_files = true; 9 | option java_outer_classname = "AnyProto"; 10 | option java_package = "com.google.protobuf"; 11 | 12 | message Any { 13 | string type_url = 1; 14 | bytes value = 2; 15 | } 16 | -------------------------------------------------------------------------------- /proto/google/protobuf/descriptor.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package google.protobuf; 4 | 5 | option csharp_namespace = "Google.Protobuf.Reflection"; 6 | option objc_class_prefix = "GPB"; 7 | option cc_enable_arenas = true; 8 | option go_package = "google.golang.org/protobuf/types/descriptorpb"; 9 | option optimize_for = SPEED; 10 | option java_outer_classname = "DescriptorProtos"; 11 | option java_package = "com.google.protobuf"; 12 | 13 | message FileDescriptorSet { 14 | repeated FileDescriptorProto file = 1; 15 | } 16 | 17 | message FileDescriptorProto { 18 | optional string name = 1; 19 | optional string package = 2; 20 | repeated string dependency = 3; 21 | repeated int32 public_dependency = 10; 22 | repeated int32 weak_dependency = 11; 23 | repeated DescriptorProto message_type = 4; 24 | repeated EnumDescriptorProto enum_type = 5; 25 | repeated ServiceDescriptorProto service = 6; 26 | repeated FieldDescriptorProto extension = 7; 27 | optional FileOptions options = 8; 28 | optional SourceCodeInfo source_code_info = 9; 29 | optional string syntax = 12; 30 | } 31 | 32 | message DescriptorProto { 33 | optional string name = 1; 34 | repeated FieldDescriptorProto field = 2; 35 | repeated FieldDescriptorProto extension = 6; 36 | repeated DescriptorProto nested_type = 3; 37 | repeated EnumDescriptorProto enum_type = 4; 38 | 39 | repeated ExtensionRange extension_range = 5; 40 | message ExtensionRange { 41 | optional int32 start = 1; 42 | optional int32 end = 2; 43 | optional ExtensionRangeOptions options = 3; 44 | } 45 | 46 | repeated OneofDescriptorProto oneof_decl = 8; 47 | optional MessageOptions options = 7; 48 | 49 | repeated ReservedRange reserved_range = 9; 50 | message ReservedRange { 51 | optional int32 start = 1; 52 | optional int32 end = 2; 53 | } 54 | 55 | repeated string reserved_name = 10; 56 | } 57 | 58 | message ExtensionRangeOptions { 59 | repeated UninterpretedOption uninterpreted_option = 999; 60 | 61 | extensions 1000 to max; 62 | } 63 | 64 | message FieldDescriptorProto { 65 | optional string name = 1; 66 | optional int32 number = 3; 67 | 68 | optional Label label = 4; 69 | enum Label { 70 | LABEL_OPTIONAL = 1; 71 | LABEL_REQUIRED = 2; 72 | LABEL_REPEATED = 3; 73 | } 74 | 75 | optional Type type = 5; 76 | enum Type { 77 | TYPE_DOUBLE = 1; 78 | TYPE_FLOAT = 2; 79 | TYPE_INT64 = 3; 80 | TYPE_UINT64 = 4; 81 | TYPE_INT32 = 5; 82 | TYPE_FIXED64 = 6; 83 | TYPE_FIXED32 = 7; 84 | TYPE_BOOL = 8; 85 | TYPE_STRING = 9; 86 | TYPE_GROUP = 10; 87 | TYPE_MESSAGE = 11; 88 | TYPE_BYTES = 12; 89 | TYPE_UINT32 = 13; 90 | TYPE_ENUM = 14; 91 | TYPE_SFIXED32 = 15; 92 | TYPE_SFIXED64 = 16; 93 | TYPE_SINT32 = 17; 94 | TYPE_SINT64 = 18; 95 | } 96 | 97 | optional string type_name = 6; 98 | optional string extendee = 2; 99 | optional string default_value = 7; 100 | optional int32 oneof_index = 9; 101 | optional string json_name = 10; 102 | optional FieldOptions options = 8; 103 | optional bool proto3_optional = 17; 104 | } 105 | 106 | message OneofDescriptorProto { 107 | optional string name = 1; 108 | optional OneofOptions options = 2; 109 | } 110 | 111 | message EnumDescriptorProto { 112 | optional string name = 1; 113 | repeated EnumValueDescriptorProto value = 2; 114 | optional EnumOptions options = 3; 115 | 116 | repeated EnumReservedRange reserved_range = 4; 117 | message EnumReservedRange { 118 | optional int32 start = 1; 119 | optional int32 end = 2; 120 | } 121 | 122 | repeated string reserved_name = 5; 123 | } 124 | 125 | message EnumValueDescriptorProto { 126 | optional string name = 1; 127 | optional int32 number = 2; 128 | optional EnumValueOptions options = 3; 129 | } 130 | 131 | message ServiceDescriptorProto { 132 | optional string name = 1; 133 | repeated MethodDescriptorProto method = 2; 134 | optional ServiceOptions options = 3; 135 | } 136 | 137 | message MethodDescriptorProto { 138 | optional string name = 1; 139 | optional string input_type = 2; 140 | optional string output_type = 3; 141 | optional MethodOptions options = 4; 142 | optional bool client_streaming = 5 [default = false]; 143 | optional bool server_streaming = 6 [default = false]; 144 | } 145 | 146 | message FileOptions { 147 | optional string java_package = 1; 148 | optional string java_outer_classname = 8; 149 | optional bool java_multiple_files = 10 [default = false]; 150 | optional bool java_generate_equals_and_hash = 20 [deprecated = true]; 151 | optional bool java_string_check_utf8 = 27 [default = false]; 152 | 153 | optional OptimizeMode optimize_for = 9 [default = SPEED]; 154 | enum OptimizeMode { 155 | SPEED = 1; 156 | CODE_SIZE = 2; 157 | LITE_RUNTIME = 3; 158 | } 159 | 160 | optional string go_package = 11; 161 | optional bool cc_generic_services = 16 [default = false]; 162 | optional bool java_generic_services = 17 [default = false]; 163 | optional bool py_generic_services = 18 [default = false]; 164 | optional bool php_generic_services = 42 [default = false]; 165 | optional bool deprecated = 23 [default = false]; 166 | optional bool cc_enable_arenas = 31 [default = true]; 167 | optional string objc_class_prefix = 36; 168 | optional string csharp_namespace = 37; 169 | optional string swift_prefix = 39; 170 | optional string php_class_prefix = 40; 171 | optional string php_namespace = 41; 172 | optional string php_metadata_namespace = 44; 173 | optional string ruby_package = 45; 174 | repeated UninterpretedOption uninterpreted_option = 999; 175 | 176 | extensions 1000 to max; 177 | 178 | reserved 38; 179 | } 180 | 181 | message MessageOptions { 182 | optional bool message_set_wire_format = 1 [default = false]; 183 | optional bool no_standard_descriptor_accessor = 2 [default = false]; 184 | optional bool deprecated = 3 [default = false]; 185 | optional bool map_entry = 7; 186 | repeated UninterpretedOption uninterpreted_option = 999; 187 | 188 | extensions 1000 to max; 189 | 190 | reserved 8, 9; 191 | } 192 | 193 | message FieldOptions { 194 | optional CType ctype = 1 [default = STRING]; 195 | enum CType { 196 | STRING = 0; 197 | CORD = 1; 198 | STRING_PIECE = 2; 199 | } 200 | 201 | optional bool packed = 2; 202 | 203 | optional JSType jstype = 6 [default = JS_NORMAL]; 204 | enum JSType { 205 | JS_NORMAL = 0; 206 | JS_STRING = 1; 207 | JS_NUMBER = 2; 208 | } 209 | 210 | optional bool lazy = 5 [default = false]; 211 | optional bool deprecated = 3 [default = false]; 212 | optional bool weak = 10 [default = false]; 213 | repeated UninterpretedOption uninterpreted_option = 999; 214 | 215 | extensions 1000 to max; 216 | 217 | reserved 4; 218 | } 219 | 220 | message OneofOptions { 221 | repeated UninterpretedOption uninterpreted_option = 999; 222 | 223 | extensions 1000 to max; 224 | } 225 | 226 | message EnumOptions { 227 | optional bool allow_alias = 2; 228 | optional bool deprecated = 3 [default = false]; 229 | repeated UninterpretedOption uninterpreted_option = 999; 230 | 231 | extensions 1000 to max; 232 | 233 | reserved 5; 234 | } 235 | 236 | message EnumValueOptions { 237 | optional bool deprecated = 1 [default = false]; 238 | repeated UninterpretedOption uninterpreted_option = 999; 239 | 240 | extensions 1000 to max; 241 | } 242 | 243 | message ServiceOptions { 244 | optional bool deprecated = 33 [default = false]; 245 | repeated UninterpretedOption uninterpreted_option = 999; 246 | 247 | extensions 1000 to max; 248 | } 249 | 250 | message MethodOptions { 251 | optional bool deprecated = 33 [default = false]; 252 | 253 | optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; 254 | enum IdempotencyLevel { 255 | IDEMPOTENCY_UNKNOWN = 0; 256 | NO_SIDE_EFFECTS = 1; 257 | IDEMPOTENT = 2; 258 | } 259 | 260 | repeated UninterpretedOption uninterpreted_option = 999; 261 | 262 | extensions 1000 to max; 263 | } 264 | 265 | message UninterpretedOption { 266 | repeated NamePart name = 2; 267 | message NamePart { 268 | required string name_part = 1; 269 | required bool is_extension = 2; 270 | } 271 | 272 | optional string identifier_value = 3; 273 | optional uint64 positive_int_value = 4; 274 | optional int64 negative_int_value = 5; 275 | optional double double_value = 6; 276 | optional bytes string_value = 7; 277 | optional string aggregate_value = 8; 278 | } 279 | 280 | message SourceCodeInfo { 281 | repeated Location location = 1; 282 | message Location { 283 | repeated int32 path = 1 [packed = true]; 284 | repeated int32 span = 2 [packed = true]; 285 | optional string leading_comments = 3; 286 | optional string trailing_comments = 4; 287 | repeated string leading_detached_comments = 6; 288 | } 289 | } 290 | 291 | message GeneratedCodeInfo { 292 | repeated Annotation annotation = 1; 293 | message Annotation { 294 | repeated int32 path = 1 [packed = true]; 295 | optional string source_file = 2; 296 | optional int32 begin = 3; 297 | optional int32 end = 4; 298 | } 299 | } 300 | -------------------------------------------------------------------------------- /proto/google/protobuf/source_context.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package google.protobuf; 4 | 5 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 6 | option objc_class_prefix = "GPB"; 7 | option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; 8 | option java_multiple_files = true; 9 | option java_outer_classname = "SourceContextProto"; 10 | option java_package = "com.google.protobuf"; 11 | 12 | message SourceContext { 13 | string file_name = 1; 14 | } 15 | -------------------------------------------------------------------------------- /proto/google/protobuf/type.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package google.protobuf; 4 | 5 | import "google/protobuf/any.proto"; 6 | import "google/protobuf/source_context.proto"; 7 | 8 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 9 | option objc_class_prefix = "GPB"; 10 | option cc_enable_arenas = true; 11 | option go_package = "google.golang.org/protobuf/types/known/typepb"; 12 | option java_multiple_files = true; 13 | option java_outer_classname = "TypeProto"; 14 | option java_package = "com.google.protobuf"; 15 | 16 | message Type { 17 | string name = 1; 18 | repeated Field fields = 2; 19 | repeated string oneofs = 3; 20 | repeated Option options = 4; 21 | SourceContext source_context = 5; 22 | Syntax syntax = 6; 23 | } 24 | 25 | message Field { 26 | Kind kind = 1; 27 | enum Kind { 28 | TYPE_UNKNOWN = 0; 29 | TYPE_DOUBLE = 1; 30 | TYPE_FLOAT = 2; 31 | TYPE_INT64 = 3; 32 | TYPE_UINT64 = 4; 33 | TYPE_INT32 = 5; 34 | TYPE_FIXED64 = 6; 35 | TYPE_FIXED32 = 7; 36 | TYPE_BOOL = 8; 37 | TYPE_STRING = 9; 38 | TYPE_GROUP = 10; 39 | TYPE_MESSAGE = 11; 40 | TYPE_BYTES = 12; 41 | TYPE_UINT32 = 13; 42 | TYPE_ENUM = 14; 43 | TYPE_SFIXED32 = 15; 44 | TYPE_SFIXED64 = 16; 45 | TYPE_SINT32 = 17; 46 | TYPE_SINT64 = 18; 47 | } 48 | 49 | Cardinality cardinality = 2; 50 | enum Cardinality { 51 | CARDINALITY_UNKNOWN = 0; 52 | CARDINALITY_OPTIONAL = 1; 53 | CARDINALITY_REQUIRED = 2; 54 | CARDINALITY_REPEATED = 3; 55 | } 56 | 57 | int32 number = 3; 58 | string name = 4; 59 | string type_url = 6; 60 | int32 oneof_index = 7; 61 | bool packed = 8; 62 | repeated Option options = 9; 63 | string json_name = 10; 64 | string default_value = 11; 65 | } 66 | 67 | message Enum { 68 | string name = 1; 69 | repeated EnumValue enumvalue = 2; 70 | repeated Option options = 3; 71 | SourceContext source_context = 4; 72 | Syntax syntax = 5; 73 | } 74 | 75 | message EnumValue { 76 | string name = 1; 77 | int32 number = 2; 78 | repeated Option options = 3; 79 | } 80 | 81 | message Option { 82 | string name = 1; 83 | Any value = 2; 84 | } 85 | 86 | enum Syntax { 87 | SYNTAX_PROTO2 = 0; 88 | SYNTAX_PROTO3 = 1; 89 | } 90 | -------------------------------------------------------------------------------- /proto/google/protobuf/wrappers.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package google.protobuf; 4 | 5 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 6 | option objc_class_prefix = "GPB"; 7 | option cc_enable_arenas = true; 8 | option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; 9 | option java_multiple_files = true; 10 | option java_outer_classname = "WrappersProto"; 11 | option java_package = "com.google.protobuf"; 12 | 13 | message DoubleValue { 14 | double value = 1; 15 | } 16 | 17 | message FloatValue { 18 | float value = 1; 19 | } 20 | 21 | message Int64Value { 22 | int64 value = 1; 23 | } 24 | 25 | message UInt64Value { 26 | uint64 value = 1; 27 | } 28 | 29 | message Int32Value { 30 | int32 value = 1; 31 | } 32 | 33 | message UInt32Value { 34 | uint32 value = 1; 35 | } 36 | 37 | message BoolValue { 38 | bool value = 1; 39 | } 40 | 41 | message StringValue { 42 | string value = 1; 43 | } 44 | 45 | message BytesValue { 46 | bytes value = 1; 47 | } 48 | -------------------------------------------------------------------------------- /proto/proto_channel/channel.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.channel; 4 | 5 | service ChannelService { 6 | rpc CreateChannel(CreateChannelReq) returns (CreateChannelRsp); 7 | } 8 | 9 | message Channel { 10 | optional string id = 1; 11 | optional string parent_id = 2; 12 | optional ChannelType type = 3; 13 | optional string name = 5; 14 | optional string topic = 6; 15 | repeated string recipients = 7; 16 | optional string owner_id = 9; 17 | optional string application_id = 10; 18 | } 19 | 20 | message Message { 21 | optional string message_id = 1; 22 | optional string parent_id = 2; 23 | optional string channel_id = 3; 24 | optional string author_id = 4; 25 | optional string text_message = 5; 26 | optional uint64 time = 6; 27 | optional uint64 updated_timestamp = 7; 28 | optional MessageType type = 8; 29 | repeated string mentions = 9; 30 | } 31 | 32 | message Invite { 33 | optional string id = 1; 34 | optional string channel_id = 2; 35 | optional string sender_id = 3; 36 | optional string receiver_id = 4; 37 | optional Channel channel = 5; 38 | } 39 | 40 | message CreateChannelReq { 41 | optional string parent_id = 1; 42 | optional ChannelType type = 2; 43 | optional string name = 3; 44 | optional string topic = 4; 45 | optional string application_id = 6; 46 | } 47 | 48 | message CreateChannelRsp { 49 | optional ResponseCode response_code = 1; 50 | optional Channel channel = 2; 51 | } 52 | 53 | message CreatePrivateChannelReq { 54 | optional string with_user_id = 1; 55 | } 56 | 57 | message CreatePrivateChannelRsp { 58 | optional ResponseCode response_code = 1; 59 | optional Channel channel = 2; 60 | } 61 | 62 | message GetChannelByIdReq { 63 | optional string channel_id = 1; 64 | } 65 | 66 | message GetChannelByIdRsp { 67 | optional ResponseCode response_code = 1; 68 | optional Channel channel = 2; 69 | } 70 | 71 | message LeaveChannelReq { 72 | optional string channel_id = 1; 73 | } 74 | 75 | message LeaveChannelRsp { 76 | optional ResponseCode response_code = 1; 77 | } 78 | 79 | message DeleteChannelReq { 80 | optional string channel_id = 1; 81 | } 82 | 83 | message DeleteChannelRsp { 84 | optional ResponseCode response_code = 1; 85 | } 86 | 87 | message UpdateChannelReq { 88 | optional Channel channel = 1; 89 | } 90 | 91 | message UpdateChannelRsp { 92 | optional ResponseCode response_code = 1; 93 | } 94 | 95 | message GetChannelsByUserIdReq { 96 | 97 | } 98 | 99 | message GetChannelsByUserIdRsp { 100 | optional ResponseCode response_code = 1; 101 | repeated Channel channels = 2; 102 | } 103 | 104 | message CreateInviteReq { 105 | optional string channel_id = 1; 106 | repeated string receiver_id = 2; 107 | } 108 | 109 | message CreateInviteRsp { 110 | optional ResponseCode response_code = 1; 111 | repeated Invite invites = 2; 112 | } 113 | 114 | message GetInvitesSentReq { 115 | 116 | } 117 | 118 | message GetInvitesSentRsp { 119 | optional ResponseCode response_code = 1; 120 | repeated Invite invites = 2; 121 | } 122 | 123 | message GetInvitesReceivedReq { 124 | 125 | } 126 | 127 | message GetInvitesReceivedRsp { 128 | optional ResponseCode response_code = 1; 129 | repeated Invite invites = 2; 130 | } 131 | 132 | message AcceptInviteReq { 133 | optional string invite_id = 1; 134 | optional string channel_id = 2; 135 | } 136 | 137 | message AcceptInviteRsp { 138 | optional ResponseCode response_code = 1; 139 | optional string channel_id = 2; 140 | } 141 | 142 | message DeleteInviteReq { 143 | optional string invite_id = 1; 144 | } 145 | 146 | message DeleteInviteRsp { 147 | optional ResponseCode response_code = 1; 148 | } 149 | 150 | message SendMessageReq { 151 | optional Message message = 1; 152 | } 153 | 154 | message SendMessageRsp { 155 | optional ResponseCode response_code = 1; 156 | optional Message message = 2; 157 | } 158 | 159 | message GetMessageReq { 160 | optional string channel_id = 1; 161 | optional string older_than_message_id = 2; 162 | } 163 | 164 | message GetMessageRsp { 165 | optional ResponseCode response_code = 1; 166 | repeated Message messages = 2; 167 | optional bool messages_left = 3; 168 | } 169 | 170 | message EditMessageReq { 171 | optional string channel_id = 1; 172 | optional string message_id = 2; 173 | optional string text_message = 3; 174 | } 175 | 176 | message EditMessageRsp { 177 | optional ResponseCode response_code = 1; 178 | optional Message message = 2; 179 | } 180 | 181 | message DeleteMessageReq { 182 | optional string channel_id = 1; 183 | optional string message_id = 2; 184 | } 185 | 186 | message DeleteMessageRsp { 187 | optional ResponseCode response_code = 1; 188 | } 189 | 190 | message AckMessageReq { 191 | optional string channel_id = 1; 192 | optional string message_id = 2; 193 | } 194 | 195 | message AckMessageRsp { 196 | optional ResponseCode response_code = 1; 197 | } 198 | 199 | message GetUnreadMessagesReq { 200 | 201 | } 202 | 203 | message GetUnreadMessagesRsp { 204 | optional ResponseCode response_code = 1; 205 | map last_acknowledged_message = 2; 206 | map most_recent_message_in_channel = 3; 207 | } 208 | 209 | message PrivateChannelCreatedEvent { 210 | optional Channel channel = 1; 211 | } 212 | 213 | message ChannelUpdatedEvent { 214 | optional Channel channel = 1; 215 | } 216 | 217 | message ChannelDeletedEvent { 218 | optional string channel_id = 1; 219 | } 220 | 221 | message InviteCreatedEvent { 222 | optional Invite invite = 1; 223 | } 224 | 225 | message InviteRevokedEvent { 226 | optional string invite_id = 1; 227 | } 228 | 229 | message MessageCreatedEvent { 230 | optional Message message = 1; 231 | } 232 | 233 | message MessageUpdatedEvent { 234 | optional string channel_id = 1; 235 | optional ChannelType channel_type = 2; 236 | optional Message message = 3; 237 | } 238 | 239 | message MessageDeletedEvent { 240 | optional string channel_id = 1; 241 | optional ChannelType channel_type = 2; 242 | optional string message_id = 3; 243 | } 244 | 245 | message Req { 246 | optional uint32 request_id = 1; 247 | optional CreateChannelReq create_channel_req = 2; 248 | optional GetChannelByIdReq get_channel_by_id_req = 3; 249 | optional LeaveChannelReq leave_channel_req = 4; 250 | optional DeleteChannelReq delete_channel_req = 5; 251 | optional UpdateChannelReq update_channel_req = 6; 252 | optional GetChannelsByUserIdReq get_channels_by_user_id_req = 7; 253 | optional CreateInviteReq create_invite_req = 8; 254 | optional GetInvitesSentReq get_invites_sent_req = 9; 255 | optional GetInvitesReceivedReq get_invites_received_req = 10; 256 | optional AcceptInviteReq accept_invite_req = 11; 257 | optional DeleteInviteReq delete_invite_req = 12; 258 | optional SendMessageReq send_message_req = 13; 259 | optional GetMessageReq get_message_req = 14; 260 | optional EditMessageReq edit_message_req = 15; 261 | optional DeleteMessageReq delete_message_req = 16; 262 | optional AckMessageReq ack_message_req = 17; 263 | optional CreatePrivateChannelReq create_private_channel_req = 18; 264 | optional GetUnreadMessagesReq get_unread_messages_req = 19; 265 | } 266 | 267 | message Rsp { 268 | optional uint32 request_id = 1; 269 | optional CreateChannelRsp create_channel_rsp = 2; 270 | optional GetChannelByIdRsp get_channel_by_id_rsp = 3; 271 | optional LeaveChannelRsp leave_channel_rsp = 4; 272 | optional DeleteChannelRsp delete_channel_rsp = 5; 273 | optional UpdateChannelRsp update_channel_rsp = 6; 274 | optional GetChannelsByUserIdRsp get_channels_by_user_id_rsp = 7; 275 | optional CreateInviteRsp create_invite_rsp = 8; 276 | optional GetInvitesSentRsp get_invites_sent_rsp = 9; 277 | optional GetInvitesReceivedRsp get_invites_received_rsp = 10; 278 | optional AcceptInviteRsp accept_invite_rsp = 11; 279 | optional DeleteInviteRsp delete_invite_rsp = 12; 280 | optional SendMessageRsp send_message_rsp = 13; 281 | optional GetMessageRsp get_message_rsp = 14; 282 | optional EditMessageRsp edit_message_rsp = 15; 283 | optional DeleteMessageRsp delete_message_rsp = 16; 284 | optional AckMessageRsp ack_message_rsp = 17; 285 | optional CreatePrivateChannelRsp create_private_channel_rsp = 18; 286 | optional GetUnreadMessagesRsp get_unread_messages_rsp = 19; 287 | } 288 | 289 | message Event { 290 | optional uint64 sequence_number = 1; 291 | optional ChannelUpdatedEvent channel_updated_event = 2; 292 | optional ChannelDeletedEvent channel_deleted_event = 3; 293 | optional MessageCreatedEvent message_created_event = 4; 294 | optional MessageUpdatedEvent message_updated_event = 5; 295 | optional MessageDeletedEvent message_deleted_event = 6; 296 | optional InviteCreatedEvent invite_created_event = 7; 297 | optional InviteRevokedEvent invite_revoked_event = 8; 298 | optional PrivateChannelCreatedEvent private_channel_created_event = 9; 299 | } 300 | 301 | message Upstream { 302 | optional Req req = 1; 303 | } 304 | 305 | message Downstream { 306 | optional Rsp rsp = 1; 307 | optional Event event = 2; 308 | } 309 | 310 | enum ResponseCode { 311 | ResponseCode_Success = 200; 312 | ResponseCode_BadRequest = 400; 313 | ResponseCode_Unauthorized = 401; 314 | ResponseCode_Forbidden = 403; 315 | ResponseCode_NotFound = 404; 316 | ResponseCode_InternalServerError = 500; 317 | ResponseCode_GatewayTimeout = 504; 318 | } 319 | 320 | enum Permission { 321 | Permission_SendMessages = 1; 322 | Permission_ManageChannel = 2; 323 | Permission_ViewChannel = 3; 324 | Permission_ManageMessages = 4; 325 | Permission_CreateInvite = 5; 326 | Permission_KickMembers = 6; 327 | Permission_BanMembers = 7; 328 | Permission_ChangeTopic = 8; 329 | SuperUser_DeleteChannel = 50; 330 | } 331 | 332 | enum ChannelType { 333 | ChannelType_None = 0; 334 | ChannelType_DM = 1; 335 | ChannelType_Group = 2; 336 | ChannelType_Party = 3; 337 | } 338 | 339 | enum MessageType { 340 | MessageType_Default = 0; 341 | MessageType_UserJoined = 1; 342 | MessageType_UserLeft = 2; 343 | MessageType_GameInvite = 3; 344 | MessageType_UserInvite = 4; 345 | MessageType_ChannelNameChange = 5; 346 | } 347 | -------------------------------------------------------------------------------- /proto/proto_chat_message_data/chat_message_data.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.chat_message_data; 4 | 5 | message GameSession { 6 | optional uint64 id = 1; 7 | required bytes game_session_data = 2; 8 | required bool joinable = 3; 9 | } 10 | 11 | message GameInvite { 12 | required uint32 multiplayer_id = 1; 13 | required string product_name = 2; 14 | required GameSession game_session = 3; 15 | optional string inviter_username = 4; 16 | } 17 | 18 | message GroupInvitation { 19 | required string inviter_id = 1; 20 | required string invitee_id = 2; 21 | optional string inviter_username = 3; 22 | optional string invitee_username = 4; 23 | } 24 | 25 | message GroupCancelInvite { 26 | required string inviter_id = 1; 27 | required string invitee_id = 2; 28 | optional string inviter_username = 3; 29 | optional string invitee_username = 4; 30 | } 31 | 32 | message GroupJoin { 33 | required string joined_user_id = 1; 34 | optional string username = 2; 35 | } 36 | 37 | message GroupLeft { 38 | required string left_user_id = 1; 39 | optional string username = 2; 40 | } 41 | 42 | message GroupNotification { 43 | required string group_id = 1; 44 | optional GroupInvitation group_invitation = 2; 45 | optional GroupJoin group_join = 3; 46 | optional GroupLeft group_left = 4; 47 | optional GroupCancelInvite group_cancel_invite = 5; 48 | } 49 | 50 | message ChatMessageData { 51 | optional GameInvite game_invite = 1; 52 | optional GroupNotification group_notification = 2; 53 | } 54 | -------------------------------------------------------------------------------- /proto/proto_client_configuration/client_configuration.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.client_configuration; 4 | 5 | import "proto_demux/demux.proto"; 6 | 7 | message BuildVersion { 8 | required uint32 version_number = 1; 9 | } 10 | 11 | message GetStatisticsStatusReq { 12 | repeated BuildVersion build_versions = 1; 13 | } 14 | 15 | message GetStatisticsStatusRsp { 16 | repeated BuildVersion enabled_build_versions = 1; 17 | } 18 | 19 | message GetPatchInfoReq { 20 | required string patch_track_id = 1; 21 | required bool test_config = 2; 22 | optional uint32 track_type = 3; 23 | } 24 | 25 | message GetPatchInfoRsp { 26 | required bool success = 1; 27 | required string patch_track_id = 2; 28 | required bool test_config = 3; 29 | required string patch_base_url = 4; 30 | required uint32 latest_version = 5; 31 | optional uint32 track_type = 6; 32 | } 33 | 34 | message Req { 35 | required uint32 request_id = 1; 36 | optional demux.GetPatchInfoReq get_patch_info_req = 2; 37 | optional GetStatisticsStatusReq get_statistics_status_req = 3; 38 | optional GetPatchInfoReq get_patch_info_req_v2 = 4; 39 | } 40 | 41 | message Rsp { 42 | required uint32 request_id = 1; 43 | optional demux.GetPatchInfoRsp get_patch_info_rsp = 2; 44 | optional GetStatisticsStatusRsp get_statistics_status_rsp = 3; 45 | optional GetPatchInfoRsp get_patch_info_rsp_v2 = 4; 46 | } 47 | 48 | message Upstream { 49 | optional Req request = 1; 50 | } 51 | 52 | message Downstream { 53 | optional Rsp response = 1; 54 | } 55 | -------------------------------------------------------------------------------- /proto/proto_cloudsave_service/cloudsave_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.cloudsave_service; 4 | 5 | message OptionalArgs { 6 | uint32 write_length = 1; 7 | string md5_base64 = 2; 8 | } 9 | 10 | message Item { 11 | string item_name = 1; 12 | OptionalArgs optional_args = 2; 13 | } 14 | 15 | message CloudsaveUrlReq { 16 | string ownership_token = 1; 17 | uint32 uplay_id = 2; 18 | 19 | Method method = 3; 20 | enum Method { 21 | Method_Unknown = 0; 22 | Method_Put = 1; 23 | Method_Get = 2; 24 | Method_Delete = 3; 25 | } 26 | 27 | repeated Item items = 4; 28 | } 29 | 30 | message CloudsaveUrlRsp { 31 | Status status = 1; 32 | enum Status { 33 | Status_Unknown = 0; 34 | Status_Ok = 1; 35 | Status_InternalError = 2; 36 | Status_Denied = 3; 37 | } 38 | 39 | repeated HttpReq http_reqs = 2; 40 | message HttpReq { 41 | string header = 1; 42 | string url = 2; 43 | } 44 | } 45 | 46 | message Req { 47 | uint32 request_id = 1; 48 | CloudsaveUrlReq cloudsave_url_req = 2; 49 | } 50 | 51 | message Rsp { 52 | uint32 request_id = 1; 53 | CloudsaveUrlRsp cloudsave_url_rsp = 2; 54 | } 55 | 56 | message Upstream { 57 | Req request = 1; 58 | } 59 | 60 | message Downstream { 61 | Rsp response = 1; 62 | } 63 | -------------------------------------------------------------------------------- /proto/proto_club_cache/club_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.club_cache; 4 | 5 | message ClubCompletedActions { 6 | optional uint32 game_id = 1; 7 | repeated string action_ids = 2; 8 | } 9 | 10 | message ClubCache { 11 | required uint32 version = 1; 12 | repeated ClubCompletedActions completed_actions = 6; 13 | } 14 | 15 | enum ClubCacheVersion { 16 | ClubCacheVersion_Default = 1; 17 | } 18 | -------------------------------------------------------------------------------- /proto/proto_configuration/configuration.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.configuration; 4 | 5 | message Configuration { 6 | optional uint32 product_id = 1; 7 | optional uint32 uplay_id = 2; 8 | required string configuration = 3; 9 | } 10 | 11 | message ConfigurationCache { 12 | repeated Configuration configurations = 1; 13 | } 14 | -------------------------------------------------------------------------------- /proto/proto_control_panel/control_panel.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.control_panel; 4 | 5 | message AccountCache { 6 | required string email = 1; 7 | required string password = 2; 8 | required string comment = 3; 9 | 10 | required Environment environment = 4; 11 | enum Environment { 12 | Environment_DEV = 0; 13 | Environment_UAT = 1; 14 | Environment_PROD = 2; 15 | } 16 | } 17 | 18 | message AccountsCache { 19 | repeated AccountCache accounts = 1; 20 | } 21 | 22 | message ClientCache { 23 | required string name = 1; 24 | required string path = 2; 25 | optional string param = 3; 26 | } 27 | 28 | message ClientsCache { 29 | repeated ClientCache clients = 1; 30 | } 31 | 32 | message JsonMessage { 33 | required string name = 1; 34 | required string message = 2; 35 | } 36 | 37 | message BinaryProto { 38 | optional bytes friends = 1; 39 | optional bytes ownership = 2; 40 | optional bytes group = 3; 41 | } 42 | 43 | message CmdSetSdkMonitoringEnabled { 44 | required bool enabled = 1; 45 | } 46 | 47 | message InitializeReq { 48 | optional string id = 2; 49 | } 50 | 51 | message InitializeRsp { 52 | optional bool success = 1; 53 | } 54 | 55 | message Req { 56 | optional JsonMessage json_message = 1; 57 | optional BinaryProto binary_proto = 2; 58 | optional InitializeReq initialize_req = 3; 59 | } 60 | 61 | message Rsp { 62 | optional JsonMessage json_message = 1; 63 | optional InitializeRsp intialize_rsp = 2; 64 | } 65 | 66 | message Push { 67 | optional JsonMessage json_message = 1; 68 | } 69 | 70 | message Upstream { 71 | optional Req req = 1; 72 | } 73 | 74 | message Downstream { 75 | optional Push push = 1; 76 | optional Rsp rsp = 2; 77 | } 78 | -------------------------------------------------------------------------------- /proto/proto_conversations_cache/conversations_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.conversations_cache; 4 | 5 | message ConversationsCache { 6 | required uint32 version = 1; 7 | repeated string channelIds = 2; 8 | } 9 | 10 | enum ConversationsCacheVersion { 11 | ConversationsCacheVersion_Default = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/proto_crash_reporter/crash_reporter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.crash_reporter; 4 | 5 | message UploadDumpReq { 6 | required string dump_filename = 1; 7 | required string callstack_hash = 2; 8 | } 9 | 10 | message UploadDumpRsp { 11 | required bool success = 1; 12 | } 13 | 14 | message Req { 15 | optional UploadDumpReq upload_dump = 1; 16 | } 17 | 18 | message Rsp { 19 | optional UploadDumpRsp upload_dump = 1; 20 | } 21 | 22 | message Upstream { 23 | optional Req req = 1; 24 | } 25 | 26 | message Downstream { 27 | optional Rsp rsp = 1; 28 | } 29 | -------------------------------------------------------------------------------- /proto/proto_demux/demux.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.demux; 4 | 5 | message Token { 6 | optional string ubi_ticket = 3; 7 | optional string orbit_token = 1; 8 | optional bytes ubi_token = 2; 9 | } 10 | 11 | message AuthenticateReq { 12 | required Token token = 1; 13 | optional bool send_keep_alive = 4 [default = true]; 14 | optional string client_id = 2; 15 | optional string logout_push_group_id = 3; 16 | } 17 | 18 | message AuthenticateRsp { 19 | required bool success = 1; 20 | optional bool expired = 2; 21 | optional bool banned = 3; 22 | } 23 | 24 | message OpenConnectionReq { 25 | required string service_name = 2; 26 | } 27 | 28 | message OpenConnectionRsp { 29 | required uint32 connection_id = 1; 30 | required bool success = 2; 31 | } 32 | 33 | message KeepAlivePush { 34 | 35 | } 36 | 37 | message DataMessage { 38 | required uint32 connection_id = 1; 39 | required bytes data = 2; 40 | } 41 | 42 | message ClientVersionPush { 43 | required uint32 version = 1; 44 | } 45 | 46 | message ClientOutdatedPush { 47 | 48 | } 49 | 50 | message ProductStartedPush { 51 | required uint32 product_id = 1; 52 | } 53 | 54 | message ProductEndedPush { 55 | required uint32 product_id = 1; 56 | } 57 | 58 | message ConnectionClosedPush { 59 | required uint32 connection_id = 1; 60 | 61 | optional Connection_ErrorCode error_code = 2; 62 | enum Connection_ErrorCode { 63 | Connection_ForceQuit = 1; 64 | Connection_MultipleLogin = 2; 65 | Connection_Banned = 3; 66 | } 67 | } 68 | 69 | message GetPatchInfoReq { 70 | required string patch_track_id = 1; 71 | required bool test_config = 2; 72 | optional uint32 track_type = 3; 73 | } 74 | 75 | message GetPatchInfoRsp { 76 | required bool success = 1; 77 | required string patch_track_id = 2; 78 | required bool test_config = 3; 79 | required string patch_base_url = 4; 80 | required uint32 latest_version = 5; 81 | optional uint32 track_type = 6; 82 | } 83 | 84 | message ServiceReq { 85 | required string service = 1; 86 | required bytes data = 2; 87 | } 88 | 89 | message ServiceRsp { 90 | required bool success = 1; 91 | optional bytes data = 2; 92 | } 93 | 94 | message Req { 95 | required uint32 request_id = 1; 96 | optional AuthenticateReq authenticate_req = 2; 97 | optional GetPatchInfoReq get_patch_info_req = 5; 98 | optional ServiceReq service_request = 6; 99 | optional OpenConnectionReq open_connection_req = 3; 100 | optional uint32 client_ip_override = 99; 101 | } 102 | 103 | message Rsp { 104 | required uint32 request_id = 1; 105 | optional AuthenticateRsp authenticate_rsp = 2; 106 | optional OpenConnectionRsp open_connection_rsp = 3; 107 | optional GetPatchInfoRsp get_patch_info_rsp = 5; 108 | optional ServiceRsp service_rsp = 6; 109 | } 110 | 111 | message Push { 112 | optional DataMessage data = 1; 113 | optional ConnectionClosedPush connection_closed = 2; 114 | optional KeepAlivePush keep_alive = 3; 115 | optional ClientVersionPush client_version = 4; 116 | optional ClientOutdatedPush client_outdated = 5; 117 | optional ProductStartedPush product_started = 6; 118 | optional ProductEndedPush product_ended = 7; 119 | } 120 | 121 | message Upstream { 122 | optional Req request = 1; 123 | optional Push push = 2; 124 | } 125 | 126 | message Downstream { 127 | optional Rsp response = 1; 128 | optional Push push = 2; 129 | } 130 | -------------------------------------------------------------------------------- /proto/proto_denuvo_service/denuvo_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.denuvo_service; 4 | 5 | message GetGameTokenReq { 6 | string ownership_token = 1; 7 | bytes request_token = 2; 8 | } 9 | 10 | message GetGameTokenRsp { 11 | bytes game_token = 1; 12 | } 13 | 14 | message GetGameTimeTokenReq { 15 | string ownership_token = 1; 16 | bytes request_token = 2; 17 | } 18 | 19 | message GetGameTimeTokenRsp { 20 | bytes time_token = 1; 21 | uint32 time_token_ttl_sec = 2; 22 | } 23 | 24 | message Req { 25 | uint32 request_id = 1; 26 | GetGameTokenReq get_game_token_req = 2; 27 | GetGameTimeTokenReq get_game_time_token_req = 3; 28 | } 29 | 30 | message Rsp { 31 | uint32 request_id = 1; 32 | 33 | Result result = 2; 34 | enum Result { 35 | Success = 0; 36 | NotOwned = 1; 37 | Failure = 2; 38 | ExceededActivations = 3; 39 | TimeOut = 4; 40 | ServerError = 5; 41 | } 42 | 43 | GetGameTokenRsp get_game_token_rsp = 3; 44 | GetGameTimeTokenRsp get_game_time_token_rsp = 4; 45 | } 46 | 47 | message Upstream { 48 | Req request = 1; 49 | } 50 | 51 | message Downstream { 52 | Rsp response = 1; 53 | } 54 | -------------------------------------------------------------------------------- /proto/proto_download/download.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.download; 4 | 5 | message LicenseLocale { 6 | required string language = 1; 7 | required bytes sha1 = 2; 8 | optional string text = 3; 9 | optional string name = 4; 10 | } 11 | 12 | message License { 13 | required string identifier = 1; 14 | required uint32 version = 2; 15 | repeated LicenseLocale locales = 3; 16 | optional LicenseFormat format = 4; 17 | } 18 | 19 | message InstallRun { 20 | required string exe = 1; 21 | required string workingDir = 2; 22 | required string arguments = 3; 23 | required string description = 4; 24 | optional string identifier = 5; 25 | optional uint32 version = 6; 26 | optional Platform platform = 7; 27 | optional PlatformType platformType = 8; 28 | optional bool ignoreAllExitCodes = 9; 29 | optional bool restartRequired = 10; 30 | } 31 | 32 | message RegistryStringEntry { 33 | required string value = 1; 34 | optional string language = 2; 35 | } 36 | 37 | message RegistryNumberEntry { 38 | required uint32 value = 1; 39 | optional string language = 2; 40 | } 41 | 42 | message InstallRegistry { 43 | required string key = 1; 44 | 45 | required ValueType type = 2; 46 | enum ValueType { 47 | ValueType_String = 0; 48 | ValueType_Number = 1; 49 | } 50 | 51 | repeated RegistryStringEntry registryStringEntry = 3; 52 | repeated RegistryNumberEntry registryNumberEntry = 4; 53 | } 54 | 55 | message InstallGameExplorer { 56 | required string gdfPath = 1; 57 | optional uint32 version = 2; 58 | } 59 | 60 | message InstallFirewallRule { 61 | required string name = 1; 62 | required string exe = 2; 63 | required FirewallProfile profile = 3; 64 | required FirewallProtocol protocol = 4; 65 | optional string ports = 5; 66 | optional uint32 version = 6; 67 | } 68 | 69 | message InstallCompatibility { 70 | required string exe = 1; 71 | required string options = 2; 72 | optional Platform platform = 3; 73 | } 74 | 75 | message UninstallRun { 76 | required string exe = 1; 77 | required string workingDir = 2; 78 | required string arguments = 3; 79 | optional Platform platform = 5; 80 | optional PlatformType platformType = 6; 81 | } 82 | 83 | message UninstallRegistry { 84 | required string key = 1; 85 | } 86 | 87 | message Slice { 88 | required uint32 size = 1; 89 | optional uint32 downloadSize = 2; 90 | optional bytes downloadSha1 = 3; 91 | optional uint64 fileOffset = 4; 92 | } 93 | 94 | message File { 95 | required string name = 1; 96 | required uint64 size = 2; 97 | required bool isDir = 3; 98 | repeated bytes slices = 4; 99 | optional uint32 version = 5; 100 | optional uint64 paddedSize = 6; 101 | repeated Slice sliceList = 7; 102 | } 103 | 104 | message Chunk { 105 | required uint32 id = 1; 106 | 107 | required ChunkType type = 2; 108 | enum ChunkType { 109 | ChunkType_Required = 0; 110 | ChunkType_Optional = 1; 111 | } 112 | 113 | repeated File files = 3; 114 | optional uint32 uplayId = 4; 115 | optional string language = 5; 116 | optional string disc = 6; 117 | optional string tags = 7; 118 | repeated uint32 uplayIds = 8; 119 | } 120 | 121 | message MetaDataChunk { 122 | optional uint32 uplayId = 1; 123 | optional string language = 2; 124 | required uint64 bytesOnDisk = 3; 125 | optional uint64 paddedBytesOnDisk = 4; 126 | repeated uint32 uplayIds = 5; 127 | } 128 | 129 | message TextFileEntry { 130 | required string fileName = 1; 131 | required string locale = 2; 132 | } 133 | 134 | message TextFileList { 135 | optional string rootPath = 1; 136 | repeated TextFileEntry files = 2; 137 | } 138 | 139 | message Language { 140 | optional string code = 1; 141 | repeated uint32 uplayIds = 2; 142 | } 143 | 144 | message SlicerConfig { 145 | optional SlicerType slicerType = 1; 146 | enum SlicerType { 147 | Fsc = 1; 148 | FastCdc = 2; 149 | } 150 | 151 | optional uint32 minSliceSizeBytes = 2; 152 | optional uint32 expectedSliceSizeBytes = 3; 153 | optional uint32 maxSliceSizeBytes = 4; 154 | optional uint32 configVersion = 5; 155 | } 156 | 157 | message Manifest { 158 | repeated License licenses = 1; 159 | repeated InstallRun installRuns = 2; 160 | repeated InstallRegistry installRegistry = 5; 161 | repeated UninstallRun uninstallRuns = 3; 162 | repeated UninstallRegistry uninstallRegistry = 6; 163 | repeated Chunk chunks = 4; 164 | optional uint32 chunksVersion = 7; 165 | optional uint32 sliceSizeDeprecated = 8; 166 | repeated InstallGameExplorer installGameExplorer = 9; 167 | repeated InstallFirewallRule installFirewallRules = 10; 168 | repeated InstallCompatibility installCompatibility = 11; 169 | optional string legacyInstaller = 12; 170 | repeated string deprecatedLanguages = 13; 171 | optional bool isEncryptedDeprecated = 14; 172 | optional uint32 paddedSliceSizeDeprecated = 15; 173 | optional bool patchRequired = 16; 174 | optional bool isCompressed = 17; 175 | optional TextFileList readmeFiles = 18; 176 | optional TextFileList manualFiles = 19; 177 | optional string gameVersion = 20; 178 | optional CompressionMethod compressionMethod = 21; 179 | optional uint32 version = 22; 180 | repeated Language languages = 23; 181 | optional SlicerConfig slicerConfig = 24; 182 | } 183 | 184 | message ManifestLicenses { 185 | repeated License licenses = 1; 186 | } 187 | 188 | message ManifestMetaData { 189 | repeated License licenses = 1; 190 | required uint64 bytesOnDisk = 2; 191 | required uint64 bytesToDownload = 3; 192 | repeated string deprecatedLanguages = 5; 193 | optional uint32 chunksVersion = 6; 194 | repeated uint32 uplayIds = 7; 195 | repeated MetaDataChunk chunks = 8; 196 | optional uint64 paddedBytesOnDisk = 9; 197 | repeated Language languages = 10; 198 | } 199 | 200 | enum LicenseFormat { 201 | LicenseFormat_Text = 1; 202 | LicenseFormat_Html = 2; 203 | } 204 | 205 | enum Platform { 206 | Platform_WindowsXP = 1; 207 | Platform_WindowsVista = 2; 208 | Platform_Windows7 = 3; 209 | Platform_Windows8 = 4; 210 | Platform_Windows10 = 5; 211 | Platform_Windows81 = 6; 212 | } 213 | 214 | enum PlatformType { 215 | PlatformType_x86 = 1; 216 | PlatformType_x64 = 2; 217 | } 218 | 219 | enum FirewallProfile { 220 | FirewallProfile_Domain = 1; 221 | FirewallProfile_Private = 2; 222 | FirewallProfile_Public = 3; 223 | FirewallProfile_All = 4; 224 | } 225 | 226 | enum FirewallProtocol { 227 | FirewallProtocol_TCP = 1; 228 | FirewallProtocol_UDP = 2; 229 | } 230 | 231 | enum CompressionMethod { 232 | CompressionMethod_Deflate = 1; 233 | CompressionMethod_Lzham = 2; 234 | CompressionMethod_Zstd = 3; 235 | } 236 | -------------------------------------------------------------------------------- /proto/proto_download_cache/download_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.download_cache; 4 | 5 | message Download { 6 | required uint32 product_id = 1; 7 | required string manifest_id = 2; 8 | 9 | required DownloadType download_type = 3; 10 | enum DownloadType { 11 | DownloadType_Edison = 0; 12 | DownloadType_EdisonThirdParty = 1; 13 | DownloadType_Legacy = 2; 14 | DownloadType_Additional = 3; 15 | DownloadType_Reward = 4; 16 | DownloadType_LegacyAddOn = 5; 17 | } 18 | 19 | required DownloadState download_state = 5; 20 | enum DownloadState { 21 | DownloadState_Init = 0; 22 | DownloadState_ResumeFiles = 1; 23 | DownloadState_InProgress = 2; 24 | DownloadState_Paused = 3; 25 | DownloadState_NetworkError = 4; 26 | DownloadState_Failure = 5; 27 | DownloadState_Cancelled = 6; 28 | DownloadState_Completed = 7; 29 | DownloadStatus_AllocatingDiskSpace = 8; 30 | } 31 | 32 | optional uint32 additional_download_index = 6; 33 | optional string additional_download_filename = 7; 34 | 35 | optional DownloadInitiator download_initiator = 8; 36 | enum DownloadInitiator { 37 | Unknown = 0; 38 | BrandedInstaller = 1; 39 | LaunchProtocol = 2; 40 | InstallProtocol = 3; 41 | InstallProtocolRetail = 4; 42 | } 43 | 44 | optional string branded_installer_id = 9; 45 | } 46 | 47 | message DownloadCache { 48 | required bool is_paused = 1; 49 | repeated Download download = 2; 50 | } 51 | -------------------------------------------------------------------------------- /proto/proto_download_install_state/download_install_state.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.download_install_state; 4 | 5 | message License { 6 | required string identifier = 1; 7 | required uint32 version = 2; 8 | } 9 | 10 | message Installer { 11 | required string identifier = 1; 12 | optional uint32 manifest_version = 2; 13 | optional uint32 installed_version = 3; 14 | } 15 | 16 | message RegistryEntry { 17 | required string key = 1; 18 | optional string language = 2; 19 | optional string string_value = 3; 20 | optional uint32 number_value = 4; 21 | } 22 | 23 | message Chunk { 24 | required uint32 chunk_id = 1; 25 | required bool is_required = 2; 26 | required bool is_downloaded = 3; 27 | optional string language = 4; 28 | optional uint32 uplay_id = 5; 29 | optional string tags = 6; 30 | repeated uint32 uplay_ids = 7; 31 | } 32 | 33 | message Shortcut { 34 | required string name = 1; 35 | } 36 | 37 | message TextFileEntry { 38 | required string fileName = 1; 39 | required string locale = 2; 40 | } 41 | 42 | message TextFileList { 43 | optional string rootPath = 1; 44 | repeated TextFileEntry files = 2; 45 | } 46 | 47 | message DownloadInstallState { 48 | optional string manifest_sha1 = 1; 49 | optional string downloading_sha1 = 10; 50 | optional uint32 version = 2; 51 | optional string selected_language = 3; 52 | repeated License licenses = 4; 53 | repeated Installer installers = 5; 54 | repeated Chunk chunks = 6; 55 | optional string shortcut_name = 11; 56 | repeated Shortcut shortcuts = 13; 57 | repeated RegistryEntry registry_entries = 15; 58 | repeated string languages = 17; 59 | repeated string downloading_languages = 18; 60 | optional bool patch_required = 19; 61 | optional uint64 bytes_downloaded_on_patch_start = 20; 62 | optional uint64 required_bytes_downloaded_on_patch_start = 21; 63 | optional string game_name = 22; 64 | optional TextFileList readmeFiles = 23; 65 | optional TextFileList manualFiles = 24; 66 | optional string game_version = 25; 67 | repeated string installed_languages = 26; 68 | repeated uint32 installed_addons = 27; 69 | optional uint32 uplay_id = 28; 70 | optional bool invalidate_game_token_required = 29; 71 | optional bool epic_run_installation = 30 [default = false]; 72 | } 73 | -------------------------------------------------------------------------------- /proto/proto_download_service/download_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.download_service; 4 | 5 | message UrlReq { 6 | repeated Request url_requests = 1; 7 | message Request { 8 | uint32 product_id = 1; 9 | repeated string relative_file_path = 2; 10 | } 11 | } 12 | 13 | message UrlRsp { 14 | repeated UrlResponse url_responses = 1; 15 | message UrlResponse { 16 | Result result = 1; 17 | repeated DownloadUrls download_urls = 2; 18 | } 19 | 20 | uint32 ttl_seconds = 2; 21 | 22 | message DownloadUrls { 23 | repeated string urls = 1; 24 | } 25 | 26 | enum Result { 27 | Result_Success = 0; 28 | Result_NotOwned = 1; 29 | } 30 | } 31 | 32 | message InitializeReq { 33 | uint32 product_id = 1; 34 | uint32 branch_id = 2; 35 | uint64 expiration = 3; 36 | string signature = 4; 37 | string ownership_token = 5; 38 | } 39 | 40 | message InitializeRsp { 41 | bool ok = 1; 42 | } 43 | 44 | message Req { 45 | uint32 request_id = 1; 46 | InitializeReq initialize_req = 2; 47 | UrlReq url_req = 3; 48 | UrlReq url_req_covid = 4; 49 | } 50 | 51 | message Rsp { 52 | uint32 request_id = 1; 53 | InitializeRsp initialize_rsp = 2; 54 | UrlRsp url_rsp = 3; 55 | } 56 | 57 | message Upstream { 58 | Req request = 1; 59 | } 60 | 61 | message Downstream { 62 | Rsp response = 1; 63 | } 64 | -------------------------------------------------------------------------------- /proto/proto_filesystem_blob/filesystem_blob.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.filesystem_blob; 4 | 5 | message File { 6 | required string name = 1; 7 | required bytes content = 2; 8 | } 9 | 10 | message Directory { 11 | required string name = 1; 12 | repeated Directory directories = 2; 13 | repeated File files = 3; 14 | } 15 | -------------------------------------------------------------------------------- /proto/proto_friends/friends.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.friends; 4 | 5 | message ReconnectInfo { 6 | required bool reconnect_success = 1; 7 | } 8 | 9 | message DeprecatedInitializeReq { 10 | required bytes ubi_token = 1; 11 | optional uint64 deprecated_cookie = 2; 12 | optional Game game = 3; 13 | optional bytes rich_presence_deprecated = 4; 14 | optional Status.ActivityStatus activity_status = 6; 15 | optional string ubi_ticket = 7; 16 | optional uint32 proto_version = 8; 17 | optional string localization = 9; 18 | optional bool is_staging = 10; 19 | } 20 | 21 | message DeprecatedInitializeRsp { 22 | required bool success = 1; 23 | optional uint64 deprecated_cookie = 2; 24 | optional ReconnectInfo deprecated_reconnect_info = 3; 25 | repeated Relationship relationship = 4; 26 | } 27 | 28 | message InitializeReq { 29 | optional uint32 proto_version = 1; 30 | optional Game game = 2; 31 | optional Status.ActivityStatus activity_status = 4; 32 | optional string ubi_ticket = 5; 33 | optional string localization = 6; 34 | optional bool is_staging = 7; 35 | optional string sessiond_id = 8; 36 | } 37 | 38 | message InitializeRsp { 39 | required bool success = 1; 40 | repeated Relationship relationship = 2; 41 | } 42 | 43 | message Friend { 44 | required string account_id = 1; 45 | optional string name_on_platform = 2; 46 | optional string nickname = 3; 47 | optional bool isFavorite = 4; 48 | } 49 | 50 | message DeprecatedFriendsNick { 51 | required Friend user = 1; 52 | required string nick = 2; 53 | } 54 | 55 | message Relationship { 56 | required bool blacklisted = 1; 57 | required Friend friend = 2; 58 | 59 | required Relation relation = 3; 60 | enum Relation { 61 | NoRelationship = 0; 62 | PendingSentInvite = 1; 63 | PendingReceivedInvite = 2; 64 | Friends = 3; 65 | } 66 | 67 | optional uint64 deprecated_change_id = 4; 68 | optional string change_date = 5; 69 | } 70 | 71 | message Game { 72 | required uint32 uplay_id = 1; 73 | optional string product_name = 3; 74 | optional GameSession game_session = 2; 75 | } 76 | 77 | message GameSession { 78 | optional uint64 game_session_id = 1; 79 | optional string game_session_id_v2 = 4; 80 | required bytes game_session_data = 2; 81 | required bool joinable = 3; 82 | optional uint32 size = 5; 83 | optional uint32 max_size = 6; 84 | } 85 | 86 | message SetGameReq { 87 | optional Game game = 1; 88 | } 89 | 90 | message SetGameRsp { 91 | required bool success = 1; 92 | } 93 | 94 | message RichPresenceTokenPair { 95 | optional string key = 1; 96 | optional string val = 2; 97 | } 98 | 99 | message RichPresenceState { 100 | optional uint32 product_id = 1; 101 | optional uint32 presence_id = 2; 102 | repeated RichPresenceTokenPair presence_tokens = 3; 103 | } 104 | 105 | message SetRichPresenceReqDeprecated { 106 | required bytes rich_presence_deprecated = 1; 107 | } 108 | 109 | message SetRichPresenceRspDeprecated { 110 | required bool success = 1; 111 | } 112 | 113 | message SetRichPresenceReq { 114 | optional RichPresenceState presence_state = 1; 115 | } 116 | 117 | message SetRichPresenceRsp { 118 | optional bool success = 1; 119 | optional string localized_rich_presence = 2; 120 | } 121 | 122 | message SetActivityStatusReq { 123 | required Status.ActivityStatus activity_status = 1; 124 | } 125 | 126 | message SetActivityStatusRsp { 127 | required bool success = 1; 128 | } 129 | 130 | message Status { 131 | required Friend user = 1; 132 | 133 | required OnlineStatus online_status = 2; 134 | enum OnlineStatus { 135 | Offline = 0; 136 | Online = 1; 137 | InGame = 2; 138 | } 139 | 140 | optional Game game = 3; 141 | optional bytes rich_presence_deprecated = 4; 142 | 143 | optional VoipStatus voip_status = 5; 144 | enum VoipStatus { 145 | Deprecated1 = 0; 146 | Deprecated2 = 1; 147 | Deprecated3 = 2; 148 | } 149 | 150 | optional ActivityStatus activity_status = 6; 151 | enum ActivityStatus { 152 | Normal = 0; 153 | Away = 1; 154 | Busy = 2; 155 | Invisible = 3; 156 | } 157 | 158 | optional string localized_rich_presence = 7; 159 | } 160 | 161 | message GetRelationshipsListReq { 162 | 163 | } 164 | 165 | message GetRelationshipsListRsp { 166 | repeated Relationship relationship = 1; 167 | required bool ok = 2; 168 | } 169 | 170 | message FindFriendReq { 171 | optional string search_query_username = 1; 172 | optional string email = 2; 173 | } 174 | 175 | message FindFriendRsp { 176 | repeated Friend alternatives = 1; 177 | required bool ok = 2; 178 | } 179 | 180 | message GetStatusReq { 181 | repeated Friend users = 1; 182 | } 183 | 184 | message GetStatusRsp { 185 | repeated Status statuses = 1; 186 | required bool ok = 2; 187 | } 188 | 189 | message DeprecatedGetNickReq { 190 | repeated Friend users = 1; 191 | } 192 | 193 | message DeprecatedGetNickRsp { 194 | repeated DeprecatedFriendsNick nicks = 1; 195 | required bool ok = 2; 196 | } 197 | 198 | message AcceptFriendshipReq { 199 | required Friend user = 1; 200 | } 201 | 202 | message AcceptFriendshipRsp { 203 | required bool ok = 1; 204 | } 205 | 206 | message GetBlacklistReq { 207 | optional string user = 1; 208 | } 209 | 210 | message GetBlacklistRsp { 211 | optional bool success = 1; 212 | repeated string blacklist = 2; 213 | } 214 | 215 | message AddToBlacklistReq { 216 | required Friend user = 1; 217 | } 218 | 219 | message AddToBlacklistRsp { 220 | required bool ok = 1; 221 | } 222 | 223 | message ClearRelationshipReq { 224 | required Friend user = 1; 225 | } 226 | 227 | message ClearRelationshipRsp { 228 | required bool ok = 1; 229 | } 230 | 231 | message DeclineFriendshipReq { 232 | required Friend user = 1; 233 | } 234 | 235 | message DeclineFriendshipRsp { 236 | required bool ok = 1; 237 | } 238 | 239 | message RemoveFromBlacklistReq { 240 | required Friend user = 1; 241 | } 242 | 243 | message RemoveFromBlacklistRsp { 244 | required bool ok = 1; 245 | } 246 | 247 | message RequestFriendshipReq { 248 | required Friend user = 1; 249 | } 250 | 251 | message RequestFriendshipRsp { 252 | required bool ok = 1; 253 | } 254 | 255 | message RequestFriendshipsReq { 256 | repeated Friend users = 1; 257 | } 258 | 259 | message RequestFriendshipsRsp { 260 | repeated bool ok = 1; 261 | } 262 | 263 | message JoinGameInvite { 264 | required string account_id_from = 1; 265 | required Game game = 3; 266 | optional string deprecated_product_name = 2; 267 | } 268 | 269 | message JoinGameInvitationReq { 270 | required string account_id_to = 1; 271 | required Game game = 3; 272 | optional string deprecated_product_name = 2; 273 | } 274 | 275 | message JoinGameInvitationRsp { 276 | required bool ok = 1; 277 | } 278 | 279 | message DeclineGameInviteReq { 280 | required string account_id = 1; 281 | } 282 | 283 | message DeclineGameInviteRsp { 284 | required bool success = 1; 285 | } 286 | 287 | message UbiTicketRefreshReq { 288 | required string ubi_ticket = 1; 289 | } 290 | 291 | message UbiTicketRefreshRsp { 292 | required bool success = 1; 293 | } 294 | 295 | message SetNicknameReq { 296 | required string account_id = 1; 297 | required string nickname = 2; 298 | } 299 | 300 | message SetNicknameRsp { 301 | required bool success = 1; 302 | } 303 | 304 | message Req { 305 | required uint32 request_id = 1; 306 | optional DeprecatedInitializeReq deprecated_initialize_req = 2; 307 | optional GetRelationshipsListReq deprecated_get_relationships_list_req = 3; 308 | optional AcceptFriendshipReq accept_friendship_req = 4; 309 | optional AddToBlacklistReq add_to_blacklist_req = 5; 310 | optional ClearRelationshipReq clear_relationship_req = 6; 311 | optional DeclineFriendshipReq decline_friendship_req = 7; 312 | optional RemoveFromBlacklistReq remove_from_blacklist_req = 8; 313 | optional RequestFriendshipReq deprecated_request_friendship_req = 9; 314 | optional FindFriendReq find_friend_req = 10; 315 | optional GetStatusReq deprecated_get_status_req = 11; 316 | optional DeprecatedGetNickReq get_nick_req = 12; 317 | optional SetGameReq set_game_req = 13; 318 | optional JoinGameInvitationReq join_game_invitation_req = 14; 319 | optional SetRichPresenceReqDeprecated set_rich_presence_req_deprecated = 15; 320 | optional RequestFriendshipsReq request_friendships_req = 17; 321 | optional SetActivityStatusReq set_activity_status_req = 18; 322 | optional SetRichPresenceReq set_rich_presence_req = 19; 323 | optional DeclineGameInviteReq decline_game_invite_req = 20; 324 | optional UbiTicketRefreshReq ubi_ticket_refresh_req = 21; 325 | optional InitializeReq initialize_req = 22; 326 | optional SetNicknameReq set_nickname_req = 23; 327 | optional GetBlacklistReq get_blacklist_req = 24; 328 | } 329 | 330 | message Rsp { 331 | required uint32 request_id = 1; 332 | optional DeprecatedInitializeRsp deprecated_initialize_rsp = 2; 333 | optional GetRelationshipsListRsp deprecated_get_relationships_list_rsp = 3; 334 | optional AcceptFriendshipRsp accept_friendship_rsp = 4; 335 | optional AddToBlacklistRsp add_to_blacklist_rsp = 5; 336 | optional ClearRelationshipRsp clear_relationship_rsp = 6; 337 | optional DeclineFriendshipRsp decline_friendship_rsp = 7; 338 | optional RemoveFromBlacklistRsp remove_from_blacklist_rsp = 8; 339 | optional RequestFriendshipRsp deprecated_request_friendship_rsp = 9; 340 | optional FindFriendRsp find_friend_rsp = 10; 341 | optional GetStatusRsp deprecated_get_status_rsp = 11; 342 | optional DeprecatedGetNickRsp get_nick_rsp = 12; 343 | optional SetGameRsp set_game_rsp = 13; 344 | optional JoinGameInvitationRsp join_game_invitation_rsp = 14; 345 | optional SetRichPresenceRspDeprecated set_rich_presence_rsp_deprected = 15; 346 | optional RequestFriendshipsRsp request_friendships_rsp = 17; 347 | optional SetActivityStatusRsp set_activity_status_rsp = 18; 348 | optional SetRichPresenceRsp set_rich_presence_rsp = 19; 349 | optional DeclineGameInviteRsp decline_game_invite_rsp = 20; 350 | optional UbiTicketRefreshRsp ubi_ticket_refresh_rsp = 21; 351 | optional InitializeRsp initialize_rsp = 22; 352 | optional SetNicknameRsp set_nickname_rsp = 23; 353 | optional GetBlacklistRsp get_blacklist_rsp = 24; 354 | } 355 | 356 | message PushUpdatedRelationship { 357 | required Relationship relationship = 1; 358 | } 359 | 360 | message PushUpdatedStatus { 361 | required Status updates_status = 1; 362 | optional bool is_initial_status = 2; 363 | } 364 | 365 | message PushJoinGameInvitation { 366 | required JoinGameInvite invite = 1; 367 | } 368 | 369 | message PushRecentlyMetPlayers { 370 | required uint32 uplay_id = 1; 371 | repeated string account_ids = 2; 372 | } 373 | 374 | message PushGameInviteDeclined { 375 | required string account_id = 1; 376 | } 377 | 378 | message PushNicknameUpdate { 379 | required string friend_account_id = 1; 380 | required string nickname = 2; 381 | } 382 | 383 | message PushIsFavoriteUpdate { 384 | required string friend_account_id = 1; 385 | required bool isFavorite = 2; 386 | } 387 | 388 | message Push { 389 | optional PushUpdatedRelationship push_updated_relationship = 1; 390 | optional PushUpdatedStatus push_updated_status = 2; 391 | optional PushJoinGameInvitation push_join_game_invitation = 3; 392 | optional PushRecentlyMetPlayers push_recently_met_players = 4; 393 | optional PushGameInviteDeclined push_game_invite_declined = 5; 394 | optional PushNicknameUpdate push_nickname_update = 6; 395 | optional PushIsFavoriteUpdate push_isFavorite_update = 7; 396 | } 397 | 398 | message Upstream { 399 | optional Req request = 1; 400 | } 401 | 402 | message Downstream { 403 | optional Rsp response = 1; 404 | optional Push push = 2; 405 | } 406 | -------------------------------------------------------------------------------- /proto/proto_game_activations_cache/game_activations_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.game_activations_cache; 4 | 5 | message ExecutableToken { 6 | required uint32 exe_index = 1; 7 | optional string game_token = 3; 8 | } 9 | 10 | message GameActivation { 11 | required uint32 product_id = 1; 12 | repeated ExecutableToken executable_token = 2; 13 | } 14 | 15 | message GameActivationListCache { 16 | repeated GameActivation game_activation = 1; 17 | } 18 | -------------------------------------------------------------------------------- /proto/proto_game_starter/game_starter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.game_starter; 4 | 5 | message RichPresenceToken { 6 | optional string key = 1; 7 | optional string value = 2; 8 | } 9 | 10 | message DiscordRichPresence { 11 | optional string app_id = 1; 12 | optional string large_image = 2; 13 | optional string small_image = 3; 14 | optional string text = 5; 15 | } 16 | 17 | message SteamProofOfPurchase { 18 | required uint32 steamAppId = 1; 19 | required string ticket = 2; 20 | } 21 | 22 | message OculusInfo { 23 | optional string appId = 1; 24 | optional string userId = 2; 25 | optional string oculusUserId = 3; 26 | optional string accessToken = 4; 27 | } 28 | 29 | message NvidiaInfo { 30 | optional string accessToken = 1; 31 | } 32 | 33 | message WeGameInfo { 34 | optional uint64 rail_game_id = 1; 35 | } 36 | 37 | message StartReq { 38 | required uint32 launcherVersion = 1; 39 | required uint32 uplayId = 2; 40 | required bool steamGame = 3; 41 | required uint32 gameVersion = 4; 42 | optional uint32 productId = 5; 43 | optional string simulationConfig = 7; 44 | optional string steamTicket = 8; 45 | optional string steamId = 9; 46 | optional string executablePath = 10; 47 | optional string executableArguments = 11; 48 | optional uint64 timeStart = 12; 49 | optional uint32 steamFreePackageId = 13; 50 | optional uint32 steamRequiredProductId = 14; 51 | repeated SteamProofOfPurchase steamProofOfPurchase = 15; 52 | optional OculusInfo oculusInfo = 16; 53 | 54 | optional Platform platform = 17; 55 | enum Platform { 56 | Platform_Uplay = 1; 57 | Platform_Steam = 2; 58 | Platform_Oculus = 3; 59 | Platform_Nvidia = 4; 60 | Platform_Switch = 5; 61 | Platform_WeGame = 6; 62 | } 63 | 64 | optional string steamOwnerId = 18; 65 | optional NvidiaInfo nvidiaInfo = 19; 66 | optional WeGameInfo weGameInfo = 20; 67 | } 68 | 69 | message HotkeyStateChangedReq { 70 | required int32 hotkeyType = 1; 71 | required bool isPressed = 2; 72 | } 73 | 74 | message Hotkey { 75 | required int32 hotkeyType = 1; 76 | required uint32 keyCode = 2; 77 | required bool altState = 3; 78 | required bool shiftState = 4; 79 | required bool controlState = 5; 80 | } 81 | 82 | message Hotkeys { 83 | repeated Hotkey hotkeys = 1; 84 | } 85 | 86 | message StartGrantedRsp { 87 | required bool overlayEnabled = 1; 88 | required bool windowedMode = 2; 89 | optional string executablePath = 3; 90 | optional string workingDirectory = 4; 91 | optional string arguments = 5; 92 | optional string additionalArguments = 6; 93 | optional string uplayArguments = 7; 94 | 95 | optional OverlayInjectionMethod overlayInjectionMethod = 8; 96 | enum OverlayInjectionMethod { 97 | OverlayInjectionMethod_None = 1; 98 | OverlayInjectionMethod_Default = 2; 99 | OverlayInjectionMethod_SDK = 3; 100 | } 101 | 102 | optional Hotkeys hotkeys = 9; 103 | } 104 | 105 | message StartDeniedRsp { 106 | optional Reason reason = 1; 107 | enum Reason { 108 | GamePatchRequired = 0; 109 | } 110 | } 111 | 112 | message UpdateRequiredRsp { 113 | 114 | } 115 | 116 | message ConfirmationRsp { 117 | 118 | } 119 | 120 | message Req { 121 | optional StartReq startReq = 1; 122 | optional HotkeyStateChangedReq hotkeyStateChangedReq = 3; 123 | } 124 | 125 | message ReconnectPush { 126 | 127 | } 128 | 129 | message UserInteractionRequiredPush { 130 | 131 | } 132 | 133 | message SteamOverlayShowPush { 134 | optional string url = 1; 135 | optional uint32 steamAppId = 2; 136 | } 137 | 138 | message UpdateHotKeysPush { 139 | required Hotkeys hotkeys = 1; 140 | } 141 | 142 | message Push { 143 | optional ReconnectPush reconnectPush = 2; 144 | optional UserInteractionRequiredPush userInteractionRequiredPush = 3; 145 | optional SteamOverlayShowPush steamOverlayShowPush = 4; 146 | optional UpdateHotKeysPush updateHotKeysPush = 5; 147 | } 148 | 149 | message Rsp { 150 | optional StartGrantedRsp startGrantedRsp = 1; 151 | optional StartDeniedRsp startDeniedRsp = 2; 152 | optional DiscordRichPresence discordRichPresence = 3; 153 | } 154 | 155 | message Upstream { 156 | optional Req req = 1; 157 | } 158 | 159 | message Downstream { 160 | optional Push push = 1; 161 | optional Rsp rsp = 2; 162 | } 163 | -------------------------------------------------------------------------------- /proto/proto_game_stats_cache/game_stats_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.game_stats_cache; 4 | 5 | message GameStatsCard { 6 | optional string space_id = 1; 7 | optional string json = 2; 8 | } 9 | 10 | message GameStatsCache { 11 | required uint32 version = 1; 12 | repeated GameStatsCard player_stats_cards = 2; 13 | repeated GameStatsCard community_stats_cards = 3; 14 | } 15 | -------------------------------------------------------------------------------- /proto/proto_installation_backup/installation_backup.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.installation_backup; 4 | 5 | message LicenseLocale { 6 | required string language = 1; 7 | required bytes sha1 = 2; 8 | optional string text = 3; 9 | optional string name = 4; 10 | } 11 | 12 | message License { 13 | required string identifier = 1; 14 | required uint32 version = 2; 15 | repeated LicenseLocale locales = 3; 16 | optional LicenseFormat format = 4; 17 | } 18 | 19 | message Slice { 20 | optional bytes sha1 = 1; 21 | optional uint32 size = 2; 22 | optional uint64 offset = 3; 23 | } 24 | 25 | message Archive { 26 | optional string filename = 1; 27 | optional uint64 size = 2; 28 | repeated Slice slices = 3; 29 | } 30 | 31 | message Disc { 32 | optional uint32 number = 1; 33 | optional string label = 2; 34 | repeated Archive archives = 3; 35 | } 36 | 37 | message TextFile { 38 | required string language = 1; 39 | required string fileName = 2; 40 | } 41 | 42 | message Autorun { 43 | optional string gameTitle = 1; 44 | repeated TextFile readmeFiles = 2; 45 | repeated TextFile manualFiles = 3; 46 | } 47 | 48 | message InstallationBackup { 49 | required uint32 version = 1; 50 | optional uint32 productId = 2; 51 | repeated Disc discs = 3; 52 | repeated License licenses = 4; 53 | optional string manifestSha1 = 5; 54 | optional string environment = 6; 55 | optional Autorun autorun = 7; 56 | repeated string languages = 8; 57 | optional bytes sha1 = 9; 58 | repeated uint32 productPackUplayIds = 10; 59 | } 60 | 61 | enum LicenseFormat { 62 | LicenseFormat_Text = 1; 63 | LicenseFormat_Html = 2; 64 | } 65 | -------------------------------------------------------------------------------- /proto/proto_new_channel/new_channel.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package uplay.channelservice.v1; 4 | 5 | message ChannelMetadata { 6 | string name = 1; 7 | string topic = 2; 8 | } 9 | 10 | message Channel { 11 | string id = 1; 12 | string parent_id = 2; 13 | ChannelMetadata metadata = 3; 14 | string creator_id = 4; 15 | string space_id = 5; 16 | ChannelType type = 6; 17 | repeated Membership memberships = 7; 18 | string last_message_time = 8; 19 | } 20 | 21 | message Membership { 22 | string channel_id = 1; 23 | string profile_id = 2; 24 | MembershipType membership_type = 3; 25 | string added_by = 4; 26 | string create_time = 5; 27 | string update_time = 6; 28 | } 29 | 30 | message Message { 31 | string id = 1; 32 | string parent_id = 2; 33 | string channel_id = 3; 34 | string author_id = 4; 35 | string text_message = 5; 36 | string create_time = 6; 37 | string update_time = 7; 38 | MessageType type = 8; 39 | repeated string mentions = 9; 40 | } 41 | 42 | message MessageKey { 43 | string id = 1; 44 | string author_id = 2; 45 | } 46 | 47 | message GetChannelRequest { 48 | string space_id = 1; 49 | string channel_id = 2; 50 | } 51 | 52 | message CreateChannelRequest { 53 | string space_id = 1; 54 | Channel channel = 2; 55 | repeated string members = 3; 56 | } 57 | 58 | message UpdateChannelMetadataRequest { 59 | string space_id = 1; 60 | string channel_id = 2; 61 | ChannelMetadata channel_metadata = 3; 62 | } 63 | 64 | message ListChannelsRequest { 65 | string space_id = 1; 66 | int32 offset = 2; 67 | int32 limit = 3; 68 | MembershipType membership_type = 4; 69 | } 70 | 71 | message ListChannelsResponse { 72 | repeated Channel channels = 1; 73 | string next_token = 2; 74 | } 75 | 76 | message CreateMembershipsRequest { 77 | string space_id = 1; 78 | string channel_id = 2; 79 | repeated string members = 3; 80 | } 81 | 82 | message CreateMembershipsResponse { 83 | repeated Membership memberships = 1; 84 | } 85 | 86 | message DeleteMembershipRequest { 87 | string space_id = 1; 88 | string channel_id = 2; 89 | } 90 | 91 | message UpdateMembershipRequest { 92 | string space_id = 1; 93 | string channel_id = 2; 94 | Membership membership = 3; 95 | } 96 | 97 | message GetMessageRequest { 98 | string space_id = 1; 99 | string channel_id = 2; 100 | string message_id = 3; 101 | } 102 | 103 | message CreateMessageRequest { 104 | string space_id = 1; 105 | string channel_id = 2; 106 | Message message = 3; 107 | } 108 | 109 | message DeleteMessageRequest { 110 | string space_id = 1; 111 | string channel_id = 2; 112 | string message_id = 3; 113 | } 114 | 115 | message UpdateMessageRequest { 116 | string space_id = 1; 117 | string channel_id = 2; 118 | string message_id = 3; 119 | Message message = 4; 120 | } 121 | 122 | message ListMessagesRequest { 123 | string space_id = 1; 124 | string channel_id = 2; 125 | int32 limit = 3; 126 | string page_token = 4; 127 | string parent_id = 5; 128 | } 129 | 130 | message ListMessagesResponse { 131 | repeated Message messages = 1; 132 | string next_token = 2; 133 | } 134 | 135 | message AckMessageRequest { 136 | string space_id = 1; 137 | string channel_id = 2; 138 | string message_id = 3; 139 | } 140 | 141 | message AckMessageResponse { 142 | string channel_id = 1; 143 | string message_id = 2; 144 | } 145 | 146 | message GetAckMessageRequest { 147 | string space_id = 1; 148 | string channel_id = 2; 149 | } 150 | 151 | message GetAckMessageResponse { 152 | string channel_id = 1; 153 | string message_id = 2; 154 | } 155 | 156 | message PlayerNotificationContent { 157 | string channel_id = 1; 158 | string profile_id = 2; 159 | string message_id = 3; 160 | ChannelMetadata metadata = 4; 161 | Channel channel = 5; 162 | Membership membership = 6; 163 | repeated Membership memberships = 7; 164 | Message message = 8; 165 | } 166 | 167 | message PlayerNotification { 168 | PlayerNotificationContent content = 1; 169 | PlayerNotificationType notification_type = 2; 170 | string profile_id = 3; 171 | string space_id = 4; 172 | } 173 | 174 | message PlayerNotificationBatch { 175 | repeated PlayerNotification notifications = 1; 176 | } 177 | 178 | enum ChannelType { 179 | CHANNEL_TYPE_UNSPECIFIED = 0; 180 | DM = 1; 181 | GROUP = 2; 182 | } 183 | 184 | enum MembershipType { 185 | MEMBERSHIP_TYPE_UNSPECIFIED = 0; 186 | PENDING = 1; 187 | ACTIVE = 2; 188 | } 189 | 190 | enum MessageType { 191 | MESSAGE_TYPE_UNSPECIFIED = 0; 192 | GAME_INVITE = 1; 193 | TEXT_MESSAGE = 2; 194 | USER_JOINED = 3; 195 | USER_LEFT = 4; 196 | USER_ADDED = 5; 197 | } 198 | 199 | enum PlayerNotificationType { 200 | notification_type_unspecified = 0; 201 | upc_channel_metadata_updated = 1; 202 | upc_channel_created = 2; 203 | upc_channel_memberships_created = 3; 204 | upc_channel_membership_updated = 4; 205 | upc_channel_membership_deleted = 5; 206 | upc_channel_message_created = 6; 207 | upc_channel_message_updated = 7; 208 | upc_channel_message_deleted = 8; 209 | } 210 | -------------------------------------------------------------------------------- /proto/proto_offline/offline.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.offline; 4 | 5 | message UserInfo { 6 | optional string username = 1; 7 | optional string password = 2; 8 | required string ubiAccountId = 3; 9 | optional string nickname = 4; 10 | optional string email = 5; 11 | optional string name = 6; 12 | optional bytes password_hash = 7; 13 | optional bytes password_salt = 8; 14 | optional string email_hash = 9; 15 | } 16 | 17 | message LastUserInfo { 18 | optional string email = 1; 19 | optional string password = 2; 20 | } 21 | 22 | message Users { 23 | repeated UserInfo users = 1; 24 | optional LastUserInfo lastUser = 2; 25 | optional LastUserInfo lastUserUat = 3; 26 | } 27 | -------------------------------------------------------------------------------- /proto/proto_orbitdll/OrbitDll.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.orbitdll; 4 | 5 | message GetLoginDetailsReq { 6 | 7 | } 8 | 9 | message GetLoginDetailsRsp { 10 | required string username = 1; 11 | required string password = 2; 12 | required string cdkey = 3; 13 | } 14 | 15 | message GetOsiReq { 16 | required uint32 subId = 1; 17 | } 18 | 19 | message GetOsiRsp { 20 | optional string pipename = 1; 21 | 22 | required Status status = 2; 23 | enum Status { 24 | Ok = 0; 25 | Failed = 1; 26 | } 27 | } 28 | 29 | message InitReq { 30 | required uint32 uplayId = 1; 31 | } 32 | 33 | message InitRsp { 34 | required string savegameStoragePath = 1; 35 | required bool success = 2; 36 | } 37 | 38 | message Req { 39 | required uint32 requestId = 1; 40 | optional GetLoginDetailsReq getLoginDetails = 2; 41 | optional GetOsiReq getOsi = 3; 42 | optional InitReq init = 12; 43 | } 44 | 45 | message Rsp { 46 | required uint32 requestId = 1; 47 | optional GetLoginDetailsRsp getLoginDetails = 2; 48 | optional GetOsiRsp getOsi = 3; 49 | optional InitRsp init = 12; 50 | } 51 | -------------------------------------------------------------------------------- /proto/proto_overlay/overlay.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.overlay; 4 | 5 | message GetConfigurationReq { 6 | 7 | } 8 | 9 | message GetConfigurationRsp { 10 | required string library_path = 1; 11 | } 12 | 13 | message StartReq { 14 | required uint32 width = 1; 15 | required uint32 height = 2; 16 | required uint32 pid = 3; 17 | } 18 | 19 | message StartSuccessRsp { 20 | required string shared_memory_name = 1; 21 | required string shared_memory_mutex_name = 2; 22 | optional bool virtual_controls_enabled = 3; 23 | } 24 | 25 | message StartFailureRsp { 26 | 27 | } 28 | 29 | message StartRsp { 30 | optional StartSuccessRsp success_rsp = 1; 31 | optional StartFailureRsp failure_rsp = 2; 32 | } 33 | 34 | message ResizeReq { 35 | required uint32 width = 1; 36 | required uint32 height = 2; 37 | } 38 | 39 | message ResizeSuccessRsp { 40 | required string shared_memory_name = 1; 41 | required string shared_memory_mutex_name = 2; 42 | } 43 | 44 | message ResizeFailureRsp { 45 | 46 | } 47 | 48 | message ResizeRsp { 49 | optional ResizeSuccessRsp success_rsp = 1; 50 | optional ResizeFailureRsp failure_rsp = 2; 51 | } 52 | 53 | message Rectangle { 54 | required uint32 top_left_posX = 1; 55 | required uint32 top_left_posY = 2; 56 | required uint32 bottom_right_posX = 3; 57 | required uint32 bottom_right_posY = 4; 58 | } 59 | 60 | message ViewUpdatedRsp { 61 | repeated Rectangle dirtyRectangles = 1; 62 | required uint32 version = 2; 63 | } 64 | 65 | message FocusEventReq { 66 | optional bool focus = 1; 67 | } 68 | 69 | message Win32KeyMessageReq { 70 | required int32 message = 1; 71 | required int32 w_param = 2; 72 | required int32 l_param = 3; 73 | } 74 | 75 | message AppleKeyEventReq { 76 | required int32 type = 1; 77 | required int32 modifierFlags = 2; 78 | required double timestamp = 3; 79 | required string characters = 4; 80 | required string charactersIgnoringModifiers = 5; 81 | required int32 isARepeat = 6; 82 | required uint32 keyCode = 7; 83 | } 84 | 85 | message MouseButtonPressedReq { 86 | required int32 button = 1; 87 | } 88 | 89 | message MouseButtonReleasedReq { 90 | required int32 button = 1; 91 | } 92 | 93 | message MouseDoubleClickReq { 94 | required int32 button = 1; 95 | } 96 | 97 | message MouseMovedReq { 98 | required int32 x = 1; 99 | required int32 y = 2; 100 | optional int32 modifiers = 3; 101 | optional bool is_virtual = 4; 102 | } 103 | 104 | message MouseWheelMovedReq { 105 | required int32 scroll_x = 1; 106 | required int32 scroll_y = 2; 107 | } 108 | 109 | message LangChangeReq { 110 | optional string langAbbreviate = 1; 111 | } 112 | 113 | message ShowUiReq { 114 | 115 | } 116 | 117 | message CloseUiReq { 118 | 119 | } 120 | 121 | message RefreshUiReq { 122 | 123 | } 124 | 125 | message BufferReadyReq { 126 | 127 | } 128 | 129 | message CreateProcessReq { 130 | required uint32 pid = 1; 131 | required uint32 starterId = 2; 132 | } 133 | 134 | message CreateProcessRsp { 135 | required uint32 pid = 1; 136 | } 137 | 138 | message StartStreamPush { 139 | required uint32 frame_width = 1; 140 | required uint32 frame_height = 2; 141 | required uint32 buffer_size = 3; 142 | required uint32 frames_per_second = 4; 143 | required string buffer_name = 5; 144 | } 145 | 146 | message EndStreamPush { 147 | 148 | } 149 | 150 | message VideoFrameReadyReq { 151 | required uint32 buffer_index = 1; 152 | } 153 | 154 | message VideoFrameReleasedRsp { 155 | required uint32 buffer_index = 1; 156 | } 157 | 158 | message CaptureScreenshotPush { 159 | required uint32 frame_width = 1; 160 | required uint32 frame_height = 2; 161 | required string buffer_name = 3; 162 | required uint32 buffer_size = 4; 163 | } 164 | 165 | message UiOpenedPush { 166 | required bool success = 1; 167 | } 168 | 169 | message UiClosedPush { 170 | required bool success = 1; 171 | } 172 | 173 | message IMEClearCompositionPush { 174 | 175 | } 176 | 177 | message IMESelectCandidatePush { 178 | required uint32 selected_candidate_index = 1; 179 | } 180 | 181 | message CursorChangePush { 182 | required uint32 cursor_id = 1; 183 | } 184 | 185 | message SharePlayStartPush { 186 | required string session_id = 1; 187 | required string token = 2; 188 | required string app_id = 3; 189 | required bool is_uat = 4; 190 | required uint32 bitrate = 5; 191 | required string guest_id = 6; 192 | required bool mouse_keyboard_allowed = 7; 193 | required bool gamepad_allowed = 8; 194 | } 195 | 196 | message SharePlayStopPush { 197 | 198 | } 199 | 200 | message SharePlaySettingsPush { 201 | required uint32 bitrate = 1; 202 | required bool mouse_keyboard_allowed = 2; 203 | required bool gamepad_allowed = 3; 204 | } 205 | 206 | message SharePlayStartConfig { 207 | optional uint32 width = 1; 208 | optional uint32 height = 2; 209 | optional uint32 bitrate = 3; 210 | optional bool is_audio_enabled = 4; 211 | optional bool is_focused = 5; 212 | } 213 | 214 | message SharePlayStartReq { 215 | required bool result = 1; 216 | optional string invite_token = 2; 217 | optional SharePlayStartConfig start_config = 3; 218 | } 219 | 220 | message SharePlayStopReq { 221 | required bool result = 1; 222 | } 223 | 224 | message SharePlaySettingsReq { 225 | required uint32 result = 1; 226 | } 227 | 228 | message SharePlayGuestConnectedReq { 229 | required string guest_id = 1; 230 | } 231 | 232 | message SharePlayGuestDisconnectedReq { 233 | required string guest_id = 1; 234 | } 235 | 236 | message SharePlayLatencyReq { 237 | required uint32 latency = 1; 238 | } 239 | 240 | message ScreenshotReadyReq { 241 | required bool isVulkanHDR = 1; 242 | } 243 | 244 | message ScreenshotCaptureFailureReq { 245 | 246 | } 247 | 248 | message VideoCaptureFailureReq { 249 | 250 | } 251 | 252 | message IMECommitText { 253 | optional string text = 1; 254 | } 255 | 256 | message IMECompositionUnderline { 257 | optional int32 from = 1; 258 | optional int32 to = 2; 259 | optional uint32 color = 3; 260 | optional uint32 background_color = 4; 261 | optional int32 thick = 5; 262 | } 263 | 264 | message IMESetCompositionReq { 265 | optional string text = 1; 266 | optional int32 composition_start = 2; 267 | repeated IMECompositionUnderline underlines = 3; 268 | } 269 | 270 | message IMECancelCompositionReq { 271 | 272 | } 273 | 274 | message IMEUpdateCandidatesReq { 275 | repeated string candidates = 1; 276 | optional uint32 selected_index = 2; 277 | } 278 | 279 | message Req { 280 | optional StartReq start_req = 1; 281 | optional ResizeReq resize_req = 2; 282 | optional Win32KeyMessageReq win_32_key_message_req = 3; 283 | optional AppleKeyEventReq apple_key_event_req = 4; 284 | optional MouseButtonPressedReq mouse_button_pressed_req = 5; 285 | optional MouseButtonReleasedReq mouse_button_released_req = 6; 286 | optional MouseMovedReq mouse_moved_req = 7; 287 | optional MouseWheelMovedReq mouse_wheel_moved_req = 8; 288 | optional CloseUiReq close_ui_req = 10; 289 | optional RefreshUiReq refresh_ui_req = 11; 290 | optional GetConfigurationReq get_configuration_req = 12; 291 | optional MouseDoubleClickReq mouse_double_click_req = 14; 292 | optional BufferReadyReq buffer_ready_req = 15; 293 | optional VideoFrameReadyReq video_frame_ready_req = 16; 294 | optional ScreenshotReadyReq screenshot_ready_req = 17; 295 | optional ScreenshotCaptureFailureReq screenshot_capture_failure_req = 18; 296 | optional VideoCaptureFailureReq video_capture_failure_req = 19; 297 | optional LangChangeReq lang_change_req = 20; 298 | optional UpdateFpsReq update_fps_req = 21; 299 | optional FocusEventReq focus_event_req = 22; 300 | optional IMECommitText ime_commit_text_req = 23; 301 | optional IMESetCompositionReq ime_set_composition_req = 24; 302 | optional IMECancelCompositionReq ime_cancel_composition_req = 25; 303 | optional IMEUpdateCandidatesReq ime_update_candidates_req = 26; 304 | optional SharePlayStartReq share_play_start_req = 27; 305 | optional SharePlayStopReq share_play_stop_req = 28; 306 | optional SharePlaySettingsReq share_play_settings_req = 29; 307 | optional SharePlayGuestConnectedReq share_play_guest_connected_req = 30; 308 | optional SharePlayGuestDisconnectedReq share_play_guest_disconnected_req = 31; 309 | optional SharePlayLatencyReq share_play_latency_req = 32; 310 | } 311 | 312 | message Rsp { 313 | optional StartRsp start_rsp = 1; 314 | optional ResizeRsp resize_rsp = 2; 315 | optional ViewUpdatedRsp view_updated_rsp = 3; 316 | optional GetConfigurationRsp get_configuration_rsp = 4; 317 | optional VideoFrameReleasedRsp video_frame_released_rsp = 6; 318 | } 319 | 320 | message MultipleLogin { 321 | 322 | } 323 | 324 | message UserBannedPush { 325 | 326 | } 327 | 328 | message Push { 329 | optional MultipleLogin multiple_login = 1; 330 | optional StartStreamPush start_stream = 2; 331 | optional EndStreamPush end_stream = 3; 332 | optional CaptureScreenshotPush capture_screenshot = 4; 333 | optional CursorChangePush cursor_change = 5; 334 | optional UserBannedPush user_banned = 6; 335 | optional UiOpenedPush ui_opened = 7; 336 | optional UiClosedPush ui_closed = 8; 337 | optional IMEClearCompositionPush ime_clear_composition = 9; 338 | optional IMESelectCandidatePush ime_select_candidate = 10; 339 | optional SharePlayStartPush share_play_start = 11; 340 | optional SharePlayStopPush share_play_stop = 12; 341 | optional SharePlaySettingsPush share_play_settings = 13; 342 | } 343 | 344 | message Upstream { 345 | optional Req req = 1; 346 | } 347 | 348 | message Downstream { 349 | optional Push push = 1; 350 | optional Rsp rsp = 2; 351 | } 352 | 353 | message UpdateFpsReq { 354 | required uint32 fps = 1; 355 | } 356 | -------------------------------------------------------------------------------- /proto/proto_ownership_cache/ownership_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.ownership_cache; 4 | 5 | message OwnedGame { 6 | required uint32 product_id = 1; 7 | optional uint32 uplay_id = 2; 8 | optional uint32 download_id = 9; 9 | optional uint32 orbit_id = 3; 10 | optional string cd_key = 4; 11 | optional uint32 platform = 5; 12 | optional uint32 product_type = 6; 13 | optional uint32 state = 7; 14 | repeated uint32 product_associations = 8; 15 | optional string game_code = 10; 16 | optional uint32 brand_id = 11; 17 | optional bool pending_keystorage_ownership = 12; 18 | optional string legacy_space_id = 13; 19 | optional string legacy_app_id = 14; 20 | optional string game_token = 15; 21 | repeated uint32 activation_ids = 16; 22 | 23 | optional TargetPartner target_partner = 17; 24 | enum TargetPartner { 25 | TargetPartner_None = 0; 26 | TargetPartner_EpicGames = 1; 27 | } 28 | 29 | optional ActivationType activation_type = 18; 30 | enum ActivationType { 31 | ActivationType_Purchase = 0; 32 | ActivationType_Trial = 1; 33 | ActivationType_Subscription = 2; 34 | } 35 | 36 | optional string ubiServices_app_id = 19; 37 | 38 | enum PackageState { 39 | PackageState_Unavailable = 0; 40 | PackageState_PreReleased = 1; 41 | PackageState_PreDownloadable = 2; 42 | PackageState_Released = 3; 43 | PackageState_Expired = 4; 44 | } 45 | } 46 | 47 | message OwnershipCache { 48 | repeated OwnedGame owned_games = 1; 49 | repeated uint32 product_ids = 2; 50 | } 51 | -------------------------------------------------------------------------------- /proto/proto_party/party.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.party; 4 | 5 | message Party { 6 | required uint64 party_id = 1; 7 | repeated PartyMember party_members = 2; 8 | } 9 | 10 | message ReconnectInfo { 11 | required bool reconnect_ok = 1; 12 | optional Party party = 2; 13 | } 14 | 15 | message StartSessionReq { 16 | optional uint32 cookie = 1; 17 | } 18 | 19 | message StartSessionRsp { 20 | required uint32 cookie = 1; 21 | optional ReconnectInfo reconnect_info = 2; 22 | } 23 | 24 | message User { 25 | required string account_id = 1; 26 | } 27 | 28 | message Guest { 29 | required string nick = 1; 30 | } 31 | 32 | message GameSessionRemoved { 33 | 34 | } 35 | 36 | message UserDataRemoved { 37 | 38 | } 39 | 40 | message GuestRemoved { 41 | 42 | } 43 | 44 | message GameSession { 45 | required uint32 uplay_id = 1; 46 | optional uint64 game_session_id = 2; 47 | optional string game_session_id_v2 = 5; 48 | required bytes game_session_data = 3; 49 | required bool joinable = 4; 50 | optional uint32 size = 6; 51 | optional uint32 max_size = 7; 52 | } 53 | 54 | message PartyMember { 55 | required User user = 1; 56 | 57 | optional Status status = 2; 58 | enum Status { 59 | Invited = 1; 60 | Member = 2; 61 | Offline = 3; 62 | } 63 | 64 | optional GameSession game_session = 3; 65 | optional GameSessionRemoved game_session_removed = 4; 66 | optional Guest guest = 5; 67 | optional GuestRemoved guest_removed = 6; 68 | optional bool party_owner = 7; 69 | optional bytes user_data = 8; 70 | optional UserDataRemoved user_data_removed = 9; 71 | } 72 | 73 | message PartyUpdate { 74 | repeated User left = 1; 75 | repeated PartyMember added = 2; 76 | repeated PartyMember updated = 3; 77 | } 78 | 79 | message PartyInviteReq { 80 | repeated User users_to_invite = 1; 81 | required string uplay_id = 2; 82 | required string product_name = 3; 83 | required uint64 chat_channel_id = 4; 84 | optional uint32 max_party_size = 5; 85 | optional Guest guest = 6; 86 | optional bytes user_data = 7; 87 | optional GameSession game_session = 8; 88 | } 89 | 90 | message PartyInviteRsp { 91 | required bool ok = 1; 92 | optional Party party = 2; 93 | } 94 | 95 | message LeaveReq { 96 | 97 | } 98 | 99 | message LeaveRsp { 100 | required bool ok = 1; 101 | } 102 | 103 | message PartyInviteResponseReq { 104 | required uint64 party_id = 1; 105 | 106 | required Response response = 2; 107 | enum Response { 108 | Accept = 1; 109 | Decline = 2; 110 | } 111 | 112 | optional Guest guest = 3; 113 | optional bytes user_data = 4; 114 | optional GameSession game_session = 5; 115 | } 116 | 117 | message PartyInviteResponseRsp { 118 | required PartyReqResult result = 1; 119 | optional Party party = 2; 120 | } 121 | 122 | message PromoteToLeaderReq { 123 | required User user = 1; 124 | } 125 | 126 | message PromoteToLeaderRsp { 127 | required bool ok = 1; 128 | } 129 | 130 | message SetUserDataReq { 131 | optional bytes user_data = 1; 132 | } 133 | 134 | message SetUserDataRsp { 135 | required bool ok = 1; 136 | } 137 | 138 | message GameSessionInviteReq { 139 | 140 | } 141 | 142 | message GameSessionInviteRsp { 143 | required bool ok = 1; 144 | } 145 | 146 | message SetInGameSessionReq { 147 | optional GameSession game_session = 1; 148 | } 149 | 150 | message SetInGameSessionRsp { 151 | required bool ok = 1; 152 | } 153 | 154 | message SetGuestReq { 155 | optional Guest guest = 1; 156 | } 157 | 158 | message SetGuestRsp { 159 | required PartyReqResult result = 1; 160 | } 161 | 162 | message ChatMessage { 163 | required string simple_text_message = 1; 164 | } 165 | 166 | message ChatMessageReq { 167 | required ChatMessage chat_message = 1; 168 | } 169 | 170 | message ChatMessageRsp { 171 | required bool ok = 1; 172 | } 173 | 174 | message Req { 175 | required uint32 request_id = 1; 176 | optional PartyInviteReq party_invite_req = 2; 177 | optional PartyInviteResponseReq party_invite_response_req = 3; 178 | optional LeaveReq leave_req = 4; 179 | optional GameSessionInviteReq game_session_invite_req = 5; 180 | optional SetInGameSessionReq set_in_game_session_req = 6; 181 | optional SetUserDataReq set_user_data_req = 7; 182 | optional PromoteToLeaderReq promote_leader_req = 8; 183 | optional SetGuestReq set_guest_req = 9; 184 | optional StartSessionReq start_session_req = 10; 185 | optional ChatMessageReq chat_message_req = 11; 186 | } 187 | 188 | message Rsp { 189 | required uint32 request_id = 1; 190 | optional PartyInviteRsp party_invite_rsp = 2; 191 | optional PartyInviteResponseRsp party_invite_response_rsp = 3; 192 | optional LeaveRsp leave_rsp = 4; 193 | optional GameSessionInviteRsp game_session_invite_rsp = 5; 194 | optional SetInGameSessionRsp set_in_game_session_rsp = 6; 195 | optional SetUserDataRsp set_user_data_rsp = 7; 196 | optional PromoteToLeaderRsp promote_leader_rsp = 8; 197 | optional SetGuestRsp set_guest_rsp = 9; 198 | optional StartSessionRsp start_session_rsp = 10; 199 | optional ChatMessageRsp chat_message_rsp = 11; 200 | } 201 | 202 | message PartyChangedPush { 203 | required PartyUpdate party_update = 1; 204 | } 205 | 206 | message PartyInvitationPush { 207 | required Party party = 1; 208 | required string uplay_id = 2; 209 | required string product_name = 3; 210 | required string from_account_id = 4; 211 | required uint64 chat_channel_id = 5; 212 | } 213 | 214 | message GameInvitePush { 215 | required GameSession game_session = 1; 216 | } 217 | 218 | message ChatMessagePush { 219 | required User sender = 1; 220 | required ChatMessage chat_message = 2; 221 | } 222 | 223 | message Push { 224 | optional PartyChangedPush party_changed_push = 1; 225 | optional PartyInvitationPush party_invitation_push = 2; 226 | optional GameInvitePush game_invite_push = 3; 227 | optional ChatMessagePush chat_message_push = 4; 228 | } 229 | 230 | message Upstream { 231 | optional Req request = 1; 232 | } 233 | 234 | message Downstream { 235 | optional Rsp response = 1; 236 | optional Push push = 2; 237 | } 238 | 239 | enum PartyReqResult { 240 | PartyReqResult_Ok = 1; 241 | PartyReqResult_Failed = 2; 242 | PartyReqResult_PartyFull = 3; 243 | } 244 | -------------------------------------------------------------------------------- /proto/proto_pcbang/pcbang.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.pcbang; 4 | 5 | message InitializeReq { 6 | string provider = 1; 7 | } 8 | 9 | message InitializeRsp { 10 | Result result = 1; 11 | repeated string pre_ownership_tokens = 2; 12 | } 13 | 14 | message NeowizSpendPointsReq { 15 | uint32 product_id = 1; 16 | SpendingAction spending_action = 2; 17 | } 18 | 19 | message NeowizSpendPointsRsp { 20 | Result result = 1; 21 | string token = 2; 22 | string error_msg = 3; 23 | } 24 | 25 | message Req { 26 | uint32 request_id = 1; 27 | 28 | oneof Request { 29 | InitializeReq initialize_req = 2; 30 | NeowizSpendPointsReq neowiz_spend_points_req = 3; 31 | } 32 | } 33 | 34 | message Rsp { 35 | uint32 request_id = 1; 36 | 37 | oneof Response { 38 | InitializeRsp initialize_rsp = 2; 39 | NeowizSpendPointsRsp neowiz_spend_points_rsp = 3; 40 | } 41 | } 42 | 43 | message Upstream { 44 | Req request = 1; 45 | } 46 | 47 | message Downstream { 48 | Rsp response = 1; 49 | } 50 | 51 | enum Result { 52 | OK = 0; 53 | Error = 1; 54 | InvalidIp = 2; 55 | NoPoints = 3; 56 | Timeout = 4; 57 | } 58 | 59 | enum SpendingAction { 60 | Start = 0; 61 | Ping = 1; 62 | End = 2; 63 | } 64 | -------------------------------------------------------------------------------- /proto/proto_playtime/playtime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.playtime; 4 | 5 | message UpdatePlaytimeReq { 6 | repeated uint32 product_ids = 1; 7 | optional uint32 seconds_to_add = 2; 8 | optional bool is_active_play_session = 3; 9 | optional uint32 game_id = 4; 10 | } 11 | 12 | message UpdatePlaytimeRsp { 13 | optional Result result = 1; 14 | } 15 | 16 | message GetPlaytimeReq { 17 | optional string account_id = 1; 18 | optional uint32 product_id = 2; 19 | } 20 | 21 | message GetPlaytimeRsp { 22 | optional Result result = 1; 23 | optional uint32 seconds = 2; 24 | optional string last_played = 3; 25 | } 26 | 27 | message GetFriendsPlaytimeReq { 28 | repeated string my_friends = 1; 29 | optional uint32 game_id = 2; 30 | } 31 | 32 | message GetFriendsPlaytimeRsp { 33 | optional Result result = 1; 34 | repeated string my_friends = 2; 35 | } 36 | 37 | message Req { 38 | optional uint32 request_id = 1; 39 | optional UpdatePlaytimeReq update_playtime_req = 2; 40 | optional GetPlaytimeReq get_playtime_req = 3; 41 | optional GetFriendsPlaytimeReq get_friends_playtime_req = 4; 42 | } 43 | 44 | message Rsp { 45 | optional uint32 request_id = 1; 46 | optional UpdatePlaytimeRsp update_playtime_rsp = 2; 47 | optional GetPlaytimeRsp get_playtime_rsp = 3; 48 | optional GetFriendsPlaytimeRsp get_friends_playtime_rsp = 4; 49 | } 50 | 51 | message Upstream { 52 | optional Req request = 1; 53 | } 54 | 55 | message Downstream { 56 | optional Rsp response = 1; 57 | } 58 | 59 | enum Result { 60 | Result_Success = 0; 61 | Result_Failure = 1; 62 | Result_TimeOut = 2; 63 | Result_ServerError = 3; 64 | Result_BadRequest = 4; 65 | } 66 | -------------------------------------------------------------------------------- /proto/proto_playtime_cache/playtime_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.playtime_cache; 4 | 5 | message PlaytimeItem { 6 | required uint32 product_id = 1; 7 | optional uint32 seconds_buffer = 2; 8 | } 9 | 10 | message PlaytimeCache { 11 | required uint32 version = 1; 12 | repeated PlaytimeItem playtimes = 2; 13 | } 14 | -------------------------------------------------------------------------------- /proto/proto_recently_played/recently_played.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.recently_played; 4 | 5 | message GameSessionInfo { 6 | required uint32 productId = 1; 7 | required uint64 sessionEndedTimestamp = 2; 8 | } 9 | 10 | message RecentlyPlayedGames { 11 | repeated GameSessionInfo games = 1; 12 | } 13 | -------------------------------------------------------------------------------- /proto/proto_settings/settings.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.settings; 4 | 5 | import "google/protobuf/descriptor.proto"; 6 | 7 | message User { 8 | optional bool syncsavegames = 1 [default = true]; 9 | optional bool offline = 2 [default = false]; 10 | optional CloseBehavior closebehavior = 3 [default = CloseBehavior_Undefined]; 11 | optional LandingPage landingpage = 4 [default = LandingPageNews]; 12 | optional bool start_on_windows_start = 5 [default = false]; 13 | optional bool non_friend_game_invite_enabled = 6 [default = true]; 14 | optional bool landingpage_set_by_user = 7 [default = false]; 15 | } 16 | 17 | message Overlay { 18 | optional bool enabled = 1 [default = true]; 19 | optional bool forceunhookgame = 2 [default = false]; 20 | optional bool fps_enabled = 3 [default = false]; 21 | optional bool warning_enabled = 4 [default = true]; 22 | } 23 | 24 | message Language { 25 | optional string code = 1 [default = "en-US"]; 26 | } 27 | 28 | message Misc { 29 | optional string installer_cache_path = 1; 30 | optional string screenshot_root_path = 2; 31 | optional bool enable_screenshots_on_achievements = 3 [default = false]; 32 | optional string game_installation_path = 4; 33 | optional bool enable_auto_wall_posts = 5 [default = true]; 34 | optional bool save_screenshot_uncompressed_copy = 6 [default = false]; 35 | } 36 | 37 | message Position { 38 | optional uint32 left = 1 [default = 0]; 39 | optional uint32 top = 2 [default = 0]; 40 | optional uint32 width = 3 [default = 0]; 41 | optional uint32 height = 4 [default = 0]; 42 | optional bool maximized = 5 [default = false]; 43 | } 44 | 45 | message ModelessPositions { 46 | optional Position friends_window = 1; 47 | optional Position conversations_window = 2; 48 | } 49 | 50 | message Notifications { 51 | optional bool inGameEnabled = 1 [default = true]; 52 | optional bool permanentInGameEnabled = 2 [default = true]; 53 | optional bool inGameFriendOnlineEnabled = 3 [default = true]; 54 | optional bool sysTrayEnabled = 4 [default = true]; 55 | optional bool desktopFriendRequestEnabled = 5 [default = true]; 56 | optional bool desktopFriendOnlineEnabled = 6 [default = true]; 57 | optional bool desktopChatEnabled = 7 [default = true]; 58 | optional bool desktopFriendGameEnabled = 8 [default = true]; 59 | optional bool desktopGameInviteEnabled = 9 [default = true]; 60 | optional bool desktopPartyInviteEnabled = 10 [default = true]; 61 | optional bool desktopDownloadCompleteEnabled = 11 [default = true]; 62 | optional bool desktopGamePatchAvailableEnabled = 12 [default = true]; 63 | optional bool desktopPlayAvailableEnabled = 13 [default = true]; 64 | optional bool desktopGroupInviteEnabled = 14 [default = true]; 65 | optional bool desktopScreenshotsEnabled = 15 [default = true]; 66 | optional bool desktopAchievementsEnabled = 16 [default = true]; 67 | optional bool desktopClubActionsEnabled = 17 [default = false]; 68 | } 69 | 70 | message Masters { 71 | optional string username = 1; 72 | optional string password = 2; 73 | } 74 | 75 | message Hotkey { 76 | optional uint32 keyCode = 1 [default = 0]; 77 | optional bool altState = 2 [default = false]; 78 | optional bool shiftState = 3 [default = false]; 79 | optional bool controlState = 4 [default = false]; 80 | } 81 | 82 | message Downloads { 83 | optional uint64 limit = 1 [default = 10000000]; 84 | optional bool limitEnabled = 2 [default = false]; 85 | optional bool pauseOnGameLaunch = 3 [default = true]; 86 | } 87 | 88 | message Betas { 89 | optional bool optIn = 1 [default = false]; 90 | } 91 | 92 | message AutoPatching { 93 | optional bool enabled = 1 [default = true]; 94 | } 95 | 96 | message Spotlight { 97 | optional bool enabled = 1 [default = true]; 98 | } 99 | 100 | message Conversations { 101 | optional bool taskbarTabsEnabled = 1 [default = false]; 102 | } 103 | 104 | message Epic { 105 | optional string exchangeCode = 1; 106 | } 107 | 108 | message BrandedInstaller { 109 | optional string pending_protocol = 1; 110 | } 111 | 112 | message SharePlay { 113 | optional uint32 bitrate = 1 [default = 20]; 114 | optional bool displayOnboarding = 2 [default = true]; 115 | optional bool mouseAndKeyboardAccessAllowed = 3 [default = true]; 116 | optional bool gamepadAccessAllowed = 4 [default = true]; 117 | optional bool displayWizardTour = 5 [default = true]; 118 | } 119 | 120 | message SettingsModel { 121 | optional User user = 1; 122 | optional Overlay overlay = 2; 123 | optional Language language = 3; 124 | optional Misc misc = 4; 125 | optional Position position = 5; 126 | optional Notifications notifications = 6; 127 | optional Masters masters = 7; 128 | optional Hotkey hotkeys_overlayToggle = 9; 129 | optional Hotkey hotkeys_overlayHide = 10; 130 | optional Hotkey hotkeys_captureScreenshot = 11; 131 | optional Downloads downloads = 12; 132 | optional Betas betas = 13; 133 | optional AutoPatching autoPatching = 14; 134 | optional Spotlight spotlight = 15; 135 | optional ModelessPositions modeless_positions = 16; 136 | optional Conversations conversations = 17; 137 | optional Epic epic = 18; 138 | optional BrandedInstaller branded_installer = 19; 139 | optional SharePlay sharePlay = 20; 140 | } 141 | 142 | enum CloseBehavior { 143 | CloseBehavior_Undefined = 0; 144 | CloseBehavior_Close = 1; 145 | CloseBehavior_Minimize = 2; 146 | } 147 | 148 | enum LandingPage { 149 | LandingPageNews = 0; 150 | LandingPageGames = 1; 151 | LandingPageLastPlayedGame = 2; 152 | LandingPageUplayPlus = 3; 153 | } 154 | 155 | extend google.protobuf.FieldOptions { 156 | optional bool disableStatsTracking = 50000; 157 | } 158 | 159 | extend google.protobuf.MessageOptions { 160 | optional bool disableMessageStatsTracking = 50001; 161 | } 162 | -------------------------------------------------------------------------------- /proto/proto_steam_service/steam_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.steam_service; 4 | 5 | message SteamUserInfo { 6 | required string steam_id = 1; 7 | optional string personaname = 2; 8 | optional string avatar_url = 3; 9 | optional CommunityVisibilityState community_visibility_state = 4; 10 | } 11 | 12 | message GetSteamFriendsReq { 13 | required string steam_id = 1; 14 | } 15 | 16 | message GetSteamFriendsRsp { 17 | repeated SteamUserInfo steam_friends = 1; 18 | required bool success = 2; 19 | optional bool public_account_required = 3; 20 | } 21 | 22 | message GetSteamUserInfoReq { 23 | required string steam_id = 1; 24 | } 25 | 26 | message GetSteamUserInfoRsp { 27 | optional SteamUserInfo steam_user_info = 1; 28 | required bool success = 2; 29 | } 30 | 31 | message Req { 32 | optional GetSteamFriendsReq get_steam_friends_req = 1; 33 | optional GetSteamUserInfoReq get_steam_user_info_req = 2; 34 | } 35 | 36 | message Rsp { 37 | optional GetSteamFriendsRsp get_steam_friends_rsp = 1; 38 | optional GetSteamUserInfoRsp get_steam_user_info_rsp = 2; 39 | } 40 | 41 | message Upstream { 42 | optional Req request = 1; 43 | } 44 | 45 | message Downstream { 46 | optional Rsp response = 1; 47 | } 48 | 49 | enum CommunityVisibilityState { 50 | CommunityVisibilityState_Unsupported = 0; 51 | CommunityVisibilityState_Private = 1; 52 | CommunityVisibilityState_Public = 3; 53 | } 54 | -------------------------------------------------------------------------------- /proto/proto_store/store.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.store; 4 | 5 | message StoreProduct { 6 | optional uint32 product_id = 1; 7 | optional bytes configuration = 2; 8 | optional bool staging = 3; 9 | optional string store_reference = 4; 10 | repeated uint32 associations = 5; 11 | optional uint32 promotion_score = 6 [default = 1]; 12 | optional uint32 revision = 7; 13 | optional string credentials = 8; 14 | repeated uint32 ownership_associations = 9; 15 | optional string user_blob = 10; 16 | optional StorePartner store_partner = 11; 17 | } 18 | 19 | message StoreProductUpdateInfo { 20 | optional uint32 product_id = 1; 21 | optional uint32 revision = 2; 22 | repeated uint32 ownership_associations = 3; 23 | } 24 | 25 | message Storefront { 26 | optional string configuration = 1; 27 | } 28 | 29 | message InitializeReq { 30 | optional bool use_staging = 1 [default = false]; 31 | optional uint32 proto_version = 2; 32 | optional uint32 client_ip_override = 99 [deprecated = true]; 33 | } 34 | 35 | message InitializeRsp { 36 | optional bool success = 1; 37 | optional Storefront storefront = 2; 38 | } 39 | 40 | message GetStoreReq { 41 | 42 | } 43 | 44 | message GetStoreRsp { 45 | required StoreResult result = 1; 46 | repeated StoreProduct store_products = 2; 47 | } 48 | 49 | message StoreUpdatedPush { 50 | repeated StoreProduct store_products = 1; 51 | repeated uint32 removed_products = 2; 52 | } 53 | 54 | message GetDataReq { 55 | optional StoreType store_data_type = 1; 56 | repeated uint32 product_id = 2; 57 | } 58 | 59 | message GetDataRsp { 60 | required StoreResult result = 1; 61 | optional StoreType store_data_type = 2; 62 | repeated StoreProduct products = 3; 63 | } 64 | 65 | message RevisionsUpdatedPush { 66 | optional StoreType store_data_type = 1; 67 | repeated StoreProductUpdateInfo update_info = 2; 68 | repeated uint32 removed_products = 3; 69 | } 70 | 71 | message IngameStoreCredentials { 72 | optional string ubi_ticket = 1; 73 | optional string ubi_app_id = 2; 74 | optional string sales_token = 3; 75 | optional SalesPlatform sales_platform = 4; 76 | } 77 | 78 | message KeyValuePair { 79 | optional string key = 1; 80 | optional string value = 2; 81 | } 82 | 83 | message CheckoutReq { 84 | optional string product_id = 1; 85 | optional string price_code = 2; 86 | optional string url_redirect_success = 3; 87 | optional string url_redirect_failure = 4; 88 | optional string language_code = 5; 89 | repeated KeyValuePair extra = 6; 90 | optional string redirect_locale = 7; 91 | } 92 | 93 | message CheckoutRsp { 94 | optional string url = 1; 95 | optional bool new_window_flag = 2; 96 | optional string redirect_locale_code = 3; 97 | } 98 | 99 | message IngameStoreCheckoutReq { 100 | optional IngameStoreCredentials ingame_store_credentials = 1; 101 | optional CheckoutReq checkout_req = 2; 102 | } 103 | 104 | message IngameStoreCheckoutRsp { 105 | optional StoreResult result = 1; 106 | optional CheckoutRsp checkout_rsp = 2; 107 | } 108 | 109 | message Push { 110 | optional StoreUpdatedPush store_update = 1; 111 | optional RevisionsUpdatedPush revisions_updated_push = 2; 112 | } 113 | 114 | message Req { 115 | required uint32 request_id = 1; 116 | optional InitializeReq initialize_req = 2; 117 | optional GetStoreReq get_store_req = 3; 118 | optional GetDataReq get_data_req = 4; 119 | optional IngameStoreCheckoutReq ingame_store_checkout_req = 5; 120 | } 121 | 122 | message Rsp { 123 | required uint32 request_id = 1; 124 | optional InitializeRsp initialize_rsp = 2; 125 | optional GetStoreRsp get_store_rsp = 3; 126 | optional GetDataRsp get_data_rsp = 4; 127 | optional IngameStoreCheckoutRsp ingame_store_checkout_rsp = 5; 128 | } 129 | 130 | message Upstream { 131 | optional Req request = 1; 132 | } 133 | 134 | message Downstream { 135 | optional Rsp response = 1; 136 | optional Push push = 2; 137 | } 138 | 139 | enum StoreProtocolVersion { 140 | ProtocolVersion = 3; 141 | } 142 | 143 | enum StoreResult { 144 | StoreResponse_Success = 1; 145 | StoreResponse_Failure = 2; 146 | StoreResponse_ServerTimeOut = 3; 147 | StoreResponse_InvalidRequest = 4; 148 | StoreResponse_InvalidResponse = 5; 149 | StoreResponse_HttpQueueFull = 6; 150 | StoreResponse_HttpFailure = 7; 151 | StoreResponse_SalesPlatformFailure = 8; 152 | StoreResponse_SalesPlatformRedirect = 9; 153 | StoreResponse_SalesPlatformAntifraudReject = 10; 154 | } 155 | 156 | enum StorePartner { 157 | StorePartner_Demandware = 0; 158 | StorePartner_Epicstore = 1; 159 | } 160 | 161 | enum StoreType { 162 | StoreType_Upsell = 1; 163 | StoreType_Ingame = 2; 164 | } 165 | 166 | enum SalesPlatform { 167 | SalesPlatform_Mercury = 1; 168 | SalesPlatform_Sigma = 2; 169 | } 170 | -------------------------------------------------------------------------------- /proto/proto_uplay/Uplay.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.uplay; 4 | 5 | message Achievement { 6 | required uint32 achievement_id = 1; 7 | optional uint64 timestamp = 2; 8 | } 9 | 10 | message Achievements { 11 | repeated Achievement achievements = 1; 12 | } 13 | 14 | message Product { 15 | required string product_id = 1; 16 | required string platform_id = 2; 17 | } 18 | 19 | message ProductAchievements { 20 | required Product product = 1; 21 | required Achievements achievements = 2; 22 | } 23 | 24 | message AchievementBlob { 25 | repeated ProductAchievements product_achievements = 1; 26 | } 27 | 28 | message AuthenticateReq { 29 | required string orbit_token = 1; 30 | } 31 | 32 | message AuthenticateRsp { 33 | required bool success = 1; 34 | } 35 | 36 | message WriteAchievementsReq { 37 | optional AchievementBlob achievement_blob = 1; 38 | } 39 | 40 | message WriteAchievementsRsp { 41 | 42 | } 43 | 44 | message ReadAchievementsReq { 45 | optional string user_id = 1; 46 | optional Product product = 2; 47 | } 48 | 49 | message ReadAchievementsRsp { 50 | required string user_id = 1; 51 | required AchievementBlob achievement_blob = 2; 52 | } 53 | 54 | message Req { 55 | required uint32 request_id = 1; 56 | optional AuthenticateReq authenticate_req = 2; 57 | optional ReadAchievementsReq read_achievements_req = 3; 58 | optional WriteAchievementsReq write_achievements_req = 4; 59 | } 60 | 61 | message Rsp { 62 | required uint32 request_id = 1; 63 | optional AuthenticateRsp authenticate_rsp = 2; 64 | optional ReadAchievementsRsp read_achievements_rsp = 3; 65 | optional WriteAchievementsRsp write_achievements_rsp = 4; 66 | } 67 | -------------------------------------------------------------------------------- /proto/proto_uplay_protocol/uplay_protocol.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.uplayprotocol; 4 | 5 | message Req { 6 | required string protocol = 1; 7 | optional string environment = 2; 8 | } 9 | 10 | message Rsp { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /proto/proto_uplay_service/uplay_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.uplay_service; 4 | 5 | message StartInstall { 6 | required uint32 uplay_id = 1; 7 | } 8 | 9 | message InstallingDependency { 10 | required string description = 1; 11 | required uint32 index_number = 2; 12 | required uint32 installers_count = 3; 13 | } 14 | 15 | message DependencyInstalled { 16 | required string installer_id = 1; 17 | required uint32 version = 2; 18 | required bool restart_required = 3; 19 | } 20 | 21 | message InstallCompleted { 22 | required bool restart_required = 1; 23 | } 24 | 25 | message GearResult { 26 | required string result = 1; 27 | } 28 | 29 | message Req { 30 | optional StartInstall start_install = 1; 31 | optional InstallingDependency installing_dependency = 2; 32 | optional DependencyInstalled dependency_installed = 3; 33 | optional InstallCompleted install_completed = 4; 34 | optional GearResult gear_result = 5; 35 | } 36 | 37 | message DependencyRestartRsp { 38 | optional bool is_approved = 1; 39 | } 40 | 41 | message Rsp { 42 | optional DependencyRestartRsp restart = 1; 43 | } 44 | 45 | message CancelInstallPush { 46 | 47 | } 48 | 49 | message Push { 50 | optional CancelInstallPush cancel_install = 1; 51 | } 52 | 53 | message Upstream { 54 | optional Req req = 1; 55 | } 56 | 57 | message Downstream { 58 | optional Rsp rsp = 1; 59 | optional Push push = 2; 60 | } 61 | -------------------------------------------------------------------------------- /proto/proto_uplayauxdll/UplayAuxDll.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.uplayauxdll; 4 | 5 | message DevArgs { 6 | optional bool uatOnly = 1; 7 | } 8 | 9 | message InitReq { 10 | required uint32 uplayId = 1; 11 | optional DevArgs devArgs = 2; 12 | } 13 | 14 | message InitRsp { 15 | required InitResult result = 1; 16 | optional uint32 uplayPID = 2; 17 | } 18 | 19 | message InvalidateCachedTokenReq { 20 | 21 | } 22 | 23 | message GetCachedOrFreshTokenReq { 24 | required bytes requestToken = 2; 25 | } 26 | 27 | message GetBurnTicketReq { 28 | required bytes requestToken = 2; 29 | } 30 | 31 | message GetCachedOrFreshTokenRsp { 32 | required OperationResult result = 2; 33 | optional uint32 errorCode = 3; 34 | optional bytes gameToken = 4; 35 | } 36 | 37 | message GetBurnTicketRsp { 38 | required OperationResult result = 2; 39 | optional uint32 errorCode = 3; 40 | optional bytes burnTicket = 4; 41 | optional uint64 gracePeriodSec = 5; 42 | } 43 | 44 | message ActivateReq { 45 | optional InvalidateCachedTokenReq invalidateCachedTokenReq = 1; 46 | optional GetCachedOrFreshTokenReq getCachedOrFreshTokenReq = 2; 47 | optional GetBurnTicketReq getBurnTicketReq = 3; 48 | } 49 | 50 | message ActivateRsp { 51 | optional GetCachedOrFreshTokenRsp getCachedOrFreshTokenRsp = 2; 52 | optional GetBurnTicketRsp getBurnTicketRsp = 3; 53 | } 54 | 55 | message Req { 56 | optional uint32 requestId = 1; 57 | optional InitReq initReq = 2; 58 | optional ActivateReq activateReq = 3; 59 | } 60 | 61 | message Rsp { 62 | optional uint32 requestId = 1; 63 | optional InitRsp initRsp = 2; 64 | optional ActivateRsp activateRsp = 3; 65 | } 66 | 67 | enum OperationResult { 68 | ok = 1; 69 | invalidArgument = 2; 70 | connectionError = 3; 71 | } 72 | 73 | enum InitResult { 74 | InitResult_Success = 1; 75 | InitResult_Failure = 2; 76 | InitResult_ReconnectRequired = 3; 77 | } 78 | 79 | enum ErrorType { 80 | ErrorType_ActivationLimitExceeded = 1; 81 | ErrorType_ActivationFailed = 2; 82 | ErrorType_NoOnlineConnection = 3; 83 | ErrorType_NoOwnership = 4; 84 | ErrorType_Timeout = 5; 85 | ErrorType_InternalServerError = 6; 86 | ErrorType_ErrorDetailCodeOnly = 7; 87 | } 88 | -------------------------------------------------------------------------------- /proto/proto_user_login_cache/user_login_cache.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.user_login_cache; 4 | 5 | message User { 6 | optional string account_id = 1; 7 | optional string email_hash = 2; 8 | optional string rd_ticket = 3; 9 | } 10 | 11 | message UserLoginCache { 12 | optional uint32 version = 1; 13 | repeated User users = 2; 14 | } 15 | -------------------------------------------------------------------------------- /proto/proto_user_settings/user_settings.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.user_settings; 4 | 5 | message FavouriteGame { 6 | required uint32 productId = 1; 7 | } 8 | 9 | message HiddenGame { 10 | required uint32 productId = 1; 11 | } 12 | 13 | message FavouriteGames { 14 | repeated FavouriteGame games = 1; 15 | } 16 | 17 | message HiddenGames { 18 | repeated HiddenGame games = 1; 19 | } 20 | 21 | message PlayedGame { 22 | required uint32 productId = 1; 23 | required uint32 exeIndex = 2; 24 | required uint32 timestamp = 3; 25 | optional uint32 playTime = 4; 26 | } 27 | 28 | message PlayedGames { 29 | repeated PlayedGame games = 1; 30 | } 31 | 32 | message ProductBranch { 33 | required uint32 productId = 1; 34 | optional uint32 branchId = 2; 35 | optional bool useDefault = 3; 36 | optional string password = 4; 37 | } 38 | 39 | message ProductBranches { 40 | repeated ProductBranch branches = 1; 41 | } 42 | 43 | message KnownBranch { 44 | required uint32 productId = 1; 45 | optional uint32 branchId = 2; 46 | optional string branchName = 3; 47 | optional string password = 4; 48 | } 49 | 50 | message KnownBranches { 51 | repeated KnownBranch branches = 1; 52 | } 53 | 54 | message AutoPatchBlacklistProduct { 55 | required uint32 productId = 1; 56 | } 57 | 58 | message AutoPatching { 59 | repeated AutoPatchBlacklistProduct products = 1; 60 | } 61 | 62 | message GameLibrary { 63 | optional GameLibraryStyle style = 1 [default = GameLibraryStyle_Thumbs]; 64 | optional GameLibraryThumbSize thumbSize = 2 [default = GameLibraryThumbSize_Medium]; 65 | optional GameLibraryListStyle listStyle = 3 [default = GameLibraryListStyle_Wide]; 66 | optional bool show_favorite_games = 4 [default = true]; 67 | optional bool show_owned_games = 5 [default = true]; 68 | optional bool show_installed_games = 6 [default = true]; 69 | optional bool show_free_games = 7 [default = true]; 70 | optional bool show_other_games = 8 [default = true]; 71 | } 72 | 73 | message GameStartArguments { 74 | optional uint32 gameid = 1; 75 | optional string arguments = 2; 76 | } 77 | 78 | message GamesStartArguments { 79 | repeated GameStartArguments gameStartArguments = 1; 80 | } 81 | 82 | message News { 83 | optional string display_mode = 1; 84 | repeated string filter = 2; 85 | } 86 | 87 | message PromoTab { 88 | optional uint32 promo_tab_id = 1; 89 | } 90 | 91 | message SeenPromoTabs { 92 | repeated PromoTab seen_promo_tabs = 1; 93 | } 94 | 95 | message SpotlightShownTimestamps { 96 | repeated uint64 spotlightShownTimestamp = 1; 97 | } 98 | 99 | message UserSettings { 100 | optional FavouriteGames favouriteGames = 1; 101 | optional HiddenGames hiddenGames = 2; 102 | optional PlayedGames lastPlayedGames = 4; 103 | optional ProductBranches productBranches = 5; 104 | optional KnownBranches knownBranches = 6; 105 | optional bool dontUploadCrashReports = 7; 106 | optional AutoPatching autoPatching = 8; 107 | optional string activityStatus = 9; 108 | optional bool remindMeOfSteamLinking = 13; 109 | optional GameLibrary gameLibrary = 14; 110 | optional GamesStartArguments gamesStartArguments = 16; 111 | optional uint64 expiredSecurityPromptTimestamp = 17; 112 | optional string lastDismissedPromoBubbleId = 18; 113 | optional News news = 19; 114 | optional SecurityPromptState lastSecurityPromptState = 20 [default = SecurityPromptState_None]; 115 | optional uint64 lastEmailVerificPromptTimestamp = 21; 116 | optional string lastdissmisseduplayplusbubbleid = 22; 117 | optional bool isexpirationbannerdisabled = 23; 118 | optional SeenPromoTabs seenPromoTabs = 24; 119 | optional bool isunavailablebannerdisabled = 25; 120 | optional SpotlightShownTimestamps spotlightShownTimestamps = 26; 121 | } 122 | 123 | enum GameLibraryStyle { 124 | GameLibraryStyle_Thumbs = 0; 125 | GameLibraryStyle_List = 1; 126 | } 127 | 128 | enum GameLibraryThumbSize { 129 | GameLibraryThumbSize_Small = 0; 130 | GameLibraryThumbSize_Medium = 1; 131 | GameLibraryThumbSize_Large = 2; 132 | } 133 | 134 | enum GameLibraryListStyle { 135 | GameLibraryListStyle_Wide = 0; 136 | GameLibraryListStyle_Narrow = 1; 137 | } 138 | 139 | enum SecurityPromptState { 140 | SecurityPromptState_None = 0; 141 | SecurityPromptState_2FA = 1; 142 | SecurityPromptState_EmailVerification = 2; 143 | SecurityPromptState_PhoneCollection = 3; 144 | } 145 | -------------------------------------------------------------------------------- /proto/proto_utility/utility.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package mg.protocol.utility; 4 | 5 | message GeoIpReq { 6 | 7 | } 8 | 9 | message GeoIpRsp { 10 | optional string country_code = 1; 11 | optional string continent_code = 2; 12 | } 13 | 14 | message Req { 15 | optional GeoIpReq geoip_req = 1; 16 | } 17 | 18 | message Rsp { 19 | optional GeoIpRsp geoip_rsp = 1; 20 | } 21 | 22 | message Upstream { 23 | optional Req request = 1; 24 | } 25 | 26 | message Downstream { 27 | optional Rsp response = 1; 28 | } 29 | -------------------------------------------------------------------------------- /proto/proto_wegame_service/wegame_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package mg.protocol.wegame_service; 4 | 5 | message PlayerProfile { 6 | string rail_id = 1; 7 | string nick_name = 2; 8 | string avatar_url = 3; 9 | } 10 | 11 | message FriendProfile { 12 | string rail_id = 1; 13 | string nick_name = 2; 14 | string avatar_url = 3; 15 | uint32 friend_timestamp = 4; 16 | string common_id = 5; 17 | } 18 | 19 | message GetUserRailIdReq { 20 | string common_id = 1; 21 | } 22 | 23 | message GetUserRailIdRsp { 24 | string rail_id = 1; 25 | } 26 | 27 | message GetPlayerProfileReq { 28 | string common_id = 1; 29 | } 30 | 31 | message GetPlayerProfileRsp { 32 | PlayerProfile player_profile = 1; 33 | } 34 | 35 | message GetPlayerProfilesReq { 36 | repeated string common_ids = 1; 37 | } 38 | 39 | message GetPlayerProfilesRsp { 40 | repeated PlayerProfileEntry player_profiles = 1; 41 | message PlayerProfileEntry { 42 | string common_id = 1; 43 | bool success = 2; 44 | PlayerProfile player_profile = 3; 45 | } 46 | } 47 | 48 | message GetFriendProfilesReq { 49 | string common_id = 1; 50 | uint32 count = 2; 51 | uint32 start_index = 3; 52 | } 53 | 54 | message GetFriendProfilesRsp { 55 | repeated FriendProfile friend_profiles = 1; 56 | } 57 | 58 | message GetIngameItemInfoReq { 59 | uint64 wegame_product_id = 1; 60 | string common_id = 2; 61 | repeated uint32 ingame_item_package_ids = 3; 62 | } 63 | 64 | message IngameItemInfo { 65 | uint32 ingame_item_package_id = 1; 66 | float pack_original_price = 2; 67 | float pack_discount_price = 3; 68 | string currency_type = 4; 69 | string pack_configuration = 5; 70 | 71 | ProductType product_type = 6; 72 | enum ProductType { 73 | ProductType_Unknown = 0; 74 | ProductType_Normal = 1; 75 | ProductType_Bundle = 2; 76 | ProductType_Generator = 3; 77 | ProductType_InGameCoin = 4; 78 | } 79 | } 80 | 81 | message GetIngameItemInfoRsp { 82 | repeated IngameItemInfo ingame_items = 1; 83 | } 84 | 85 | message GetIngameItemCheckoutUrlReq { 86 | string rail_id = 1; 87 | string session_ticket = 2; 88 | uint64 wegame_product_id = 3; 89 | uint32 ingame_item_package_id = 4; 90 | string url_redirect = 5; 91 | } 92 | 93 | message GetIngameItemCheckoutUrlRsp { 94 | string wegame_checkout_url = 1; 95 | } 96 | 97 | message Req { 98 | uint32 request_id = 1; 99 | GetUserRailIdReq get_user_rail_id_req = 2; 100 | GetPlayerProfileReq get_player_profile_req = 3; 101 | GetFriendProfilesReq get_friend_profiles_req = 4; 102 | GetIngameItemInfoReq get_ingame_item_info_req = 5; 103 | GetIngameItemCheckoutUrlReq get_ingame_item_checkout_url_req = 6; 104 | GetPlayerProfilesReq get_player_profiles_req = 7; 105 | } 106 | 107 | message Rsp { 108 | uint32 request_id = 1; 109 | Status status = 2; 110 | GetUserRailIdRsp get_user_rail_id_rsp = 3; 111 | GetPlayerProfileRsp get_player_profile_rsp = 4; 112 | GetFriendProfilesRsp get_friend_profiles_rsp = 5; 113 | GetIngameItemInfoRsp get_ingame_item_info_rsp = 6; 114 | GetIngameItemCheckoutUrlRsp get_ingame_item_checkout_url_rsp = 7; 115 | GetPlayerProfilesRsp get_player_profiles_rsp = 8; 116 | } 117 | 118 | message Upstream { 119 | Req request = 1; 120 | } 121 | 122 | message Downstream { 123 | Rsp response = 1; 124 | } 125 | 126 | enum Status { 127 | Status_Unknown = 0; 128 | Status_Ok = 1; 129 | Status_EmptyResult = 2; 130 | Status_InternalError = 3; 131 | Status_Denied = 4; 132 | Status_TimedOut = 5; 133 | Status_ParameterError = 6; 134 | } 135 | -------------------------------------------------------------------------------- /proto/protos/perfetto/common/android_log_constants.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | enum AndroidLogId { 6 | LID_DEFAULT = 0; 7 | LID_RADIO = 1; 8 | LID_EVENTS = 2; 9 | LID_SYSTEM = 3; 10 | LID_CRASH = 4; 11 | LID_STATS = 5; 12 | LID_SECURITY = 6; 13 | LID_KERNEL = 7; 14 | } 15 | 16 | enum AndroidLogPriority { 17 | PRIO_UNSPECIFIED = 0; 18 | PRIO_UNUSED = 1; 19 | PRIO_VERBOSE = 2; 20 | PRIO_DEBUG = 3; 21 | PRIO_INFO = 4; 22 | PRIO_WARN = 5; 23 | PRIO_ERROR = 6; 24 | PRIO_FATAL = 7; 25 | } 26 | -------------------------------------------------------------------------------- /proto/protos/perfetto/common/builtin_clock.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | enum BuiltinClock { 6 | BUILTIN_CLOCK_UNKNOWN = 0; 7 | BUILTIN_CLOCK_REALTIME = 1; 8 | BUILTIN_CLOCK_REALTIME_COARSE = 2; 9 | BUILTIN_CLOCK_MONOTONIC = 3; 10 | BUILTIN_CLOCK_MONOTONIC_COARSE = 4; 11 | BUILTIN_CLOCK_MONOTONIC_RAW = 5; 12 | BUILTIN_CLOCK_BOOTTIME = 6; 13 | BUILTIN_CLOCK_MAX_ID = 63; 14 | } 15 | -------------------------------------------------------------------------------- /proto/protos/perfetto/common/perf_events.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message PerfEvents { 6 | message Timebase { 7 | oneof interval { 8 | uint64 frequency = 2; 9 | uint64 period = 1; 10 | } 11 | 12 | oneof event { 13 | Counter counter = 4; 14 | Tracepoint tracepoint = 3; 15 | } 16 | } 17 | 18 | message Tracepoint { 19 | optional string name = 1; 20 | optional string filter = 2; 21 | } 22 | 23 | enum Counter { 24 | UNKNOWN_COUNTER = 0; 25 | SW_CPU_CLOCK = 1; 26 | SW_PAGE_FAULTS = 2; 27 | HW_CPU_CYCLES = 10; 28 | HW_INSTRUCTIONS = 11; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /proto/protos/perfetto/common/sys_stats_counters.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | enum MeminfoCounters { 6 | MEMINFO_UNSPECIFIED = 0; 7 | MEMINFO_MEM_TOTAL = 1; 8 | MEMINFO_MEM_FREE = 2; 9 | MEMINFO_MEM_AVAILABLE = 3; 10 | MEMINFO_BUFFERS = 4; 11 | MEMINFO_CACHED = 5; 12 | MEMINFO_SWAP_CACHED = 6; 13 | MEMINFO_ACTIVE = 7; 14 | MEMINFO_INACTIVE = 8; 15 | MEMINFO_ACTIVE_ANON = 9; 16 | MEMINFO_INACTIVE_ANON = 10; 17 | MEMINFO_ACTIVE_FILE = 11; 18 | MEMINFO_INACTIVE_FILE = 12; 19 | MEMINFO_UNEVICTABLE = 13; 20 | MEMINFO_MLOCKED = 14; 21 | MEMINFO_SWAP_TOTAL = 15; 22 | MEMINFO_SWAP_FREE = 16; 23 | MEMINFO_DIRTY = 17; 24 | MEMINFO_WRITEBACK = 18; 25 | MEMINFO_ANON_PAGES = 19; 26 | MEMINFO_MAPPED = 20; 27 | MEMINFO_SHMEM = 21; 28 | MEMINFO_SLAB = 22; 29 | MEMINFO_SLAB_RECLAIMABLE = 23; 30 | MEMINFO_SLAB_UNRECLAIMABLE = 24; 31 | MEMINFO_KERNEL_STACK = 25; 32 | MEMINFO_PAGE_TABLES = 26; 33 | MEMINFO_COMMIT_LIMIT = 27; 34 | MEMINFO_COMMITED_AS = 28; 35 | MEMINFO_VMALLOC_TOTAL = 29; 36 | MEMINFO_VMALLOC_USED = 30; 37 | MEMINFO_VMALLOC_CHUNK = 31; 38 | MEMINFO_CMA_TOTAL = 32; 39 | MEMINFO_CMA_FREE = 33; 40 | } 41 | 42 | enum VmstatCounters { 43 | VMSTAT_UNSPECIFIED = 0; 44 | VMSTAT_NR_FREE_PAGES = 1; 45 | VMSTAT_NR_ALLOC_BATCH = 2; 46 | VMSTAT_NR_INACTIVE_ANON = 3; 47 | VMSTAT_NR_ACTIVE_ANON = 4; 48 | VMSTAT_NR_INACTIVE_FILE = 5; 49 | VMSTAT_NR_ACTIVE_FILE = 6; 50 | VMSTAT_NR_UNEVICTABLE = 7; 51 | VMSTAT_NR_MLOCK = 8; 52 | VMSTAT_NR_ANON_PAGES = 9; 53 | VMSTAT_NR_MAPPED = 10; 54 | VMSTAT_NR_FILE_PAGES = 11; 55 | VMSTAT_NR_DIRTY = 12; 56 | VMSTAT_NR_WRITEBACK = 13; 57 | VMSTAT_NR_SLAB_RECLAIMABLE = 14; 58 | VMSTAT_NR_SLAB_UNRECLAIMABLE = 15; 59 | VMSTAT_NR_PAGE_TABLE_PAGES = 16; 60 | VMSTAT_NR_KERNEL_STACK = 17; 61 | VMSTAT_NR_OVERHEAD = 18; 62 | VMSTAT_NR_UNSTABLE = 19; 63 | VMSTAT_NR_BOUNCE = 20; 64 | VMSTAT_NR_VMSCAN_WRITE = 21; 65 | VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22; 66 | VMSTAT_NR_WRITEBACK_TEMP = 23; 67 | VMSTAT_NR_ISOLATED_ANON = 24; 68 | VMSTAT_NR_ISOLATED_FILE = 25; 69 | VMSTAT_NR_SHMEM = 26; 70 | VMSTAT_NR_DIRTIED = 27; 71 | VMSTAT_NR_WRITTEN = 28; 72 | VMSTAT_NR_PAGES_SCANNED = 29; 73 | VMSTAT_WORKINGSET_REFAULT = 30; 74 | VMSTAT_WORKINGSET_ACTIVATE = 31; 75 | VMSTAT_WORKINGSET_NODERECLAIM = 32; 76 | VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33; 77 | VMSTAT_NR_FREE_CMA = 34; 78 | VMSTAT_NR_SWAPCACHE = 35; 79 | VMSTAT_NR_DIRTY_THRESHOLD = 36; 80 | VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37; 81 | VMSTAT_PGPGIN = 38; 82 | VMSTAT_PGPGOUT = 39; 83 | VMSTAT_PGPGOUTCLEAN = 40; 84 | VMSTAT_PSWPIN = 41; 85 | VMSTAT_PSWPOUT = 42; 86 | VMSTAT_PGALLOC_DMA = 43; 87 | VMSTAT_PGALLOC_NORMAL = 44; 88 | VMSTAT_PGALLOC_MOVABLE = 45; 89 | VMSTAT_PGFREE = 46; 90 | VMSTAT_PGACTIVATE = 47; 91 | VMSTAT_PGDEACTIVATE = 48; 92 | VMSTAT_PGFAULT = 49; 93 | VMSTAT_PGMAJFAULT = 50; 94 | VMSTAT_PGREFILL_DMA = 51; 95 | VMSTAT_PGREFILL_NORMAL = 52; 96 | VMSTAT_PGREFILL_MOVABLE = 53; 97 | VMSTAT_PGSTEAL_KSWAPD_DMA = 54; 98 | VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55; 99 | VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56; 100 | VMSTAT_PGSTEAL_DIRECT_DMA = 57; 101 | VMSTAT_PGSTEAL_DIRECT_NORMAL = 58; 102 | VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59; 103 | VMSTAT_PGSCAN_KSWAPD_DMA = 60; 104 | VMSTAT_PGSCAN_KSWAPD_NORMAL = 61; 105 | VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62; 106 | VMSTAT_PGSCAN_DIRECT_DMA = 63; 107 | VMSTAT_PGSCAN_DIRECT_NORMAL = 64; 108 | VMSTAT_PGSCAN_DIRECT_MOVABLE = 65; 109 | VMSTAT_PGSCAN_DIRECT_THROTTLE = 66; 110 | VMSTAT_PGINODESTEAL = 67; 111 | VMSTAT_SLABS_SCANNED = 68; 112 | VMSTAT_KSWAPD_INODESTEAL = 69; 113 | VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70; 114 | VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71; 115 | VMSTAT_PAGEOUTRUN = 72; 116 | VMSTAT_ALLOCSTALL = 73; 117 | VMSTAT_PGROTATED = 74; 118 | VMSTAT_DROP_PAGECACHE = 75; 119 | VMSTAT_DROP_SLAB = 76; 120 | VMSTAT_PGMIGRATE_SUCCESS = 77; 121 | VMSTAT_PGMIGRATE_FAIL = 78; 122 | VMSTAT_COMPACT_MIGRATE_SCANNED = 79; 123 | VMSTAT_COMPACT_FREE_SCANNED = 80; 124 | VMSTAT_COMPACT_ISOLATED = 81; 125 | VMSTAT_COMPACT_STALL = 82; 126 | VMSTAT_COMPACT_FAIL = 83; 127 | VMSTAT_COMPACT_SUCCESS = 84; 128 | VMSTAT_COMPACT_DAEMON_WAKE = 85; 129 | VMSTAT_UNEVICTABLE_PGS_CULLED = 86; 130 | VMSTAT_UNEVICTABLE_PGS_SCANNED = 87; 131 | VMSTAT_UNEVICTABLE_PGS_RESCUED = 88; 132 | VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89; 133 | VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90; 134 | VMSTAT_UNEVICTABLE_PGS_CLEARED = 91; 135 | VMSTAT_UNEVICTABLE_PGS_STRANDED = 92; 136 | VMSTAT_NR_ZSPAGES = 93; 137 | VMSTAT_NR_ION_HEAP = 94; 138 | VMSTAT_NR_GPU_HEAP = 95; 139 | VMSTAT_ALLOCSTALL_DMA = 96; 140 | VMSTAT_ALLOCSTALL_MOVABLE = 97; 141 | VMSTAT_ALLOCSTALL_NORMAL = 98; 142 | VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99; 143 | VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100; 144 | VMSTAT_NR_FASTRPC = 101; 145 | VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102; 146 | VMSTAT_NR_ION_HEAP_POOL = 103; 147 | VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104; 148 | VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105; 149 | VMSTAT_NR_SHMEM_HUGEPAGES = 106; 150 | VMSTAT_NR_SHMEM_PMDMAPPED = 107; 151 | VMSTAT_NR_UNRECLAIMABLE_PAGES = 108; 152 | VMSTAT_NR_ZONE_ACTIVE_ANON = 109; 153 | VMSTAT_NR_ZONE_ACTIVE_FILE = 110; 154 | VMSTAT_NR_ZONE_INACTIVE_ANON = 111; 155 | VMSTAT_NR_ZONE_INACTIVE_FILE = 112; 156 | VMSTAT_NR_ZONE_UNEVICTABLE = 113; 157 | VMSTAT_NR_ZONE_WRITE_PENDING = 114; 158 | VMSTAT_OOM_KILL = 115; 159 | VMSTAT_PGLAZYFREE = 116; 160 | VMSTAT_PGLAZYFREED = 117; 161 | VMSTAT_PGREFILL = 118; 162 | VMSTAT_PGSCAN_DIRECT = 119; 163 | VMSTAT_PGSCAN_KSWAPD = 120; 164 | VMSTAT_PGSKIP_DMA = 121; 165 | VMSTAT_PGSKIP_MOVABLE = 122; 166 | VMSTAT_PGSKIP_NORMAL = 123; 167 | VMSTAT_PGSTEAL_DIRECT = 124; 168 | VMSTAT_PGSTEAL_KSWAPD = 125; 169 | VMSTAT_SWAP_RA = 126; 170 | VMSTAT_SWAP_RA_HIT = 127; 171 | VMSTAT_WORKINGSET_RESTORE = 128; 172 | } 173 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/android/android_log_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/common/android_log_constants.proto"; 6 | 7 | message AndroidLogConfig { 8 | repeated AndroidLogId log_ids = 1; 9 | optional AndroidLogPriority min_prio = 3; 10 | repeated string filter_tags = 4; 11 | 12 | reserved 2; 13 | } 14 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/android/android_polled_state_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message AndroidPolledStateConfig { 6 | optional uint32 poll_ms = 1; 7 | } 8 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/android/packages_list_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message PackagesListConfig { 6 | repeated string package_name_filter = 1; 7 | } 8 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/chrome/chrome_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeConfig { 6 | optional string trace_config = 1; 7 | optional bool privacy_filtering_enabled = 2; 8 | optional bool convert_to_legacy_json = 3; 9 | 10 | optional ClientPriority client_priority = 4; 11 | enum ClientPriority { 12 | UNKNOWN = 0; 13 | BACKGROUND = 1; 14 | USER_INITIATED = 2; 15 | } 16 | 17 | optional string json_agent_label_filter = 5; 18 | } 19 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/data_source_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/config/android/android_log_config.proto"; 6 | import "protos/perfetto/config/android/android_polled_state_config.proto"; 7 | import "protos/perfetto/config/android/packages_list_config.proto"; 8 | import "protos/perfetto/config/chrome/chrome_config.proto"; 9 | import "protos/perfetto/config/ftrace/ftrace_config.proto"; 10 | import "protos/perfetto/config/gpu/gpu_counter_config.proto"; 11 | import "protos/perfetto/config/gpu/vulkan_memory_config.proto"; 12 | import "protos/perfetto/config/inode_file/inode_file_config.proto"; 13 | import "protos/perfetto/config/interceptor_config.proto"; 14 | import "protos/perfetto/config/power/android_power_config.proto"; 15 | import "protos/perfetto/config/process_stats/process_stats_config.proto"; 16 | import "protos/perfetto/config/profiling/heapprofd_config.proto"; 17 | import "protos/perfetto/config/profiling/java_hprof_config.proto"; 18 | import "protos/perfetto/config/profiling/perf_event_config.proto"; 19 | import "protos/perfetto/config/sys_stats/sys_stats_config.proto"; 20 | import "protos/perfetto/config/test_config.proto"; 21 | import "protos/perfetto/config/track_event/track_event_config.proto"; 22 | 23 | message DataSourceConfig { 24 | optional string name = 1; 25 | optional uint32 target_buffer = 2; 26 | optional uint32 trace_duration_ms = 3; 27 | optional uint32 stop_timeout_ms = 7; 28 | optional bool enable_extra_guardrails = 6; 29 | optional uint64 tracing_session_id = 4; 30 | optional FtraceConfig ftrace_config = 100 [lazy = true]; 31 | optional InodeFileConfig inode_file_config = 102 [lazy = true]; 32 | optional ProcessStatsConfig process_stats_config = 103 [lazy = true]; 33 | optional SysStatsConfig sys_stats_config = 104 [lazy = true]; 34 | optional HeapprofdConfig heapprofd_config = 105 [lazy = true]; 35 | optional JavaHprofConfig java_hprof_config = 110 [lazy = true]; 36 | optional AndroidPowerConfig android_power_config = 106 [lazy = true]; 37 | optional AndroidLogConfig android_log_config = 107 [lazy = true]; 38 | optional GpuCounterConfig gpu_counter_config = 108 [lazy = true]; 39 | optional PackagesListConfig packages_list_config = 109 [lazy = true]; 40 | optional PerfEventConfig perf_event_config = 111 [lazy = true]; 41 | optional VulkanMemoryConfig vulkan_memory_config = 112 [lazy = true]; 42 | optional TrackEventConfig track_event_config = 113 [lazy = true]; 43 | optional AndroidPolledStateConfig android_polled_state_config = 114 [lazy = true]; 44 | optional ChromeConfig chrome_config = 101; 45 | optional InterceptorConfig interceptor_config = 115; 46 | optional string legacy_config = 1000; 47 | optional TestConfig for_testing = 1001; 48 | 49 | reserved 268435455; 50 | } 51 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/ftrace/ftrace_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message FtraceConfig { 6 | repeated string ftrace_events = 1; 7 | repeated string atrace_categories = 2; 8 | repeated string atrace_apps = 3; 9 | optional uint32 buffer_size_kb = 10; 10 | optional uint32 drain_period_ms = 11; 11 | 12 | optional CompactSchedConfig compact_sched = 12; 13 | message CompactSchedConfig { 14 | optional bool enabled = 1; 15 | } 16 | 17 | optional bool symbolize_ksyms = 13; 18 | optional bool initialize_ksyms_synchronously_for_testing = 14; 19 | } 20 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/gpu/gpu_counter_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message GpuCounterConfig { 6 | optional uint64 counter_period_ns = 1; 7 | repeated uint32 counter_ids = 2; 8 | optional bool instrumented_sampling = 3; 9 | optional bool fix_gpu_clock = 4; 10 | } 11 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/gpu/vulkan_memory_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message VulkanMemoryConfig { 6 | optional bool track_driver_memory_usage = 1; 7 | optional bool track_device_memory_usage = 2; 8 | } 9 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/inode_file/inode_file_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message InodeFileConfig { 6 | optional uint32 scan_interval_ms = 1; 7 | optional uint32 scan_delay_ms = 2; 8 | optional uint32 scan_batch_size = 3; 9 | optional bool do_not_scan = 4; 10 | repeated string scan_mount_points = 5; 11 | 12 | repeated MountPointMappingEntry mount_point_mapping = 6; 13 | message MountPointMappingEntry { 14 | optional string mountpoint = 1; 15 | repeated string scan_roots = 2; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/interceptor_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/config/interceptors/console_config.proto"; 6 | 7 | message InterceptorConfig { 8 | optional string name = 1; 9 | optional ConsoleConfig console_config = 100 [lazy = true]; 10 | } 11 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/interceptors/console_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ConsoleConfig { 6 | optional Output output = 1; 7 | enum Output { 8 | OUTPUT_UNSPECIFIED = 0; 9 | OUTPUT_STDOUT = 1; 10 | OUTPUT_STDERR = 2; 11 | } 12 | 13 | optional bool enable_colors = 2; 14 | } 15 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/power/android_power_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message AndroidPowerConfig { 6 | optional uint32 battery_poll_ms = 1; 7 | 8 | repeated BatteryCounters battery_counters = 2; 9 | enum BatteryCounters { 10 | BATTERY_COUNTER_UNSPECIFIED = 0; 11 | BATTERY_COUNTER_CHARGE = 1; 12 | BATTERY_COUNTER_CAPACITY_PERCENT = 2; 13 | BATTERY_COUNTER_CURRENT = 3; 14 | BATTERY_COUNTER_CURRENT_AVG = 4; 15 | } 16 | 17 | optional bool collect_power_rails = 3; 18 | optional bool collect_energy_estimation_breakdown = 4; 19 | } 20 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/process_stats/process_stats_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ProcessStatsConfig { 6 | repeated Quirks quirks = 1; 7 | enum Quirks { 8 | QUIRKS_UNSPECIFIED = 0; 9 | DISABLE_INITIAL_DUMP = 1 [deprecated = true]; 10 | DISABLE_ON_DEMAND = 2; 11 | } 12 | 13 | optional bool scan_all_processes_on_start = 2; 14 | optional bool record_thread_names = 3; 15 | optional uint32 proc_stats_poll_ms = 4; 16 | optional uint32 proc_stats_cache_ttl_ms = 6; 17 | optional bool record_thread_time_in_state = 7; 18 | optional uint32 thread_time_in_state_cache_size = 8; 19 | } 20 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/profiling/heapprofd_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message HeapprofdConfig { 6 | optional uint64 sampling_interval_bytes = 1; 7 | optional uint64 adaptive_sampling_shmem_threshold = 24; 8 | optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25; 9 | repeated string process_cmdline = 2; 10 | repeated uint64 pid = 4; 11 | repeated string heaps = 20; 12 | optional bool stream_allocations = 23; 13 | repeated uint64 heap_sampling_intervals = 22; 14 | optional bool all_heaps = 21; 15 | optional bool all = 5; 16 | optional uint32 min_anonymous_memory_kb = 15; 17 | optional uint32 max_heapprofd_memory_kb = 16; 18 | optional uint64 max_heapprofd_cpu_secs = 17; 19 | repeated string skip_symbol_prefix = 7; 20 | 21 | optional ContinuousDumpConfig continuous_dump_config = 6; 22 | message ContinuousDumpConfig { 23 | optional uint32 dump_phase_ms = 5; 24 | optional uint32 dump_interval_ms = 6; 25 | } 26 | 27 | optional uint64 shmem_size_bytes = 8; 28 | optional bool block_client = 9; 29 | optional uint32 block_client_timeout_us = 14; 30 | optional bool no_startup = 10; 31 | optional bool no_running = 11; 32 | optional bool dump_at_max = 13; 33 | optional bool disable_fork_teardown = 18; 34 | optional bool disable_vfork_detection = 19; 35 | 36 | reserved 12; 37 | } 38 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/profiling/java_hprof_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message JavaHprofConfig { 6 | repeated string process_cmdline = 1; 7 | repeated uint64 pid = 2; 8 | 9 | optional ContinuousDumpConfig continuous_dump_config = 3; 10 | message ContinuousDumpConfig { 11 | optional uint32 dump_phase_ms = 1; 12 | optional uint32 dump_interval_ms = 2; 13 | } 14 | 15 | optional uint32 min_anonymous_memory_kb = 4; 16 | optional bool dump_smaps = 5; 17 | repeated string ignored_types = 6; 18 | } 19 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/profiling/perf_event_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/common/perf_events.proto"; 6 | 7 | message PerfEventConfig { 8 | optional PerfEvents.Timebase timebase = 15; 9 | 10 | optional CallstackSampling callstack_sampling = 16; 11 | message CallstackSampling { 12 | optional Scope scope = 1; 13 | optional bool kernel_frames = 2; 14 | } 15 | 16 | optional uint32 ring_buffer_read_period_ms = 8; 17 | optional uint32 ring_buffer_pages = 3; 18 | optional uint64 max_enqueued_footprint_kb = 17; 19 | optional uint32 max_daemon_memory_kb = 13; 20 | optional uint32 remote_descriptor_timeout_ms = 9; 21 | optional uint32 unwind_state_clear_period_ms = 10; 22 | optional bool all_cpus = 1; 23 | optional uint32 sampling_frequency = 2; 24 | optional bool kernel_frames = 12; 25 | repeated int32 target_pid = 4; 26 | repeated string target_cmdline = 5; 27 | repeated int32 exclude_pid = 6; 28 | repeated string exclude_cmdline = 7; 29 | optional uint32 additional_cmdline_count = 11; 30 | 31 | reserved 14; 32 | 33 | message Scope { 34 | repeated int32 target_pid = 1; 35 | repeated string target_cmdline = 2; 36 | repeated int32 exclude_pid = 3; 37 | repeated string exclude_cmdline = 4; 38 | optional uint32 additional_cmdline_count = 5; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/sys_stats/sys_stats_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/common/sys_stats_counters.proto"; 6 | 7 | message SysStatsConfig { 8 | optional uint32 meminfo_period_ms = 1; 9 | repeated MeminfoCounters meminfo_counters = 2; 10 | optional uint32 vmstat_period_ms = 3; 11 | repeated VmstatCounters vmstat_counters = 4; 12 | optional uint32 stat_period_ms = 5; 13 | 14 | repeated StatCounters stat_counters = 6; 15 | enum StatCounters { 16 | STAT_UNSPECIFIED = 0; 17 | STAT_CPU_TIMES = 1; 18 | STAT_IRQ_COUNTS = 2; 19 | STAT_SOFTIRQ_COUNTS = 3; 20 | STAT_FORK_COUNT = 4; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/test_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message TestConfig { 6 | optional uint32 message_count = 1; 7 | optional uint32 max_messages_per_second = 2; 8 | optional uint32 seed = 3; 9 | optional uint32 message_size = 4; 10 | optional bool send_batch_on_register = 5; 11 | 12 | optional DummyFields dummy_fields = 6; 13 | message DummyFields { 14 | optional uint32 field_uint32 = 1; 15 | optional int32 field_int32 = 2; 16 | optional uint64 field_uint64 = 3; 17 | optional int64 field_int64 = 4; 18 | optional fixed64 field_fixed64 = 5; 19 | optional sfixed64 field_sfixed64 = 6; 20 | optional fixed32 field_fixed32 = 7; 21 | optional sfixed32 field_sfixed32 = 8; 22 | optional double field_double = 9; 23 | optional float field_float = 10; 24 | optional sint64 field_sint64 = 11; 25 | optional sint32 field_sint32 = 12; 26 | optional string field_string = 13; 27 | optional bytes field_bytes = 14; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/trace_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/config/data_source_config.proto"; 6 | import "protos/perfetto/common/builtin_clock.proto"; 7 | 8 | message TraceConfig { 9 | repeated BufferConfig buffers = 1; 10 | message BufferConfig { 11 | optional uint32 size_kb = 1; 12 | 13 | optional FillPolicy fill_policy = 4; 14 | enum FillPolicy { 15 | UNSPECIFIED = 0; 16 | RING_BUFFER = 1; 17 | DISCARD = 2; 18 | } 19 | 20 | reserved 2, 3; 21 | } 22 | 23 | repeated DataSource data_sources = 2; 24 | message DataSource { 25 | optional DataSourceConfig config = 1; 26 | repeated string producer_name_filter = 2; 27 | repeated string producer_name_regex_filter = 3; 28 | } 29 | 30 | optional BuiltinDataSource builtin_data_sources = 20; 31 | message BuiltinDataSource { 32 | optional bool disable_clock_snapshotting = 1; 33 | optional bool disable_trace_config = 2; 34 | optional bool disable_system_info = 3; 35 | optional bool disable_service_events = 4; 36 | optional BuiltinClock primary_trace_clock = 5; 37 | optional uint32 snapshot_interval_ms = 6; 38 | } 39 | 40 | optional uint32 duration_ms = 3; 41 | optional bool enable_extra_guardrails = 4; 42 | 43 | optional LockdownModeOperation lockdown_mode = 5; 44 | enum LockdownModeOperation { 45 | LOCKDOWN_UNCHANGED = 0; 46 | LOCKDOWN_CLEAR = 1; 47 | LOCKDOWN_SET = 2; 48 | } 49 | 50 | repeated ProducerConfig producers = 6; 51 | message ProducerConfig { 52 | optional string producer_name = 1; 53 | optional uint32 shm_size_kb = 2; 54 | optional uint32 page_size_kb = 3; 55 | } 56 | 57 | optional StatsdMetadata statsd_metadata = 7; 58 | message StatsdMetadata { 59 | optional int64 triggering_alert_id = 1; 60 | optional int32 triggering_config_uid = 2; 61 | optional int64 triggering_config_id = 3; 62 | optional int64 triggering_subscription_id = 4; 63 | } 64 | 65 | optional bool write_into_file = 8; 66 | optional string output_path = 29; 67 | optional uint32 file_write_period_ms = 9; 68 | optional uint64 max_file_size_bytes = 10; 69 | 70 | optional GuardrailOverrides guardrail_overrides = 11; 71 | message GuardrailOverrides { 72 | optional uint64 max_upload_per_day_bytes = 1; 73 | } 74 | 75 | optional bool deferred_start = 12; 76 | optional uint32 flush_period_ms = 13; 77 | optional uint32 flush_timeout_ms = 14; 78 | optional uint32 data_source_stop_timeout_ms = 23; 79 | optional bool notify_traceur = 16; 80 | optional int32 bugreport_score = 30; 81 | 82 | optional TriggerConfig trigger_config = 17; 83 | message TriggerConfig { 84 | optional TriggerMode trigger_mode = 1; 85 | enum TriggerMode { 86 | UNSPECIFIED = 0; 87 | START_TRACING = 1; 88 | STOP_TRACING = 2; 89 | } 90 | 91 | repeated Trigger triggers = 2; 92 | message Trigger { 93 | optional string name = 1; 94 | optional string producer_name_regex = 2; 95 | optional uint32 stop_delay_ms = 3; 96 | optional uint32 max_per_24_h = 4; 97 | optional double skip_probability = 5; 98 | } 99 | 100 | optional uint32 trigger_timeout_ms = 3; 101 | } 102 | 103 | repeated string activate_triggers = 18; 104 | 105 | optional IncrementalStateConfig incremental_state_config = 21; 106 | message IncrementalStateConfig { 107 | optional uint32 clear_period_ms = 1; 108 | } 109 | 110 | optional bool allow_user_build_tracing = 19; 111 | optional string unique_session_name = 22; 112 | 113 | optional CompressionType compression_type = 24; 114 | enum CompressionType { 115 | COMPRESSION_TYPE_UNSPECIFIED = 0; 116 | COMPRESSION_TYPE_DEFLATE = 1; 117 | } 118 | 119 | optional IncidentReportConfig incident_report_config = 25; 120 | message IncidentReportConfig { 121 | optional string destination_package = 1; 122 | optional string destination_class = 2; 123 | optional int32 privacy_level = 3; 124 | optional bool skip_incidentd = 5; 125 | optional bool skip_dropbox = 4 [deprecated = true]; 126 | } 127 | 128 | optional StatsdLogging statsd_logging = 31; 129 | enum StatsdLogging { 130 | STATSD_LOGGING_UNSPECIFIED = 0; 131 | STATSD_LOGGING_ENABLED = 1; 132 | STATSD_LOGGING_DISABLED = 2; 133 | } 134 | 135 | optional int64 trace_uuid_msb = 27; 136 | optional int64 trace_uuid_lsb = 28; 137 | 138 | reserved 15, 26; 139 | } 140 | -------------------------------------------------------------------------------- /proto/protos/perfetto/config/track_event/track_event_config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message TrackEventConfig { 6 | repeated string disabled_categories = 1; 7 | repeated string enabled_categories = 2; 8 | repeated string disabled_tags = 3; 9 | repeated string enabled_tags = 4; 10 | } 11 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_application_state_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeApplicationStateInfo { 6 | optional ChromeApplicationState application_state = 1; 7 | enum ChromeApplicationState { 8 | APPLICATION_STATE_UNKNOWN = 0; 9 | APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1; 10 | APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2; 11 | APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3; 12 | APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/trace/track_event/source_location.proto"; 6 | 7 | message ChromeCompositorSchedulerState { 8 | optional ChromeCompositorStateMachine state_machine = 1; 9 | optional bool observing_begin_frame_source = 2; 10 | optional bool begin_impl_frame_deadline_task = 3; 11 | optional bool pending_begin_frame_task = 4; 12 | optional bool skipped_last_frame_missed_exceeded_deadline = 5; 13 | optional bool skipped_last_frame_to_reduce_latency = 6; 14 | optional ChromeCompositorSchedulerAction inside_action = 7; 15 | 16 | optional BeginImplFrameDeadlineMode deadline_mode = 8; 17 | enum BeginImplFrameDeadlineMode { 18 | DEADLINE_MODE_UNSPECIFIED = 0; 19 | DEADLINE_MODE_NONE = 1; 20 | DEADLINE_MODE_IMMEDIATE = 2; 21 | DEADLINE_MODE_REGULAR = 3; 22 | DEADLINE_MODE_LATE = 4; 23 | DEADLINE_MODE_BLOCKED = 5; 24 | } 25 | 26 | optional int64 deadline_us = 9; 27 | optional int64 deadline_scheduled_at_us = 10; 28 | optional int64 now_us = 11; 29 | optional int64 now_to_deadline_delta_us = 12; 30 | optional int64 now_to_deadline_scheduled_at_delta_us = 13; 31 | optional BeginImplFrameArgs begin_impl_frame_args = 14; 32 | optional BeginFrameObserverState begin_frame_observer_state = 15; 33 | optional BeginFrameSourceState begin_frame_source_state = 16; 34 | optional CompositorTimingHistory compositor_timing_history = 17; 35 | } 36 | 37 | message ChromeCompositorStateMachine { 38 | optional MajorState major_state = 1; 39 | message MajorState { 40 | optional ChromeCompositorSchedulerAction next_action = 1; 41 | 42 | optional BeginImplFrameState begin_impl_frame_state = 2; 43 | enum BeginImplFrameState { 44 | BEGIN_IMPL_FRAME_UNSPECIFIED = 0; 45 | BEGIN_IMPL_FRAME_IDLE = 1; 46 | BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2; 47 | BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3; 48 | } 49 | 50 | optional BeginMainFrameState begin_main_frame_state = 3; 51 | enum BeginMainFrameState { 52 | BEGIN_MAIN_FRAME_UNSPECIFIED = 0; 53 | BEGIN_MAIN_FRAME_IDLE = 1; 54 | BEGIN_MAIN_FRAME_SENT = 2; 55 | BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3; 56 | } 57 | 58 | optional LayerTreeFrameSinkState layer_tree_frame_sink_state = 4; 59 | enum LayerTreeFrameSinkState { 60 | LAYER_TREE_FRAME_UNSPECIFIED = 0; 61 | LAYER_TREE_FRAME_NONE = 1; 62 | LAYER_TREE_FRAME_ACTIVE = 2; 63 | LAYER_TREE_FRAME_CREATING = 3; 64 | LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4; 65 | LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5; 66 | } 67 | 68 | optional ForcedRedrawOnTimeoutState forced_redraw_state = 5; 69 | enum ForcedRedrawOnTimeoutState { 70 | FORCED_REDRAW_UNSPECIFIED = 0; 71 | FORCED_REDRAW_IDLE = 1; 72 | FORCED_REDRAW_WAITING_FOR_COMMIT = 2; 73 | FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3; 74 | FORCED_REDRAW_WAITING_FOR_DRAW = 4; 75 | } 76 | } 77 | 78 | optional MinorState minor_state = 2; 79 | message MinorState { 80 | optional int32 commit_count = 1; 81 | optional int32 current_frame_number = 2; 82 | optional int32 last_frame_number_submit_performed = 3; 83 | optional int32 last_frame_number_draw_performed = 4; 84 | optional int32 last_frame_number_begin_main_frame_sent = 5; 85 | optional bool did_draw = 6; 86 | optional bool did_send_begin_main_frame_for_current_frame = 7; 87 | optional bool did_notify_begin_main_frame_not_expected_until = 8; 88 | optional bool did_notify_begin_main_frame_not_expected_soon = 9; 89 | optional bool wants_begin_main_frame_not_expected = 10; 90 | optional bool did_commit_during_frame = 11; 91 | optional bool did_invalidate_layer_tree_frame_sink = 12; 92 | optional bool did_perform_impl_side_invalidaion = 13; 93 | optional bool did_prepare_tiles = 14; 94 | optional int32 consecutive_checkerboard_animations = 15; 95 | optional int32 pending_submit_frames = 16; 96 | optional int32 submit_frames_with_current_layer_tree_frame_sink = 17; 97 | optional bool needs_redraw = 18; 98 | optional bool needs_prepare_tiles = 19; 99 | optional bool needs_begin_main_frame = 20; 100 | optional bool needs_one_begin_impl_frame = 21; 101 | optional bool visible = 22; 102 | optional bool begin_frame_source_paused = 23; 103 | optional bool can_draw = 24; 104 | optional bool resourceless_draw = 25; 105 | optional bool has_pending_tree = 26; 106 | optional bool pending_tree_is_ready_for_activation = 27; 107 | optional bool active_tree_needs_first_draw = 28; 108 | optional bool active_tree_is_ready_to_draw = 29; 109 | optional bool did_create_and_initialize_first_layer_tree_frame_sink = 30; 110 | 111 | optional TreePriority tree_priority = 31; 112 | enum TreePriority { 113 | TREE_PRIORITY_UNSPECIFIED = 0; 114 | TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1; 115 | TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2; 116 | TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3; 117 | } 118 | 119 | optional ScrollHandlerState scroll_handler_state = 32; 120 | enum ScrollHandlerState { 121 | SCROLL_HANDLER_UNSPECIFIED = 0; 122 | SCROLL_AFFECTS_SCROLL_HANDLER = 1; 123 | SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2; 124 | } 125 | 126 | optional bool critical_begin_main_frame_to_activate_is_fast = 33; 127 | optional bool main_thread_missed_last_deadline = 34; 128 | optional bool skip_next_begin_main_frame_to_reduce_latency = 35; 129 | optional bool video_needs_begin_frames = 36; 130 | optional bool defer_begin_main_frame = 37; 131 | optional bool last_commit_had_no_updates = 38; 132 | optional bool did_draw_in_last_frame = 39; 133 | optional bool did_submit_in_last_frame = 40; 134 | optional bool needs_impl_side_invalidation = 41; 135 | optional bool current_pending_tree_is_impl_side = 42; 136 | optional bool previous_pending_tree_was_impl_side = 43; 137 | optional bool processing_animation_worklets_for_active_tree = 44; 138 | optional bool processing_animation_worklets_for_pending_tree = 45; 139 | optional bool processing_paint_worklets_for_pending_tree = 46; 140 | } 141 | } 142 | 143 | message BeginFrameArgs { 144 | optional BeginFrameArgsType type = 1; 145 | enum BeginFrameArgsType { 146 | BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0; 147 | BEGIN_FRAME_ARGS_TYPE_INVALID = 1; 148 | BEGIN_FRAME_ARGS_TYPE_NORMAL = 2; 149 | BEGIN_FRAME_ARGS_TYPE_MISSED = 3; 150 | } 151 | 152 | optional uint64 source_id = 2; 153 | optional uint64 sequence_number = 3; 154 | optional int64 frame_time_us = 4; 155 | optional int64 deadline_us = 5; 156 | optional int64 interval_delta_us = 6; 157 | optional bool on_critical_path = 7; 158 | optional bool animate_only = 8; 159 | 160 | oneof created_from { 161 | uint64 source_location_iid = 9; 162 | SourceLocation source_location = 10; 163 | } 164 | } 165 | 166 | message BeginImplFrameArgs { 167 | optional int64 updated_at_us = 1; 168 | optional int64 finished_at_us = 2; 169 | 170 | optional State state = 3; 171 | enum State { 172 | BEGIN_FRAME_FINISHED = 0; 173 | BEGIN_FRAME_USING = 1; 174 | } 175 | 176 | optional TimestampsInUs timestamps_in_us = 6; 177 | message TimestampsInUs { 178 | optional int64 interval_delta = 1; 179 | optional int64 now_to_deadline_delta = 2; 180 | optional int64 frame_time_to_now_delta = 3; 181 | optional int64 frame_time_to_deadline_delta = 4; 182 | optional int64 now = 5; 183 | optional int64 frame_time = 6; 184 | optional int64 deadline = 7; 185 | } 186 | 187 | oneof args { 188 | BeginFrameArgs current_args = 4; 189 | BeginFrameArgs last_args = 5; 190 | } 191 | } 192 | 193 | message BeginFrameObserverState { 194 | optional int64 dropped_begin_frame_args = 1; 195 | optional BeginFrameArgs last_begin_frame_args = 2; 196 | } 197 | 198 | message BeginFrameSourceState { 199 | optional uint32 source_id = 1; 200 | optional bool paused = 2; 201 | optional uint32 num_observers = 3; 202 | optional BeginFrameArgs last_begin_frame_args = 4; 203 | } 204 | 205 | message CompositorTimingHistory { 206 | optional int64 begin_main_frame_queue_critical_estimate_delta_us = 1; 207 | optional int64 begin_main_frame_queue_not_critical_estimate_delta_us = 2; 208 | optional int64 begin_main_frame_start_to_ready_to_commit_estimate_delta_us = 3; 209 | optional int64 commit_to_ready_to_activate_estimate_delta_us = 4; 210 | optional int64 prepare_tiles_estimate_delta_us = 5; 211 | optional int64 activate_estimate_delta_us = 6; 212 | optional int64 draw_estimate_delta_us = 7; 213 | } 214 | 215 | enum ChromeCompositorSchedulerAction { 216 | CC_SCHEDULER_ACTION_UNSPECIFIED = 0; 217 | CC_SCHEDULER_ACTION_NONE = 1; 218 | CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2; 219 | CC_SCHEDULER_ACTION_COMMIT = 3; 220 | CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4; 221 | CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5; 222 | CC_SCHEDULER_ACTION_DRAW_FORCED = 6; 223 | CC_SCHEDULER_ACTION_DRAW_ABORT = 7; 224 | CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8; 225 | CC_SCHEDULER_ACTION_PREPARE_TILES = 9; 226 | CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10; 227 | CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11; 228 | CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12; 229 | CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13; 230 | } 231 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeContentSettingsEventInfo { 6 | optional uint32 number_of_exceptions = 1; 7 | } 8 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_frame_reporter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeFrameReporter { 6 | optional State state = 1; 7 | enum State { 8 | STATE_NO_UPDATE_DESIRED = 0; 9 | STATE_PRESENTED_ALL = 1; 10 | STATE_PRESENTED_PARTIAL = 2; 11 | STATE_DROPPED = 3; 12 | } 13 | 14 | optional FrameDropReason reason = 2; 15 | enum FrameDropReason { 16 | REASON_UNSPECIFIED = 0; 17 | REASON_DISPLAY_COMPOSITOR = 1; 18 | REASON_MAIN_THREAD = 2; 19 | REASON_CLIENT_COMPOSITOR = 3; 20 | } 21 | 22 | optional uint64 frame_source = 3; 23 | optional uint64 frame_sequence = 4; 24 | optional bool affects_smoothness = 5; 25 | 26 | optional ScrollState scroll_state = 6; 27 | enum ScrollState { 28 | SCROLL_NONE = 0; 29 | SCROLL_MAIN_THREAD = 1; 30 | SCROLL_COMPOSITOR_THREAD = 2; 31 | SCROLL_UNKNOWN = 3; 32 | } 33 | 34 | optional bool has_main_animation = 7; 35 | optional bool has_compositor_animation = 8; 36 | optional bool has_smooth_input_main = 9; 37 | optional bool has_missing_content = 10; 38 | } 39 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_histogram_sample.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message HistogramName { 6 | optional uint64 iid = 1; 7 | optional string name = 2; 8 | } 9 | 10 | message ChromeHistogramSample { 11 | optional uint64 name_hash = 1; 12 | optional string name = 2; 13 | optional int64 sample = 3; 14 | optional uint64 name_iid = 4; 15 | } 16 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_keyed_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeKeyedService { 6 | optional string name = 1; 7 | } 8 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_latency_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeLatencyInfo { 6 | optional int64 trace_id = 1; 7 | 8 | optional Step step = 2; 9 | enum Step { 10 | STEP_UNSPECIFIED = 0; 11 | STEP_SEND_INPUT_EVENT_UI = 3; 12 | STEP_HANDLE_INPUT_EVENT_IMPL = 5; 13 | STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8; 14 | STEP_HANDLE_INPUT_EVENT_MAIN = 4; 15 | STEP_MAIN_THREAD_SCROLL_UPDATE = 2; 16 | STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1; 17 | STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9; 18 | STEP_HANDLED_INPUT_EVENT_IMPL = 10; 19 | STEP_SWAP_BUFFERS = 6; 20 | STEP_DRAW_AND_SWAP = 7; 21 | STEP_FINISHED_SWAP_BUFFERS = 11; 22 | } 23 | 24 | optional int32 frame_tree_node_id = 3; 25 | 26 | repeated ComponentInfo component_info = 4; 27 | message ComponentInfo { 28 | optional LatencyComponentType component_type = 1; 29 | optional uint64 time_us = 2; 30 | } 31 | 32 | optional bool is_coalesced = 5; 33 | optional int64 gesture_scroll_id = 6; 34 | 35 | enum LatencyComponentType { 36 | COMPONENT_UNSPECIFIED = 0; 37 | COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1; 38 | COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2; 39 | COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3; 40 | COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4; 41 | COMPONENT_INPUT_EVENT_LATENCY_UI = 5; 42 | COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6; 43 | COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7; 44 | COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8; 45 | COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9; 46 | COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10; 47 | COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11; 48 | COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12; 49 | COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13; 50 | COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_legacy_ipc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeLegacyIpc { 6 | optional MessageClass message_class = 1; 7 | enum MessageClass { 8 | CLASS_UNSPECIFIED = 0; 9 | CLASS_AUTOMATION = 1; 10 | CLASS_FRAME = 2; 11 | CLASS_PAGE = 3; 12 | CLASS_VIEW = 4; 13 | CLASS_WIDGET = 5; 14 | CLASS_INPUT = 6; 15 | CLASS_TEST = 7; 16 | CLASS_WORKER = 8; 17 | CLASS_NACL = 9; 18 | CLASS_GPU_CHANNEL = 10; 19 | CLASS_MEDIA = 11; 20 | CLASS_PPAPI = 12; 21 | CLASS_CHROME = 13; 22 | CLASS_DRAG = 14; 23 | CLASS_PRINT = 15; 24 | CLASS_EXTENSION = 16; 25 | CLASS_TEXT_INPUT_CLIENT = 17; 26 | CLASS_BLINK_TEST = 18; 27 | CLASS_ACCESSIBILITY = 19; 28 | CLASS_PRERENDER = 20; 29 | CLASS_CHROMOTING = 21; 30 | CLASS_BROWSER_PLUGIN = 22; 31 | CLASS_ANDROID_WEB_VIEW = 23; 32 | CLASS_NACL_HOST = 24; 33 | CLASS_ENCRYPTED_MEDIA = 25; 34 | CLASS_CAST = 26; 35 | CLASS_GIN_JAVA_BRIDGE = 27; 36 | CLASS_CHROME_UTILITY_PRINTING = 28; 37 | CLASS_OZONE_GPU = 29; 38 | CLASS_WEB_TEST = 30; 39 | CLASS_NETWORK_HINTS = 31; 40 | CLASS_EXTENSIONS_GUEST_VIEW = 32; 41 | CLASS_GUEST_VIEW = 33; 42 | CLASS_MEDIA_PLAYER_DELEGATE = 34; 43 | CLASS_EXTENSION_WORKER = 35; 44 | CLASS_SUBRESOURCE_FILTER = 36; 45 | CLASS_UNFREEZABLE_FRAME = 37; 46 | } 47 | 48 | optional uint32 message_line = 2; 49 | } 50 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_message_pump.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeMessagePump { 6 | optional bool sent_messages_in_queue = 1; 7 | optional uint64 io_handler_location_iid = 2; 8 | } 9 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_mojo_event_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeMojoEventInfo { 6 | optional string watcher_notify_interface_tag = 1; 7 | optional uint32 ipc_hash = 2; 8 | optional string mojo_interface_tag = 3; 9 | } 10 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeRendererSchedulerState { 6 | optional ChromeRAILMode rail_mode = 1; 7 | } 8 | 9 | enum ChromeRAILMode { 10 | RAIL_MODE_NONE = 0; 11 | RAIL_MODE_RESPONSE = 1; 12 | RAIL_MODE_ANIMATION = 2; 13 | RAIL_MODE_IDLE = 3; 14 | RAIL_MODE_LOAD = 4; 15 | } 16 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_user_event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeUserEvent { 6 | optional string action = 1; 7 | optional uint64 action_hash = 2; 8 | } 9 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message ChromeWindowHandleEventInfo { 6 | optional uint32 dpi = 1; 7 | optional uint32 message_id = 2; 8 | optional fixed64 hwnd_ptr = 3; 9 | } 10 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/debug_annotation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message DebugAnnotation { 6 | oneof name_field { 7 | uint64 name_iid = 1; 8 | string name = 10; 9 | } 10 | 11 | oneof value { 12 | bool bool_value = 2; 13 | uint64 uint_value = 3; 14 | int64 int_value = 4; 15 | double double_value = 5; 16 | string string_value = 6; 17 | uint64 pointer_value = 7; 18 | NestedValue nested_value = 8; 19 | string legacy_json_value = 9; 20 | } 21 | 22 | message NestedValue { 23 | optional NestedType nested_type = 1; 24 | enum NestedType { 25 | UNSPECIFIED = 0; 26 | DICT = 1; 27 | ARRAY = 2; 28 | } 29 | 30 | repeated string dict_keys = 2; 31 | repeated NestedValue dict_values = 3; 32 | repeated NestedValue array_values = 4; 33 | optional int64 int_value = 5; 34 | optional double double_value = 6; 35 | optional bool bool_value = 7; 36 | optional string string_value = 8; 37 | } 38 | } 39 | 40 | message DebugAnnotationName { 41 | optional uint64 iid = 1; 42 | optional string name = 2; 43 | } 44 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/log_message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message LogMessage { 6 | optional uint64 source_location_iid = 1; 7 | optional uint64 body_iid = 2; 8 | } 9 | 10 | message LogMessageBody { 11 | optional uint64 iid = 1; 12 | optional string body = 2; 13 | } 14 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/source_location.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message SourceLocation { 6 | optional uint64 iid = 1; 7 | optional string file_name = 2; 8 | optional string function_name = 3; 9 | optional uint32 line_number = 4; 10 | } 11 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/task_execution.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | message TaskExecution { 6 | optional uint64 posted_from_iid = 1; 7 | } 8 | -------------------------------------------------------------------------------- /proto/protos/perfetto/trace/track_event/track_event.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package perfetto.protos; 4 | 5 | import "protos/perfetto/trace/track_event/debug_annotation.proto"; 6 | import "protos/perfetto/trace/track_event/log_message.proto"; 7 | import "protos/perfetto/trace/track_event/task_execution.proto"; 8 | import "protos/perfetto/trace/track_event/chrome_application_state_info.proto"; 9 | import "protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto"; 10 | import "protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto"; 11 | import "protos/perfetto/trace/track_event/chrome_frame_reporter.proto"; 12 | import "protos/perfetto/trace/track_event/chrome_histogram_sample.proto"; 13 | import "protos/perfetto/trace/track_event/chrome_keyed_service.proto"; 14 | import "protos/perfetto/trace/track_event/chrome_latency_info.proto"; 15 | import "protos/perfetto/trace/track_event/chrome_legacy_ipc.proto"; 16 | import "protos/perfetto/trace/track_event/chrome_message_pump.proto"; 17 | import "protos/perfetto/trace/track_event/chrome_mojo_event_info.proto"; 18 | import "protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto"; 19 | import "protos/perfetto/trace/track_event/chrome_user_event.proto"; 20 | import "protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto"; 21 | import "protos/perfetto/trace/track_event/source_location.proto"; 22 | 23 | message TrackEvent { 24 | repeated uint64 category_iids = 3; 25 | repeated string categories = 22; 26 | 27 | optional Type type = 9; 28 | enum Type { 29 | TYPE_UNSPECIFIED = 0; 30 | TYPE_SLICE_BEGIN = 1; 31 | TYPE_SLICE_END = 2; 32 | TYPE_INSTANT = 3; 33 | TYPE_COUNTER = 4; 34 | } 35 | 36 | optional uint64 track_uuid = 11; 37 | repeated uint64 extra_counter_track_uuids = 31; 38 | repeated int64 extra_counter_values = 12; 39 | repeated uint64 extra_double_counter_track_uuids = 45; 40 | repeated double extra_double_counter_values = 46; 41 | repeated uint64 flow_ids = 36; 42 | repeated uint64 terminating_flow_ids = 42; 43 | repeated DebugAnnotation debug_annotations = 4; 44 | optional TaskExecution task_execution = 5; 45 | optional LogMessage log_message = 21; 46 | optional ChromeCompositorSchedulerState cc_scheduler_state = 24; 47 | optional ChromeUserEvent chrome_user_event = 25; 48 | optional ChromeKeyedService chrome_keyed_service = 26; 49 | optional ChromeLegacyIpc chrome_legacy_ipc = 27; 50 | optional ChromeHistogramSample chrome_histogram_sample = 28; 51 | optional ChromeLatencyInfo chrome_latency_info = 29; 52 | optional ChromeFrameReporter chrome_frame_reporter = 32; 53 | optional ChromeApplicationStateInfo chrome_application_state_info = 39; 54 | optional ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40; 55 | optional ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41; 56 | optional ChromeContentSettingsEventInfo chrome_content_settings_event_info = 43; 57 | optional ChromeMessagePump chrome_message_pump = 35; 58 | optional ChromeMojoEventInfo chrome_mojo_event_info = 38; 59 | 60 | optional LegacyEvent legacy_event = 6; 61 | message LegacyEvent { 62 | optional uint64 name_iid = 1; 63 | optional int32 phase = 2; 64 | optional int64 duration_us = 3; 65 | optional int64 thread_duration_us = 4; 66 | optional int64 thread_instruction_delta = 15; 67 | optional string id_scope = 7; 68 | optional bool use_async_tts = 9; 69 | optional uint64 bind_id = 8; 70 | optional bool bind_to_enclosing = 12; 71 | 72 | optional FlowDirection flow_direction = 13; 73 | enum FlowDirection { 74 | FLOW_UNSPECIFIED = 0; 75 | FLOW_IN = 1; 76 | FLOW_OUT = 2; 77 | FLOW_INOUT = 3; 78 | } 79 | 80 | optional InstantEventScope instant_event_scope = 14; 81 | enum InstantEventScope { 82 | SCOPE_UNSPECIFIED = 0; 83 | SCOPE_GLOBAL = 1; 84 | SCOPE_PROCESS = 2; 85 | SCOPE_THREAD = 3; 86 | } 87 | 88 | optional int32 pid_override = 18; 89 | optional int32 tid_override = 19; 90 | 91 | oneof id { 92 | uint64 unscoped_id = 6; 93 | uint64 local_id = 10; 94 | uint64 global_id = 11; 95 | } 96 | 97 | reserved 5; 98 | } 99 | 100 | oneof name_field { 101 | uint64 name_iid = 10; 102 | string name = 23; 103 | } 104 | 105 | oneof counter_value_field { 106 | int64 counter_value = 30; 107 | double double_counter_value = 44; 108 | } 109 | 110 | oneof source_location_field { 111 | SourceLocation source_location = 33; 112 | uint64 source_location_iid = 34; 113 | } 114 | 115 | oneof timestamp { 116 | int64 timestamp_delta_us = 1; 117 | int64 timestamp_absolute_us = 16; 118 | } 119 | 120 | oneof thread_time { 121 | int64 thread_time_delta_us = 2; 122 | int64 thread_time_absolute_us = 17; 123 | } 124 | 125 | oneof thread_instruction_count { 126 | int64 thread_instruction_count_delta = 8; 127 | int64 thread_instruction_count_absolute = 20; 128 | } 129 | 130 | extensions 1000 to 9899, 9900 to 10000; 131 | } 132 | 133 | message TrackEventDefaults { 134 | optional uint64 track_uuid = 11; 135 | repeated uint64 extra_counter_track_uuids = 31; 136 | repeated uint64 extra_double_counter_track_uuids = 45; 137 | } 138 | 139 | message EventCategory { 140 | optional uint64 iid = 1; 141 | optional string name = 2; 142 | } 143 | 144 | message EventName { 145 | optional uint64 iid = 1; 146 | optional string name = 2; 147 | } 148 | -------------------------------------------------------------------------------- /proto/protos/third_party/chromium/chrome_track_event.proto: -------------------------------------------------------------------------------- 1 | syntax = "gin_impl_frame_args.current_args.source_location_iidbegin_impl_frame_args.last_args.source_location_"; 2 | 3 | package perfetto.protos; 4 | 5 | import public "protos/perfetto/trace/track_event/track_event.proto"; 6 | 7 | message ChromeMemoryPressureNotification { 8 | optional MemoryPressureLevel level = 1; 9 | optional uint64 creation_location_iid = 2; 10 | } 11 | 12 | message ChromeTaskAnnotator { 13 | optional uint32 ipc_hash = 1; 14 | } 15 | 16 | message ChromeBrowserContext { 17 | optional fixed64 ptr = 1; 18 | } 19 | 20 | message ChromeProfileDestroyer { 21 | optional fixed64 profile_ptr = 1; 22 | optional bool is_off_the_record = 2; 23 | optional string otr_profile_id = 3; 24 | optional uint32 host_count_at_creation = 4; 25 | optional uint32 host_count_at_destruction = 5; 26 | optional fixed64 render_process_host_ptr = 6; 27 | } 28 | 29 | message ChromeTaskPostedToDisabledQueue { 30 | optional string task_queue_name = 1; 31 | optional uint64 time_since_disabled_ms = 2; 32 | optional uint32 ipc_hash = 3; 33 | optional uint64 source_location_iid = 4; 34 | } 35 | 36 | message ChromeTaskGraphRunner { 37 | optional int64 source_frame_number = 1; 38 | } 39 | 40 | message ChromeMessagePumpForUI { 41 | optional uint32 message_id = 1; 42 | } 43 | 44 | message RenderFrameImplDeletion { 45 | optional FrameDeleteIntention intent = 1; 46 | optional bool has_pending_commit = 2; 47 | optional bool has_pending_cross_document_commit = 3; 48 | optional uint64 frame_tree_node_id = 4; 49 | } 50 | 51 | message ShouldSwapBrowsingInstancesResult { 52 | optional uint64 frame_tree_node_id = 1; 53 | optional ShouldSwapBrowsingInstance result = 2; 54 | } 55 | 56 | message FrameTreeNodeInfo { 57 | optional uint64 frame_tree_node_id = 1; 58 | optional bool is_main_frame = 2; 59 | optional bool has_speculative_render_frame_host = 3; 60 | } 61 | 62 | message ChromeTrackEvent { 63 | extend TrackEvent { 64 | optional ChromeAppState chrome_app_state = 1000; 65 | optional ChromeMemoryPressureNotification chrome_memory_pressure_notification = 1001; 66 | optional ChromeTaskAnnotator chrome_task_annotator = 1002; 67 | optional ChromeBrowserContext chrome_browser_context = 1003; 68 | optional ChromeProfileDestroyer chrome_profile_destroyer = 1004; 69 | optional ChromeTaskPostedToDisabledQueue chrome_task_posted_to_disabled_queue = 1005; 70 | optional ChromeTaskGraphRunner chrome_task_graph_runner = 1006; 71 | optional ChromeMessagePumpForUI chrome_message_pump_for_ui = 1007; 72 | optional RenderFrameImplDeletion render_frame_impl_deletion = 1008; 73 | optional ShouldSwapBrowsingInstancesResult should_swap_browsing_instances_result = 1009; 74 | optional FrameTreeNodeInfo frame_tree_node_info = 1010; 75 | } 76 | } 77 | 78 | enum ChromeAppState { 79 | APP_STATE_FOREGROUND = 1; 80 | APP_STATE_BACKGROUND = 2; 81 | } 82 | 83 | enum MemoryPressureLevel { 84 | MEMORY_PRESSURE_LEVEL_NONE = 0; 85 | MEMORY_PRESSURE_LEVEL_MODERATE = 1; 86 | MEMORY_PRESSURE_LEVEL_CRITICAL = 2; 87 | } 88 | 89 | enum FrameDeleteIntention { 90 | FRAME_DELETE_INTENTION_NOT_MAIN_FRAME = 0; 91 | FRAME_DELETE_INTENTION_SPECULATIVE_MAIN_FRAME_FOR_SHUTDOWN = 1; 92 | FRAME_DELETE_INTENTION_SPECULATIVE_MAIN_FRAME_FOR_NAVIGATION_CANCELLED = 2; 93 | } 94 | 95 | enum ShouldSwapBrowsingInstance { 96 | SHOULD_SWAP_BROWSING_INSTANCE_NO = 0; 97 | SHOULD_SWAP_BROWSING_INSTANCE_YES_FORCE_SWAP = 1; 98 | SHOULD_SWAP_BROWSING_INSTANCE_YES_CROSS_SITE_PROACTIVE_SWAP = 2; 99 | SHOULD_SWAP_BROWSING_INSTANCE_YES_SAME_SITE_PROACTIVE_SWAP = 3; 100 | } 101 | -------------------------------------------------------------------------------- /src/generated/proto/proto_demux/demux.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from 'long'; 3 | import _m0 from 'protobufjs/minimal'; 4 | 5 | export const protobufPackage = 'mg.protocol.demux'; 6 | 7 | export interface Token { 8 | ubiTicket: string; 9 | orbitToken: string; 10 | ubiToken: Buffer; 11 | } 12 | 13 | export interface AuthenticateReq { 14 | token: Token | undefined; 15 | sendKeepAlive: boolean; 16 | clientId: string; 17 | logoutPushGroupId: string; 18 | } 19 | 20 | export interface AuthenticateRsp { 21 | success: boolean; 22 | expired: boolean; 23 | banned: boolean; 24 | } 25 | 26 | export interface OpenConnectionReq { 27 | serviceName: string; 28 | } 29 | 30 | export interface OpenConnectionRsp { 31 | connectionId: number; 32 | success: boolean; 33 | } 34 | 35 | export interface KeepAlivePush {} 36 | 37 | export interface DataMessage { 38 | connectionId: number; 39 | data: Buffer; 40 | } 41 | 42 | export interface ClientVersionPush { 43 | version: number; 44 | } 45 | 46 | export interface ClientOutdatedPush {} 47 | 48 | export interface ProductStartedPush { 49 | productId: number; 50 | } 51 | 52 | export interface ProductEndedPush { 53 | productId: number; 54 | } 55 | 56 | export interface ConnectionClosedPush { 57 | connectionId: number; 58 | errorCode: ConnectionClosedPush_ConnectionErrorCode; 59 | } 60 | 61 | export enum ConnectionClosedPush_ConnectionErrorCode { 62 | Connection_ForceQuit = 1, 63 | Connection_MultipleLogin = 2, 64 | Connection_Banned = 3, 65 | UNRECOGNIZED = -1, 66 | } 67 | 68 | export interface GetPatchInfoReq { 69 | patchTrackId: string; 70 | testConfig: boolean; 71 | trackType: number; 72 | } 73 | 74 | export interface GetPatchInfoRsp { 75 | success: boolean; 76 | patchTrackId: string; 77 | testConfig: boolean; 78 | patchBaseUrl: string; 79 | latestVersion: number; 80 | trackType: number; 81 | } 82 | 83 | export interface ServiceReq { 84 | service: string; 85 | data: Buffer; 86 | } 87 | 88 | export interface ServiceRsp { 89 | success: boolean; 90 | data: Buffer; 91 | } 92 | 93 | export interface Req { 94 | requestId: number; 95 | authenticateReq: AuthenticateReq | undefined; 96 | getPatchInfoReq: GetPatchInfoReq | undefined; 97 | serviceRequest: ServiceReq | undefined; 98 | openConnectionReq: OpenConnectionReq | undefined; 99 | clientIpOverride: number; 100 | } 101 | 102 | export interface Rsp { 103 | requestId: number; 104 | authenticateRsp: AuthenticateRsp | undefined; 105 | openConnectionRsp: OpenConnectionRsp | undefined; 106 | getPatchInfoRsp: GetPatchInfoRsp | undefined; 107 | serviceRsp: ServiceRsp | undefined; 108 | } 109 | 110 | export interface Push { 111 | data: DataMessage | undefined; 112 | connectionClosed: ConnectionClosedPush | undefined; 113 | keepAlive: KeepAlivePush | undefined; 114 | clientVersion: ClientVersionPush | undefined; 115 | clientOutdated: ClientOutdatedPush | undefined; 116 | productStarted: ProductStartedPush | undefined; 117 | productEnded: ProductEndedPush | undefined; 118 | } 119 | 120 | export interface Upstream { 121 | request: Req | undefined; 122 | push: Push | undefined; 123 | } 124 | 125 | export interface Downstream { 126 | response: Rsp | undefined; 127 | push: Push | undefined; 128 | } 129 | 130 | if (_m0.util.Long !== Long) { 131 | _m0.util.Long = Long as any; 132 | _m0.configure(); 133 | } 134 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | /* eslint-disable no-underscore-dangle */ 3 | import protobuf from 'protobufjs'; 4 | import glob from 'glob'; 5 | import { readFileSync, outputJSONSync } from 'fs-extra'; 6 | import yaml from 'yaml'; 7 | import * as demux from './generated/proto/proto_demux/demux'; 8 | 9 | const protoFiles = glob.sync('proto/**/*.proto'); 10 | console.log(`Loaded ${protoFiles.length} protos`); 11 | const packageDefinition = protobuf.loadSync(protoFiles); 12 | 13 | const demuxSchema = packageDefinition.lookup('mg.protocol.demux') as protobuf.Namespace; 14 | 15 | const serviceMap: Record = { 16 | utility_service: packageDefinition.lookup('mg.protocol.utility') as protobuf.Namespace, 17 | ownership_service: packageDefinition.lookup('mg.protocol.ownership') as protobuf.Namespace, 18 | denuvo_service: packageDefinition.lookup('mg.protocol.denuvo_service') as protobuf.Namespace, 19 | store_service: packageDefinition.lookup('mg.protocol.store') as protobuf.Namespace, 20 | friends_service: packageDefinition.lookup('mg.protocol.friends') as protobuf.Namespace, 21 | playtime_service: packageDefinition.lookup('mg.playtime') as protobuf.Namespace, 22 | party_service: packageDefinition.lookup('mg.protocol.party') as protobuf.Namespace, 23 | download_service: packageDefinition.lookup('mg.protocol.download_service') as protobuf.Namespace, 24 | client_configuration_service: packageDefinition.lookup( 25 | 'mg.protocol.client_configuration' 26 | ) as protobuf.Namespace, 27 | }; 28 | 29 | interface TLSPayload { 30 | length: number; 31 | data: Buffer; 32 | index: number; 33 | direction: 'Upstream' | 'Downstream'; 34 | } 35 | 36 | export interface Packet { 37 | packet: number; 38 | peer: number; 39 | index: number; 40 | timestamp: number; 41 | data: string; 42 | } 43 | 44 | export interface Peer { 45 | peer: number; 46 | host: string; 47 | port: number; 48 | } 49 | export interface TLSStreamExport { 50 | peers: Peer[]; 51 | packets: Packet[]; 52 | } 53 | 54 | const decodeRequests = (payloads: TLSPayload[]): any[] => { 55 | const openServiceRequests = new Map(); 56 | const openConnectionRequests = new Map(); 57 | const openConnections = new Map(); 58 | const decodedDemux = payloads.map((payload) => { 59 | const schema = demuxSchema.lookupType(payload.direction); 60 | console.log(`${payload.direction} index ${payload.index}:`); 61 | if (payload.data.length !== payload.length) { 62 | console.warn( 63 | `Buffer length of ${payload.data.length} does not match expected length of ${payload.length}` 64 | ); 65 | return null; 66 | } 67 | const body = schema.decode(payload.data) as 68 | | (protobuf.Message & demux.Upstream) 69 | | (protobuf.Message & demux.Downstream); 70 | 71 | // console.log(body); 72 | 73 | // Service requests/responses 74 | if ('request' in body && body.request?.serviceRequest) { 75 | const { requestId } = body.request; 76 | const { data, service } = body.request.serviceRequest; 77 | const serviceSchema = serviceMap[service]; 78 | if (!serviceSchema) { 79 | console.warn(`Missing service: ${service}`); 80 | return null; 81 | } 82 | const dataType = serviceSchema.lookupType(payload.direction); 83 | const decodedData = dataType.decode(data) as never; 84 | openServiceRequests.set(requestId, service); 85 | const updatedBody = body.toJSON(); 86 | updatedBody.request.serviceRequest.data = decodedData; 87 | return updatedBody; 88 | } 89 | if ('response' in body && body.response?.serviceRsp) { 90 | const { requestId } = body.response; 91 | const { data } = body.response.serviceRsp; 92 | const serviceName = openServiceRequests.get(requestId) as string; 93 | const serviceSchema = serviceMap[serviceName]; 94 | const dataType = serviceSchema.lookupType(payload.direction); 95 | const decodedData = dataType.decode(data) as never; 96 | openServiceRequests.delete(requestId); 97 | const updatedBody = body.toJSON(); 98 | updatedBody.response.serviceRsp.data = decodedData; 99 | return updatedBody; 100 | } 101 | 102 | // Connection requests/responses 103 | if ('request' in body && body.request?.openConnectionReq) { 104 | const { requestId } = body.request; 105 | const { serviceName } = body.request.openConnectionReq; 106 | openConnectionRequests.set(requestId, serviceName); 107 | } 108 | if ('response' in body && body.response?.openConnectionRsp) { 109 | const { requestId } = body.response; 110 | const { connectionId } = body.response.openConnectionRsp; 111 | const serviceName = openConnectionRequests.get(requestId) as string; 112 | openConnections.set(connectionId, serviceName); 113 | openConnectionRequests.delete(requestId); 114 | } 115 | 116 | // Connection pushes/closed 117 | if ('push' in body && body.push?.data) { 118 | const { connectionId, data } = body.push.data; 119 | const serviceName = openConnections.get(connectionId) as string; 120 | const serviceSchema = serviceMap[serviceName]; 121 | if (!serviceSchema) { 122 | console.warn(`Missing service: ${serviceName}`); 123 | return null; 124 | } 125 | const dataType = serviceSchema.lookupType(payload.direction); 126 | const trimmedPush = data.subarray(4); // First 4 bytes are length 127 | const decodedData = dataType.decode(trimmedPush) as never; 128 | const updatedBody = body.toJSON(); 129 | updatedBody.push.data.data = decodedData; 130 | return updatedBody; 131 | } 132 | if ('push' in body && body.push?.connectionClosed) { 133 | const { connectionId } = body.push.connectionClosed; 134 | openConnections.delete(connectionId); 135 | } 136 | return body.toJSON(); 137 | }); 138 | return decodedDemux; 139 | }; 140 | 141 | const main = () => { 142 | const tlsStream: TLSStreamExport = yaml.parse(readFileSync('tls-stream.yml', 'utf-8'), { 143 | resolveKnownTags: false, // wireshark of course spits out invalid yaml binary, so we don't resolve it here 144 | logLevel: 'error', 145 | }); 146 | outputJSONSync('parsed-tls-stream.json', tlsStream, { spaces: 2 }); 147 | const upstreamPeer = tlsStream.peers.find((peer) => peer.port > 0)?.peer || 0; 148 | const mappedPayloads: TLSPayload[] = tlsStream.packets.map((packet) => { 149 | const b64Segments = packet.data.split(/=+/); // If there's padding, we need to parse each b64 string individually 150 | const joinedBinary = b64Segments.reduce((acc, curr) => { 151 | const segmentBuf = Buffer.from(curr, 'base64'); 152 | return Buffer.concat([acc, segmentBuf]); 153 | }, Buffer.alloc(0)); 154 | const length = joinedBinary.readUInt32BE(); 155 | const dataSeg = joinedBinary.subarray(4); 156 | return { 157 | length, 158 | data: dataSeg, 159 | index: packet.index, 160 | direction: packet.peer === upstreamPeer ? 'Upstream' : 'Downstream', 161 | }; 162 | }); 163 | const decodedDemuxes = decodeRequests(mappedPayloads); 164 | console.log(`Generated ${decodedDemuxes.length} responses`); 165 | outputJSONSync('decodes.json', decodedDemuxes, { 166 | spaces: 2, 167 | }); 168 | }; 169 | 170 | main(); 171 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // see https://github.com/tsconfig/bases/blob/main/bases/node14.json 4 | "target": "ES2020", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "outDir": "./dist", /* Redirect output structure to the directory. */ 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "inlineSourceMap": true, // Inline sourcemaps for jest debugging 11 | "useUnknownInCatchVariables": false, 12 | "declaration": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "typeRoots": [ 15 | "node_modules/@types", 16 | "src/types" 17 | ], 18 | }, 19 | "exclude": [ 20 | "node_modules", 21 | "dist", 22 | ] 23 | } --------------------------------------------------------------------------------