Copied from Android Open Source Project's ApiDemos app. This app demonstrates obtaining and using Device Admin privileges on an Android Device. Upon obtaining device administrator access (which requires user approval), apps can perform sensitive operations such as setting device security policies or wiping all apps and data stored on the device. Malicious Android apps have abused device administrator access in the past; for example, Lookout describes a ransomware family of apps called ScarePakage, Palo Alto Networks identified a family of Android malicious apps called Xbot.
This app can easily be opened and built in Android Studio.