Skip to content

Commit e5fed57

Browse files
authored
Merge pull request #219 from googlesamples/pfm/update_readme
Update README.md - Remove references to https://down-box.appspot.com/ till it is not fixed and add provisioning instructions to use the code **afw#testdpc** - Add image for QR code - Add required ANDROID_HOME setup step for Bazel
2 parents 9e5c925 + 4411ab2 commit e5fed57

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

README.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,54 @@ Test DPC is an app designed to help EMMs, ISVs, and OEMs to test their applicati
55

66
See the [documentation](https://developer.android.com/work/index.html) to learn more about Android in the enterprise.
77

8-
Getting Started
9-
---------------
8+
## Getting Started
109

1110
This sample uses the Bazel build system. To build this project, use the "bazel build testdpc" command.
1211

1312
This app can also be found [on the Play store](https://play.google.com/store/apps/details?id=com.afwsamples.testdpc).
1413

15-
Provisioning
16-
------------
14+
## Provisioning
1715

1816
You can find various kinds of provisioning methods [here](https://developers.google.com/android/work/prov-devices#Key_provisioning_differences_across_android_releases). Let's take a few of them as an example.
1917

20-
#### QR code provisioning (Device Owner N+ only) ####
18+
### AFW# code provisioning (Device Owner M+)
2119
1. Factory reset your device and tap the welcome screen in setup wizard 6 times.
22-
2. The setup wizard prompts the user to connect to the Internet so the setup wizard can download a QR code reader.
23-
3. Modify (if needed) and scan [this QR code] (http://down-box.appspot.com/qr/nQB0tw7b).
24-
4. Follow onscreen instructions
20+
2. When prompted to sign in, enter **afw#testdpc**
21+
3. Follow onscreen instructions
2522

26-
#### ADB command ####
27-
28-
**Device Owner**
23+
### QR code provisioning (Device Owner N+ only)
24+
1. Factory reset your device and tap the welcome screen in setup wizard 6 times.
25+
1. On Android O or older, the setup wizard prompts the user to connect to the Internet so the setup wizard can download a QR code reader.
26+
Android P and newer devices already have the QR code reader available.
27+
1. Generate a QR code with the content:
28+
```
29+
{
30+
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver",
31+
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "gJD2YwtOiWJHkSMkkIfLRlj-quNqG1fb6v100QmzM9w=",
32+
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://testdpc-latest-apk.appspot.com"
33+
}
34+
```
35+
or use this pre-made QR code:
36+
![testdpc_provisioning](https://github.com/googlesamples/android-testdpc/assets/188886/a54b809f-cf58-433b-8cbe-f14cf3f00612)
37+
1. Scan the QR code and follow onscreen instructions
38+
39+
### ADB command
40+
41+
#### Device Owner (DO)
2942

3043
* Run the `adb` command:
3144

3245
```console
3346
adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver
3447
```
3548

36-
**Profile Owner**
49+
#### Profile Owner - Personal device (PO - BYOD)
3750

3851
* Create a managed profile by launching the “Set up TestDPC” app (if this app
3952
seems broken and you are in dark mode, switch to light mode)
4053
* Skip adding an account at the end of the flow
4154

42-
**COPE Profile Owner**
55+
#### Profile Owner - Corporate-owned device (PO - COPE)
4356

4457
* Create a managed profile by launching the “Set up TestDPC” app (if this app
4558
seems broken and you are in dark mode, switch to light mode)
@@ -50,7 +63,7 @@ You can find various kinds of provisioning methods [here](https://developers.goo
5063
adb shell dpm mark-profile-owner-on-organization-owned-device --user 10 com.afwsamples.testdpc/.DeviceAdminReceiver`
5164
```
5265

53-
## TestDPC as DM role holder
66+
#### TestDPC as DM role holder
5467

5568
TestDPC v9.0.5+ can be setup as Device Management Role Holder.
5669

@@ -64,8 +77,7 @@ TestDPC v9.0.5+ can be setup as Device Management Role Holder.
6477
Note: unlike DO/PO, this change is not persisted so TestDPC needs to be
6578
marked as role holder again if the device reboots.
6679

67-
Android Studio import
68-
---------------------
80+
## Android Studio import
6981

7082
To import this repository in Android Studio, you need to use the
7183
[Bazel for Android Studio](https://plugins.jetbrains.com/plugin/9185-bazel-for-android-studio)
@@ -83,29 +95,32 @@ Select "Bazel Command" as Configuration type and add `//:testdpc` as
8395

8496
You can now run the project from inside Android Studio.
8597

86-
87-
Building with Bazel
88-
-------------------
98+
## Building with Bazel
8999

90100
The repository includes a `build.sh` script to build the application. The required
91101
[setupdesign library](https://android.googlesource.com/platform/external/setupdesign/+/refs/heads/main)
92102
is now imported and patched dynamically using the command line utility `ed`. This needs to be
93103
available on the path to successfully build the project.
94104

95-
Support
96-
-------
105+
### `ANDROID_HOME` environment setup
106+
107+
Bazel requires that you set the `ANDROID_HOME` environment variable to the path of your Android SDK.
108+
As an example, you can add to your `.bashrc` on linux:
109+
```
110+
export ANDROID_HOME=<Path to the Android SDK>
111+
```
112+
113+
## Support
97114
98115
If you've found an error in this sample, please file an issue:
99116
https://github.com/googlesamples/android-testdpc/issues
100117
101118
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.
102119
103-
License
104-
-------
120+
## License
105121
106122
Licensed under the Apache 2.0 license. See the LICENSE file for details.
107123
108-
How to make contributions?
109-
--------------------------
124+
## How to make contributions?
110125
111126
Please read and follow the steps in the CONTRIB file.

0 commit comments

Comments
 (0)