commit | cc5698f5c645cfd6c8087f20419d079f0e2ef274 | [log] [tgz] |
---|---|---|
author | Karsten Tausche <karsten@fairphone.com> | Fri Feb 26 20:01:31 2021 +0100 |
committer | Karsten Tausche <karsten@fairphone.com> | Tue Mar 02 15:45:26 2021 +0100 |
tree | 6ef5567031d65f2ab11774d0ca09fc0a08ee665d | |
parent | a82eb5d597eb631335351f7ec658b77ba0cf0a3b [diff] |
Fix querying camera driver names for Android 9 System apps are not allowed anymore to read sysfs entries, so we need to run moduledetect in a dedicated SELinux domain instead. Therefore, it also doesn't make sense anymore to run it as system user. To ensure querying sysfs is executed in the correct security context, implement it within the app instead of calling shell commands. Issue: FP2P-543 Change-Id: Ie7b6130504e2b2956389aa07b3dca456a86959fc Depends-On: I96924ad411fd03e3e195ac7feff7b1b550ed4e77
ModuleDetect can be built using Android Studio or directly with Gradle.
In order to build in Android Studio, import the root of the Git repository as a new project and use the features of the IDE to edit, build, run, and debug ModuleDetect.
To build from commandline you will need the Android SDK and Gradle. Follow the instructions in Android documentation.
By default both debug and release build variants are signed using default keys included in the Android SDK. To sign the app for release, you need
The release key can be put in a keystore using a script in vendor/fairphone/tools/
.
Point the build system to the keystore using a configuration file which includes the path to the keystore, the alias of the key, and passwords for keystore and key. The file keystore.properties
needs to be at the root of the Git repository and contain information like:
storePassword=<pwd-of-keystore> keyPassword=<pwd-of-key-in-keystore> keyAlias=ModuleDetectReleaseKey storeFile=../relative/path/to/moduledetect.keystore
You can verify that Gradle can find and open the key by checking the output of gradlew signingReport
. The sections for release
and releaseUnitTest
variants should look similar to:
Variant: release Config: release Store: /absolute/path/to/moduledetect.keystore Alias: ModuleDetectReleaseKey MD5: 7D:F2:FC:AA:FD:75:F3:83:5C:ED:AE:63:B7:F2:AD:AB SHA1: 30:63:51:FB:98:33:47:1A:26:00:2D:58:C7:F1:1D:76:DE:F0:34:8E Valid until: Monday, November 24, 2042
If configuration is correct, gradlew assembleRelease
can be used to create the signed app at ./app/build/outputs/apk/release/app-release.apk
.