-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please provide an example COSU config XML file #40
Comments
This would be great to have. |
+1 |
1 similar comment
+1 |
Bit late to the party, but here's a rough xml I'm using to test this app with: cosu.xml: <!-- see app/src/main/java/com/afwsamples/testdpc/cosu/EnableCosuActivity.java startCosuMode() for the "mode" values -->
<cosu-config mode="default">
<hide-apps>
<app package-name="com.android.vending"/>
<app package-name="com.google.android.googlequicksearchbox"/>
<app package-name="com.sec.android.app.myfiles"/>
<app package-name="com.samsung.android.dialer"/>
<app package-name="com.android.settings"/>
</hide-apps>
<kiosk-apps>
<app package-name="org.fdroid.fdroid"/>
</kiosk-apps>
<download-apps>
<app package-name="org.fdroid.fdroid" download-location="https://f-droid.org/FDroid.apk"/>
</download-apps>
<policies>
<!-- for global settings, see https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setGlobalSetting(android.content.ComponentName,%20java.lang.String,%20java.lang.String) setGlobalSetting() -->
<global-setting name="adb_enabled" value="1"/>
<global-setting name="usb_mass_storage_enabled" value="0"/>
<global-setting name="stay_on_while_plugged_in" value="3"/> <!-- (BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB) == (1 | 2) == 3 -->
<!-- for user restrictions, see https://developer.android.com/reference/android/app/admin/DevicePolicyManager#addUserRestriction(android.content.ComponentName,%20java.lang.String) -->
<user-restriction name="no_fun"/>
<user-restriction name="no_config_wifi"/>
<user-restriction name="no_config_vpn"/>
<user-restriction name="no_config_mobile_networks"/>
<user-restriction name="no_airplane_mode"/>
<user-restriction name="no_uninstall_apps"/>
<disable-screen-capture value="true"/>
<disable-camera value="true"/>
<disable-status-bar value="false"/>
<disable-keyguard value="false"/>
</policies>
</cosu-config> And while I'm at it, these two files to generate a QR code for the device setup: qr.json: {
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "gJD2YwtOiWJHkSMkkIfLRlj-quNqG1fb6v100QmzM9w=",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://testdpc-latest-apk.appspot.com",
"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {"cosu-demo-config-location": "https://example.com/cosu.xml"}
} make_qr.sh: #!/bin/bash
#uploads cosu.xml to x0.at, replaces example link in qr.json and displays it as a QR code
XMLURL=$(tidy -xml --hide-comments 1 ./cosu.xml | curl -X POST -F 'file=@-;filename=.xml' https://x0.at/)
sed "s,https://example.com/cosu.xml,$XMLURL," < qr.json | tee /dev/stderr | qrencode -o qr.png && xdg-open qr.png |
I am trying to use cosu.xml config however no config in cosu.xml has effect. How to debug? |
@thinhdd13 Probably something wrong with your urls? |
Can we set the locationMode and "defaultPermissionPolicy" in cosu.xml file? If yes can you example. |
@thinhdd13 Not implemented in the cosu config iirc, but it should be pretty trivial to code that in |
where to add wifi settings in this file |
The xml doesn't do anything with wifi, but you can add the following values to the provisioning json:
See the docs for the "security types" and other info about those. The wifi configured there should persist after the provisioning is finished. |
@pfmaggi I could probably rejigger my comments into a PR quite easily, if that's roughly good enough as an example(?) |
CosuConfig.java
looks great but it's rather difficult to reverse engineer an XML file for it to parse. Can you please provide one?The text was updated successfully, but these errors were encountered: