1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.devtools.testing.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/devtools/testing/v1/test_execution.proto"; 23 24option go_package = "google.golang.org/genproto/googleapis/devtools/testing/v1;testing"; 25option java_multiple_files = true; 26option java_outer_classname = "ApplicationDetailProto"; 27option java_package = "com.google.devtools.testing.v1"; 28 29// A service which parses input applications and returns details that can be 30// useful in the context of testing. 31service ApplicationDetailService { 32 option (google.api.default_host) = "testing.googleapis.com"; 33 option (google.api.oauth_scopes) = 34 "https://www.googleapis.com/auth/cloud-platform"; 35 36 // Gets the details of an Android application APK. 37 rpc GetApkDetails(GetApkDetailsRequest) returns (GetApkDetailsResponse) { 38 option (google.api.http) = { 39 post: "/v1/applicationDetailService/getApkDetails" 40 body: "location" 41 }; 42 } 43} 44 45// Android application details based on application manifest and archive 46// contents. 47message ApkDetail { 48 ApkManifest apk_manifest = 1; 49} 50 51// An Android app manifest. See 52// http://developer.android.com/guide/topics/manifest/manifest-intro.html 53message ApkManifest { 54 // Full Java-style package name for this application, e.g. 55 // "com.example.foo". 56 string package_name = 1; 57 58 // Minimum API level required for the application to run. 59 int32 min_sdk_version = 2; 60 61 // Maximum API level on which the application is designed to run. 62 int32 max_sdk_version = 3; 63 64 // Specifies the API Level on which the application is designed to run. 65 int32 target_sdk_version = 6; 66 67 // User-readable name for the application. 68 string application_label = 4; 69 70 repeated IntentFilter intent_filters = 5; 71 72 // Permissions declared to be used by the application 73 repeated string uses_permission = 7; 74 75 // Version number used internally by the app. 76 int64 version_code = 8; 77 78 // Version number shown to users. 79 string version_name = 9; 80 81 // Meta-data tags defined in the manifest. 82 repeated Metadata metadata = 10; 83 84 // Feature usage tags defined in the manifest. 85 repeated UsesFeature uses_feature = 11; 86 87 // Services contained in the <application> tag. 88 repeated Service services = 12; 89} 90 91// The <service> section of an <application> tag. 92// https://developer.android.com/guide/topics/manifest/service-element 93message Service { 94 // The android:name value 95 string name = 1; 96 97 // Intent filters in the service 98 repeated IntentFilter intent_filter = 2; 99} 100 101// The <intent-filter> section of an <activity> tag. 102// https://developer.android.com/guide/topics/manifest/intent-filter-element.html 103message IntentFilter { 104 // The android:name value of the <action> tag. 105 repeated string action_names = 1; 106 107 // The android:name value of the <category> tag. 108 repeated string category_names = 2; 109 110 // The android:mimeType value of the <data> tag. 111 string mime_type = 3; 112} 113 114// A <meta-data> tag within a manifest. 115// https://developer.android.com/guide/topics/manifest/meta-data-element.html 116message Metadata { 117 // The android:name value 118 string name = 1; 119 120 // The android:value value 121 string value = 2; 122} 123 124// A <uses-feature> tag within a manifest. 125// https://developer.android.com/guide/topics/manifest/uses-feature-element.html 126message UsesFeature { 127 // The android:name value 128 string name = 1; 129 130 // The android:required value 131 bool is_required = 2; 132} 133 134// A request to get the details of an Android application. 135message GetApkDetailsRequest { 136 // Optional. The APK to be parsed for details. 137 FileReference location = 1 [(google.api.field_behavior) = OPTIONAL]; 138 139 // Optional. The App Bundle to be parsed for details. 140 FileReference bundle_location = 2 [(google.api.field_behavior) = OPTIONAL]; 141} 142 143// Response containing the details of the specified Android application. 144message GetApkDetailsResponse { 145 // Details of the Android App. 146 ApkDetail apk_detail = 1; 147} 148