I'm a college student who wants to create an app lock application. What are some ways to prevent other apps from turning on?

Asked 2 years ago, Updated 2 years ago, 36 views

I want to create an app lock application with the Android class term project.

If I try to turn on the apps that I set, I want to take the event and turn on the app that I made, but another appWhat are some ways to catch this light?

I'm a beginner who has just made a simple calculator for Android, but I want to study hard and make it.

android app-lock

2022-09-22 21:58

2 Answers

It's possible, but there are disadvantages.

Starting with Android 2.2, Device Admin API is supported, which allows you to use features that are a little 'strong'. It's literally an administrator/owner app for that device. Of course, when you install an app, you ask the user if they want to register it as an administrator app on the device (and other, already installed administrator apps (such as MDMs) can prevent you from installing new administrator apps).)

I can't give you a definite answer because I've never implemented the related function myself, but after looking at the APIs, I think it's possible to use [addPersistentPreferredActivity][2] (similar to the way the professor said).

Usually, apps have the following manifest, so if you register the activity of the Device Admin app created by filtering the int filter (LAUNCHER intent) as the default handler, you will be transferred to the activity of the app you created when various apps are executed.

<activity android:name="MainActivity">
    <!-- This activity is the main entry, should appear in app launcher -->
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Of course, to mention the aforementioned 'disadvantages',

If you filter all the intents out, you can intercept them in the middle more comprehensively, but I think it's going to get complicated and "dangerous. I recommend you to find out more about the API and test it.

[2]: http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#addPersistentPreferredActivity(android.content.ComponentName, android.content.IntentFilter, android.content.ComponentName)


2022-09-22 21:58

Unless the Android installed provides special support, it will be difficult for a specific app to have such strong authority without routing.

I think there will be some directions to solve the issue, such as routing and custom-rom production, but I don't think it'll be enough to make it a term project. Rather, it is easy to access certain characters in a way that the app organizes them, but I think it would be better to try something that can be useful to individuals.


2022-09-22 21:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.