Skip to content

Commit

Permalink
Merge pull request #46 from KVVat/niap-permissions-update-sdk34
Browse files Browse the repository at this point in the history
Niap permissions update sdk34
  • Loading branch information
KVVat authored Apr 17, 2024
2 parents e933165 + 2b7e8fb commit 550ac7b
Show file tree
Hide file tree
Showing 146 changed files with 9,381 additions and 1,172 deletions.
8 changes: 7 additions & 1 deletion niap-cc/Permissions/Companion/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ tmp/build
app/build

/security

/buildSrc
/buildSrc/.gradle
/buildSrc/.gradle/*
/builSrc/build
/builSrc/build/*
.gradle/
.idea/
14 changes: 13 additions & 1 deletion niap-cc/Permissions/Companion/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Permission Test Tool Companion
# Permission Test Tool Companion
This sample app is a tool which aids OEMs in testing their devices for
evaluation of the Common Criteria certificate through
[NIAP](https://www.niap-ccevs.org/).
Expand All @@ -17,13 +17,25 @@ This app should be signed with a different signing key from that used to sign
the Permission Test Tool; if the two apps have the same signing identity it can
cause some of the permission tests to fail.

## Functionalities

- This application provides entry points to the services, we can test the permissions
which have 'BIND_*' prefix with these.
- Install several media files for testing
- Put a data into the DropBox
- Prepare hidden flags to test device policy manager test cases.
- You can toggle this flags by a checkbox on the bottom of the activity.
- Check the behaviour of the location manager.

## Pre-requisites
* Android SDK 28+

## Getting Started
This sample uses the Gradle build system. To build this project, use the
`gradlew build` command or use `Import Project` in Android Studio.

Also You can publish apk file into the Tester/package directory with `./gradlew publishAll` command

## Support
If you've found an error in this sample, please file an issue on the github bug
tracker for this project.
Expand Down
48 changes: 37 additions & 11 deletions niap-cc/Permissions/Companion/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
apply plugin: 'com.android.application'
def applicationName = 'Companion'
android {
compileSdkVersion 33
compileSdk 34
signingConfigs {
// TODO :
// Prepare your own companion.jks and put it into
Expand All @@ -30,28 +30,45 @@ android {
keyPassword "android"
keyAlias "companion"
}
platform {
storeFile file('../security/platform.jks')
storePassword "android"
keyPassword "android"
keyAlias "platform"
}
}
defaultConfig {
applicationId "com.android.certifications.niap.permissions.companion"
minSdkVersion 28
targetSdkVersion 33
//noinspection EditedTargetSdkVersion,OldTargetApi
targetSdkVersion 34
versionCode 1
versionName "1.0"
signingConfig signingConfigs.companion
signingConfig signingConfigs.platform

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
def publish = project.tasks.create("publishAll")
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${applicationName}-${variant.buildType.name}.apk"
}
if(variant.buildType.name.equals("debug")){
def task = project.tasks.create("publish${variant.name.capitalize()}Apk", Copy)
variant.outputs.all { item ->
task.from(item.outputFile)
}
task.into("$rootDir/../Tester/package")
task.dependsOn variant.assemble
publish.dependsOn task
}
}

buildTypes {
debug {
signingConfig null
debuggable true
signingConfig signingConfigs.companion
signingConfig signingConfigs.platform
}
release {
signingConfig null
Expand All @@ -65,19 +82,28 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
namespace 'com.android.certifications.niap.permissions.companion'
buildFeatures {
aidl true
}
lint {
abortOnError false
}
namespace 'com.android.certifications.niap.permissions.companion'
}

configurations.implementation {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.gms:play-services-location:21.0.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'

}
76 changes: 54 additions & 22 deletions niap-cc/Permissions/Companion/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.certifications.niap.permissions.companion">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- The app does not use this permission, but it is requested so that it can be revoked during
the REVOKE_RUNTIME_PERMISSIONS test. -->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.LAUNCH_DEVICE_MANAGER_SETUP"/>
<uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
<uses-permission android:name="android.permission.WRITE_DEVICE_CONFIG" />

<!--<uses-permission android:name="android.permission.LAUNCH_DEVICE_MANAGER_SETUP"/>-->
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand Down Expand Up @@ -59,7 +65,7 @@
android:immersive="true"
android:launchMode="singleTop"
android:exported="true"
android:permission="andorid.permission.START_VIEW_PERMISSION_USAGE"
android:permission="android.permission.START_VIEW_PERMISSION_USAGE"
android:theme="@style/AppTheme">
<intent-filter android:priority="11">
<action android:name="android.intent.action.VIEW_PERMISSION_USAGE" />
Expand Down Expand Up @@ -405,81 +411,107 @@
android:permission="android.permission.BIND_AUGMENTED_AUTOFILL_SERVICE" />

<!-- The following services are required for new permissions in Android 12. -->
<service android:name=".services.TestBindCallDiagnosticServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindCallDiagnosticServiceService"
android:permission="android.permission.BIND_CALL_DIAGNOSTIC_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindCompanionDeviceServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindCompanionDeviceServiceService"
android:permission="android.permission.BIND_COMPANION_DEVICE_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindDisplayHashingServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindDisplayHashingServiceService"
android:permission="android.permission.BIND_DISPLAY_HASHING_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindDomainVerificationAgentService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindDomainVerificationAgentService"
android:permission="android.permission.BIND_DOMAIN_VERIFICATION_AGENT"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindGbaServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindGbaServiceService"
android:permission="android.permission.BIND_GBA_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindHotwordDetectionServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindHotwordDetectionServiceService"
android:permission="android.permission.BIND_HOTWORD_DETECTION_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindMusicRecognitionServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindMusicRecognitionServiceService"
android:permission="android.permission.BIND_MUSIC_RECOGNITION_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindResumeOnRebootServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindResumeOnRebootServiceService"
android:permission="android.permission.BIND_RESUME_ON_REBOOT_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindRotationResolverServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindRotationResolverServiceService"
android:permission="android.permission.BIND_ROTATION_RESOLVER_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindTimeZoneProviderServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindTimeZoneProviderServiceService"
android:permission="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindTranslationServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindTranslationServiceService"
android:permission="android.permission.BIND_TRANSLATION_SERVICE"
android:enabled="true"
android:exported="true" />
<!-- Services for android T -->

<service android:name=".services.TestBindAmbientContextDetectionServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindAmbientContextDetectionServiceService"
android:permission="android.permission.BIND_AMBIENT_CONTEXT_DETECTION_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindTvInteractiveAppService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindTvInteractiveAppService"
android:permission="android.permission.BIND_TV_INTERACTIVE_APP"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindWallpaperEffectsGenerationServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindWallpaperEffectsGenerationServiceService"
android:permission="android.permission.BIND_WALLPAPER_EFFECTS_GENERATION_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindSelectionToolbarRenderServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindSelectionToolbarRenderServiceService"
android:permission="android.permission.BIND_SELECTION_TOOLBAR_RENDER_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindGameServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindGameServiceService"
android:permission="android.permission.BIND_GAME_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindTraceReportServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindTraceReportServiceService"
android:permission="android.permission.BIND_TRACE_REPORT_SERVICE"
android:enabled="true"
android:exported="true" />
<service android:name=".services.TestBindAttestationVerificationServiceService"
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindAttestationVerificationServiceService"
android:permission="android.permission.BIND_ATTESTATION_VERIFICATION_SERVICE"
android:enabled="true"
android:exported="true" />

<!-- Services for android U -->
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindCallStreamingServiceService"
android:permission="android.permission.BIND_CALL_STREAMING_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindCredentialProviderServiceService"
android:permission="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindFieldClassificationServiceService"
android:permission="android.permission.BIND_FIELD_CLASSIFICATION_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindRemoteLockscreenValidationServiceService"
android:permission="android.permission.BIND_REMOTE_LOCKSCREEN_VALIDATION_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindSatelliteGatewayServiceService"
android:permission="android.permission.BIND_SATELLITE_GATEWAY_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindSatelliteServiceService"
android:permission="android.permission.BIND_SATELLITE_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindVisualQueryDetectionServiceService"
android:permission="android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE"
android:enabled="true" android:exported="true" />
<service android:name="com.android.certifications.niap.permissions.companion.services.TestBindWearableSensingServiceService"
android:permission="android.permission.BIND_WEARABLE_SENSING_SERVICE"
android:enabled="true" android:exported="true" />


</application>

Expand Down
Loading

0 comments on commit 550ac7b

Please sign in to comment.