diff --git a/.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml b/.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml new file mode 100644 index 0000000..ab9576c --- /dev/null +++ b/.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml @@ -0,0 +1,61 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Build AndroidDeveloperVerificationOnboarding + +on: + push: + branches: [ '*' ] + paths: + - 'AndroidDeveloperVerificationOnboarding/**' + - '.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml' + pull_request: + branches: [ '*' ] + paths: + - 'AndroidDeveloperVerificationOnboarding/**' + - '.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build AndroidDeveloperVerificationOnboarding + runs-on: ubuntu-latest + timeout-minutes: 30 + + defaults: + run: + working-directory: AndroidDeveloperVerificationOnboarding + + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT || github.token }} + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Build All + run: ./gradlew build --stacktrace diff --git a/AndroidDeveloperVerificationOnboarding/.gitignore b/AndroidDeveloperVerificationOnboarding/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/AndroidDeveloperVerificationOnboarding/.google/packaging.yaml b/AndroidDeveloperVerificationOnboarding/.google/packaging.yaml new file mode 100644 index 0000000..0b27b64 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/.google/packaging.yaml @@ -0,0 +1,28 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# GOOGLE SAMPLE PACKAGING DATA +# +# This file is used by Google as part of our samples packaging process. +# End users may safely ignore this file. It has no relevance to other systems. +--- +status: PUBLISHED +technologies: [Android] +categories: [Security] +languages: [Kotlin] +solutions: [Mobile] +github: android/security-samples +level: BEGINNER +apiRefs: +license: apache2 diff --git a/AndroidDeveloperVerificationOnboarding/README.md b/AndroidDeveloperVerificationOnboarding/README.md new file mode 100644 index 0000000..1fbbf0f --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/README.md @@ -0,0 +1,5 @@ +# Android Developer Verification Onboarding Sample + +Are you preparing to sign an APK for the Android developer verification proof of ownership process? + +This project shows you exactly which file to create (adi-registration.properties) and provides the necessary folder structure to guide you. Use this template to check your placement of the file and ensure the correct insertion of your unique developer 'snippet' for successful verification. diff --git a/AndroidDeveloperVerificationOnboarding/app/.gitignore b/AndroidDeveloperVerificationOnboarding/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/build.gradle.kts b/AndroidDeveloperVerificationOnboarding/app/build.gradle.kts new file mode 100644 index 0000000..adbf181 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/build.gradle.kts @@ -0,0 +1,76 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.compose) +} + +android { + namespace = "com.androiddeveloperverification.onboarding" + compileSdk = 35 + + defaultConfig { + applicationId = "com.androiddeveloperverification.onboarding" + minSdk = 33 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) +} \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/proguard-rules.pro b/AndroidDeveloperVerificationOnboarding/app/proguard-rules.pro new file mode 100644 index 0000000..19afc41 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/proguard-rules.pro @@ -0,0 +1,22 @@ + +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/AndroidManifest.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..43be6d0 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/assets/adi-registration.properties b/AndroidDeveloperVerificationOnboarding/app/src/main/assets/adi-registration.properties new file mode 100644 index 0000000..f2940c9 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/assets/adi-registration.properties @@ -0,0 +1 @@ +DPAW2Z2OZAAACAAAAAAAAAAAAA diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/MainActivity.kt b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/MainActivity.kt new file mode 100644 index 0000000..f5e8bb3 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/MainActivity.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.androiddeveloperverification.onboarding + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.material3.MaterialTheme +import com.androiddeveloperverification.onboarding.ui.screens.GreetingScreen + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + MaterialTheme { + GreetingScreen() + } + } + } +} \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/components/Greeting.kt b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/components/Greeting.kt new file mode 100644 index 0000000..dfd0a09 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/components/Greeting.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.androiddeveloperverification.onboarding.ui.components + +import androidx.annotation.StringRes +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource + +@Composable +fun Greeting( + @StringRes message: Int, + modifier: Modifier = Modifier +) { + Text( + text = stringResource(message), + modifier = modifier + ) +} \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/screens/GreetingScreen.kt b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/screens/GreetingScreen.kt new file mode 100644 index 0000000..1622286 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/java/com/androiddeveloperverification/onboarding/ui/screens/GreetingScreen.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.androiddeveloperverification.onboarding.ui.screens + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.androiddeveloperverification.onboarding.R +import com.androiddeveloperverification.onboarding.ui.components.Greeting + +@Composable +fun GreetingScreen(modifier: Modifier = Modifier) { + Scaffold(modifier = modifier.fillMaxSize()) { innerPadding -> + Box( + modifier = Modifier + .padding(innerPadding) + .fillMaxSize(), + contentAlignment = Alignment.Center + ) { + Greeting( + message = R.string.welcome_message, + modifier = Modifier.padding(horizontal = 16.dp) + ) + } + } +} \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..b7b8b7c --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_foreground.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..b324272 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..957556d --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..957556d --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidDeveloperVerificationOnboarding/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/colors.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..11c1843 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/colors.xml @@ -0,0 +1,25 @@ + + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/strings.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..3b3a4d8 --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/strings.xml @@ -0,0 +1,19 @@ + + + Android Developer Verification Onboarding Sample + Welcome to the Android Developer Verification onboarding app. \n\nInstructions:\n1. Use a new Android Studio project with your package name.\n2. Place an adi-registration.properties file in the same location as this project with your unique snippet.\n3. Build and sign with your key.\n4. Upload to the console. + \ No newline at end of file diff --git a/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/themes.xml b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..9fe976c --- /dev/null +++ b/AndroidDeveloperVerificationOnboarding/app/src/main/res/values/themes.xml @@ -0,0 +1,20 @@ + + + + +