how to apply pattern lock on my all apps of my device? - java

i designed a pattern view using this library
'''implementation 'com.andrognito.patternlockview:patternlockview:1.0.0''''
but how to apply pattern lock on all apps on my android device? how to show my pattern app screen when pattern apply on any app in android device? Thanks in advance.

As I already wrote in my comment. what you want to do is not possible. You can modify the behavior of your own application, but not the one of others.
The main reason is security issues. Imagine you have an app that mimics a log-in screen from BankXY, and displays this screen right before your actual BankXY app log-in screen is displayed. This is called phishing, and is one of the most popular attacking scenarios out there. What you would like to implement would not be a security risk, but the tools to make it possible certainly are.
EDIT:
This was possible before Android 8.0, where the ability of using Services for background executions was significantly limited. It was possible to create a Service that would check the package names of running applications and in case this name is on a black-list, request a pin code for example (See this Question). However, you cannot run background Services for an infinite amount of time anymore.

Related

Single application custom Android ROM

I find this question a couple places on the web, but never with a good answer. Let me be specific in the questions asked.
I want to build a custom Android ROM which only features one app. This app is not to interact with any hardware (per now). This app will be launched on the start up of the device. No locked-screen. The device will have to restart if the app malfunctions.
A resource told me that you can change the launcher app of the ROM.
-> Does this mean that the home screen, the one which displays all apps on our phones, is merely another app? If so, can you simply change the launcher app as it is stated here? What were to happen if this app fails?
If this is the case, it would solve the entire issue.
If not, how do you go about making this sort of project? It includes
Making an app on AOSP
Refuse users to leave the app or interact with anything else
Making this app part of the boot-up process
Remove locked screen
Make the app a dependency of the OS (to force shutdown if malfunction)
Thanks in advance for any replies
I just found Android have a topic about dedicated devices (formerly called corporate-owned single-use, or COSU) are a subset of company-owned devices that serve a specific purpose. maybe that can meet your requirement.
BTW, After into the sub-topic lock task mode that mentions about set DPC whitelist APPs and the device policy controller (DPC) needs setup by other steps.... FYR~

how to create a background process , it will disable the physical volume buttons when running

My boss ask me to develop an app which have to be always on the user screen. I have to disable the three Android native buttons (back, home and history buttons).
How can I do that ? Create a custom launcher ?
Thanks.
In general you can't really do the things you mentioned above, at least there are no official supported APIs.
However, there can be legitimate use cases where one would benefit from this kind of applications, and Android provides something for this.
Have a look into Lock Task Mode and ScreenPinning.

How to monitor the highlighted text(or selected text) from other opened APPs in Android

In Java we can get the highlighted text from native window by using JNA or JNI. For example we could use
Monitor text that is highlighted
Is there any way to do the same thing by using Android SDK??
You are welcome to use the accessibility APIs to write an accessibility service and watch for text selection events. This will require the user to agree to allow your app to spy on all user input, which will tend to make your app less popular.
Otherwise, this is not possible, for obvious privacy and security reasons.
Using purely the SDK without exploiting a security vulnerability is not possible.
There is a simple explanation of why this is not possible.
The first reason is the way Android apps are executed in the OS in a sandboxed way using linux's user groups and permission system.
Every running process and Application on Android has it's own user and group and permissions to access those resources only. So in a way they cannot communicate with other apps(or capture what a user is highlithing at the moment.
The only way for an app to communicate with other is using the binder IPC, which has to pass through the activity manager first. As far as my knowledge goes, there is not a defined way to do this. Notice this is a layer of protections inherited from linux below Android's usual permission system.
Adding to this, starting from Android 5(lollipop) add to this layer the now enforced selinux policies, which do not allow the application domain to access other domains that handle graphics, the mediaserver, and some others, I will not enter more in this topic due to it's complexity and relevance to the question, just know that these are some very secure mechanisms that prevent actions that might imply a security breach.
Is it possible? Yes, however it involes exploiting a vulnerability, but this is another topic and for that I should recommend to search papers on the web that talk about vulnerabilities in android.

Custom Lock Screen Implementation Techniques

So, I have been exploring many similar questions across website (this, this and this and many more). People wanting to implement their own custom lock screen (not talking about widgets). So far there have been two implementation techniques which users are using.
Home Screen Replacement. In this technique its suggested to create a home screen application, where after unlock logic the default screen shows up. I believe that in this situation developer has to disable Home, Search, Menu and Back button when the lock screen is visible and to implement the Screen off-on logic.
An application. In this technique a normal app is made where after unlock logic the default screen shows up. I believe that in this situation developer has to disable Home, Search, Menu and Back button when the lock screen is visible and to implement the Screen off-on logic.
Now, I don't understand that what is the difference between two approaches? StackOverflow community seems to stress more on the home screen replacement technique. I am very new to Android development so I might be missing some aspect about it. Please suggest that which approach should I use and why? (also, which is easy?).
Thanks so much!
I would use the first method, but only for usability reasons. Because it gives the user a choice to easily revert back to the original homescreen/lockscreen if he chooses not to make the new one a default choice yet.
I'm afraid both strategies you described are quite difficult (depending on the api level range you want it to work on). The difficulty is not in their difference, the difficulty is in overriding the buttons (as Google makes it more difficult by closing down security loopholes for the newer api levels).
PS: Please note that Jellybean has a new Daydream functionality. If customizing the lockscreen is all you need. That may be the way to go since Jellybean is much more secure in that respect and more difficult to work with than the previous api levels otherwise.
Also, consider using the HTC screenlock api for HTC devices. This way, your solution won't be too hacky at least for their newer devices. And perhaps, do a version for rooted devices as well, since that too should be easy, for users who already have obtained root on their device. Don't discount the rooted market, users with root access do spend a disproportionate amount of money on applications in Google Play. That much is obvious if you just take a look at some of the rough numbers of downloads for paid applications that say (for root only) that Google Play gives you.

Making an Android application that cannot be uninstalled/deleted

I want to make a security app for Android phones. Basically, I don't want anyone to be able to un-install it without having to enter a specific password first.
Also, is there a way to prevent the app from being stopped manually (like being closed via. Taskmanager) etc?
This sounds more akin to Malware-like behaviour than that of a regular Android application, anyway:
For a regular Android application, I'd imagine that making it 'uninstallable' is near enough impossible to achieve - try to contemplate what the state of the Android app market would be like right now if this were possible!
On the other hand, if privileged control (root access) was available then this might be a possibility - an example of that could be like how wireless carriers implement bundled software. However, like I mentioned, there is no regular avenue available for applications released via. the Android market to achieve what you've asked, it should be pretty clear to you why...

Categories