Simple and beautiful Lock Screen library to set an check pin code.
Easily secure your app with Lock Screen library as easy as starting an intent.
Set Pin:
Check Pin:
Lock Screen gets a 4 digit pin code from user at first running time. After that every time that you start the intent, It asks for pin code.
Add EnterPinAbility.class to MainAbility
addActionRoute("action.transit", EnterPinAbility.class.getName());
And intent can be Started as
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ABILITY_NEW_MISSION);
Operation operation = new Intent.OperationBuilder()
.withBundleName("com.amirarcane.sample")
.withAbilityName("com.amirarcane.sample.MainAbility")
.withAction("action.transit")
.build();
intent.setOperation(operation);
startAbility(intent);
First it checks Pin was entered before or not if the pin was set then it will as for entering pin else it asks for setting pin. If need to set pin again Start the intent like below.
Intent intent = new EnterPinAbility().getIntent(MainAbilitySlice.this,SET_PIN);
intent.addFlags(Intent.FLAG_ABILITY_NEW_MISSION);
Operation operation = new Intent.OperationBuilder()
.withBundleName("com.amirarcane.sample")
.withAbilityName("com.amirarcane.sample.MainAbility")
.withAction("action.transit")
.build();
intent.setOperation(operation);
startAbility(intent);
SET_PIN is boolean make it true.
If font is needed to set for the library try below:
First: put the font in resources Example:put in path "\entry\src\main\resources\rawfile"
Second:Pass the name of the Font in FONT_TEXT and FONT_NUMBERS. Example:FONT_TEXT = "ALEAWB.TTF",FONT_NUMBER = "BLKCHCRY.TTF"
Intent intent = new EnterPinAbility().getIntent(MainAbilitySlice.this,FONT_TEXT,FONT_NUMBER);
intent.addFlags(Intent.FLAG_ABILITY_NEW_MISSION);
Operation operation = new Intent.OperationBuilder()
.withBundleName("com.amirarcane.sample")
.withAbilityName("com.amirarcane.sample.MainAbility")
.withAction("action.transit")
.build();
intent.setOperation(operation);
startAbility(intent);
If setting pin and setting font both are required then try below:
Intent intent = new EnterPinAbility().getIntent(MainAbilitySlice.this,SET_PIN,FONT_TEXT,FONT_NUMBER);
intent.addFlags(Intent.FLAG_ABILITY_NEW_MISSION);
Operation operation = new Intent.OperationBuilder()
.withBundleName("com.amirarcane.sample")
.withAbilityName("com.amirarcane.sample.MainAbility")
.withAction("action.transit")
.build();
intent.setOperation(operation);
startAbility(intent);
Method 1: Generate the .har package through the library and add the .har package to the libs folder. Add the following code to the entry gradle:
implementation fileTree (dir: 'libs', include: ['*.jar', '*.har'])
Method 2: In project level build.gradle:
allprojects{
repositories{
mavenCentral()
}
}
Add the following code to the entry gradle:
implementation 'io.openharmony.tpc.thirdlib:lock-screen:1.0.2'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型