[FREE] ๐Ÿ”’ Auth Extension- Check if Passcode lock is enabled on a device

Auth

[FREE] :free_button: :hammer_and_wrench: Auth

Check whether device lock credentials are configured before triggering authentication flows.

Open store


:clipboard: Extension specifications

Package in.sarthakdev.auth
Version 2.0
Price Free
Category Tools
Updated 18 September 2026
Platforms MIT App Inventor, Kodular, Niotron, Android Builder, Thunkable
Built using FAST
Store Auth Extension - Tools Extension for MIT App Inventor, Kodular, Niotron | SarthakDev.in

:open_book: About

One-shot check for whether the device has a lock screen (PIN, pattern, or password) set.

:sparkles: Features

  • Instant check for passcode lock availability
  • Events for both locked and unlocked states
  • Works with PIN, pattern, fingerprint, and face unlock
  • Designed to pair with Activity Starter authentication flows
  • Loop prevention guidance to stop back-button bypass
  • Lightweight integration tested on Android 10 and above
  • Includes changelog and usage policy guidance

:puzzle_piece: Blocks

Auth blocks

:bell: Events

Passcode Lock Enabled

Triggered when passcode lock is enabled.

PasscodeLockEnabled

Passcode Lock Disabled

Triggered when no passcode lock is set.

PasscodeLockDisabled

:wrench: Methods

Check Passcode Lock

Checks if the passcode lock is enabled on the device.

CheckPasscodeLock


:shopping_cart: Get the AIX

Download the AIX from the store, then import from Projects โ†’ Import extension.


Built by Sarthak Gupta ยท hi@sarthakdev.in ยท sarthakdev.in

4 Likes

Could do with a success event

1 Like

This block returns true or false instantly then you can use your blocks... nice suggestion will surely update in version 2... hope the community can test and give feedback on this extension
Ps please comment your device name and if its working in your device

@TIMAI2 But this extension solves that passcode lock issue, right?

It tests if a lock code is in place. Works in companion on Android 12 and 14.

What I was suggesting is a success return event, so that if the code entered is correct, the user can then proceed into the app, because the user can back out of the authentication dialog.

1 Like

Yes user can back out, but you can use below steps to overcome,

when user skip the authentication we will receive empty ActivityStarter event,
In such cases we can use IF_ELSE block and start the ActivityStarter again and again which will be loop until correct password is entered.

1 Like

I didn't get a response for AfterActivity, one way or another...though does change a label to blank...

1 Like

Yes thats what I thought activity starter can call an event but I don't think that this can be used to detect if password was entered or not
PS I am working to implement it in the extension

Just looked into my project,
@TIMAI2 sorry for wrong steps,

It's not AfterActivity it's ActivityCancelled event.
Below corrected blocks:

ProjectFile:
applock.aia (1.9 KB)

Yep, I get that, but nothing comes back, for me, in "result"

1 Like

Yes it returns empty,

It will trigger AfterActivity event only after successful passcode lock,

So we can use isEmpty or equalToBlank like blocks and verify it

Why is not a number shown that increments when someone dowloads the file

Only for URLs it will be shown,
Not for files

1 Like

Changelog
Version 1.1
Hello Everyone,
This update offers ease in implementing the blocks inside your project
As suggested by @TIMAI2 the update adds three blocks instead of just one

Function

component_method (5)
This procedure is to be called to get the status of Passcode lock in your device

Events


This event is called when Passcode lock is setup on the device


This event is called when Passcode lock is not setup on the device

Note: Passcode lock refers to any type of lock- Pin/Pattern/Fingerprint/Face etc.

Download link updated above!

Not what I suggested at all.

It should be possible to return a success value to an event (instead of an empty result using activityStarter.

(Toasts are used here instead of an event)

1 Like


Spent a while creating this code snippet.
So what it does
When button is clicked it checks if the device has a passcode lock

If passcode is enabled

The app asks for the device credentials. Now the most important question, what happens if the user clicks the back button or the recent apps button. The activity fails and the activity is called again. kind of like a loop. So the user won't be able to login until the password is entered.
When the password is entered correctly the block in the after activity is executed and the label is changed to success. You can change it and execute any other block obviously

If passcode is disabled

If passcode is disabled then the notifier will show an alert that Lock Disabled

@TIMAI2 I didn't implement that in the extension as it was possible to do it via blocks instead
Please post your feedback on this

@TIMAI2 does it work as expected?

I am not finding this. If there is no lock screen set on the device, this also returns a "blank", for me, so it appears that an isKeyguardSecure() test (if not using the BiometricManager) is required.

1 Like

@TIMAI2 thats why I am using the Auth Extension to check if the device has a lock or not... so that this case is also handled

1 Like

Yes for that issue you can use this extension before you call Activity Starter

1 Like