diff --git a/android/bundle/devices.proto b/android/bundle/devices.proto index 4964811..2947152 100644 --- a/android/bundle/devices.proto +++ b/android/bundle/devices.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package android.bundle; +import "buf/validate/validate.proto"; import "google/protobuf/wrappers.proto"; option java_package = "com.android.bundle"; @@ -10,10 +11,10 @@ message DeviceSpec { // Supported ABI architectures in the order of preference. // The values should be the string as reported by the platform, e.g. // "armeabi-v7a" or "x86_64". - repeated string supported_abis = 1; + repeated string supported_abis = 1 [(buf.validate.field).repeated.min_items = 1]; // All installed locales represented as BCP-47 strings. - repeated string supported_locales = 2; + repeated string supported_locales = 2 [(buf.validate.field).repeated.min_items = 1]; // List of device features returned by the package manager utility. repeated string device_features = 3; @@ -22,10 +23,10 @@ message DeviceSpec { repeated string gl_extensions = 4; // Screen dpi. - uint32 screen_density = 5; + uint32 screen_density = 5 [(buf.validate.field).uint32.gt = 0]; // getprop ro.build.version.sdk - uint32 sdk_version = 6; + uint32 sdk_version = 6 [(buf.validate.field).uint32.gt = 0]; // getprop ro.build.version.codename string codename = 7; diff --git a/android/bundle/devices.proto.license b/android/bundle/devices.proto.license index fd0fc9c..9472642 100644 --- a/android/bundle/devices.proto.license +++ b/android/bundle/devices.proto.license @@ -1,3 +1,4 @@ Copyright (C) The Android Open Source Project +Copyright 2025 Logan Magee SPDX-License-Identifier: Apache-2.0 diff --git a/buf.lock b/buf.lock new file mode 100644 index 0000000..bb66131 --- /dev/null +++ b/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/bufbuild/protovalidate + commit: 52f32327d4b045a79293a6ad4e7e1236 + digest: b5:cbabc98d4b7b7b0447c9b15f68eeb8a7a44ef8516cb386ac5f66e7fd4062cd6723ed3f452ad8c384b851f79e33d26e7f8a94e2b807282b3def1cd966c7eace97 diff --git a/buf.lock.license b/buf.lock.license new file mode 100644 index 0000000..f615b20 --- /dev/null +++ b/buf.lock.license @@ -0,0 +1,3 @@ +Copyright 2025 Logan Magee + +SPDX-License-Identifier: Apache-2.0 diff --git a/buf.yaml b/buf.yaml index 93ffc92..4aeac1f 100644 --- a/buf.yaml +++ b/buf.yaml @@ -6,6 +6,8 @@ version: v2 modules: - path: . name: buf.build/accrescent/android-bundle +deps: + - buf.build/bufbuild/protovalidate:v1.0.0 lint: ignore: - android/bundle