Manager authority control and program protection method and system based on Framework layer of intelligent POS system

By integrating a guardian module and a three-factor authentication mechanism into the Framework layer of the smart POS system, the problems of application-layer access control being easily bypassed and insufficient protection of critical programs are solved, an unbypassable security barrier is built, and the security and management controllability of the POS system are improved.

CN121881328APending Publication Date: 2026-04-17AITIWEIER ELECTRONICS TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing smart POS systems suffer from several problems, including easily bypassed application-layer access control, lack of effective protection for critical programs, weak access verification mechanisms, the ability to uninstall system protection measures, and a lack of dedicated protection for POS scenarios, resulting in insufficient security and management control.

Method used

A guardian module is integrated into the Framework layer of the smart POS system. It monitors access requests to protected resources through Intent interception and process monitoring, triggers the administrator authentication interface to perform three-factor authentication (fingerprint verification, static password verification, and dynamic password verification), and prevents bypass through reflection interception mechanism and system-level service registration, thus building an unremovable security barrier.

Benefits of technology

It achieves unobstructed interception and protection of critical resources and operations, improves the security and management control of the POS system, significantly defends against brute-force attacks, privilege bypasses and malicious program attacks, and provides a flexible emergency protection mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121881328A_ABST
    Figure CN121881328A_ABST
Patent Text Reader

Abstract

The invention discloses an administrator authority control and program protection method and system based on a Framework layer of an intelligent POS system, and aims at solving the technical problems that in an existing intelligent POS system, an administrator authority verification mechanism is weak, and key programs cannot be effectively protected. According to the method, a guard module is deeply integrated in a Framework layer, a POS exclusive operation interception rule base is constructed, and safety protection of system-level operation and protected applications is achieved. When an access request for a protected resource is detected, a system forcibly triggers an administrator authentication interface rendered by a Framework layer, and only an authorized user can execute key operation through a three-factor collaborative authentication mechanism of fingerprint verification, static password verification and dynamic password verification. According to the invention, the authority control is improved from an application layer to a Framework layer, a security barrier which cannot be easily bypassed by an upper application is constructed, and the security and management controllability of the intelligent POS system are greatly enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart POS security technology, and in particular to a method and system for administrator permission control and program protection based on the Android system Framework layer. Background Technology

[0002] As a core device for modern commercial transactions, smart POS machines not only process payments but also integrate multiple functions such as inventory management, membership marketing, and data analysis. Their internal operating system (usually a customized Android system) contains the merchant's POS application, as well as built-in settings tools, file managers, and possibly even third-party applications. This openness brings convenience but also significant security risks.

[0003] The following technical problems exist in the existing technology:

[0004] 1. Application-layer permission control is easily bypassed: Traditional smart POS systems primarily manage permissions at the application layer, implementing permission control through AndroidManifest declarations and runtime permission requests. However, the application-layer permission control mechanism has significant flaws: malicious applications can bypass permission checks through reflection, dynamic code loading, or by exploiting system vulnerabilities; ordinary users can modify application permission configurations through ADB debugging, third-party tools, etc.; application-layer protection measures cannot prevent system-level operations, such as uninstalling applications or modifying network configurations through system settings.

[0005] 2. Lack of effective protection for critical programs: Critical programs in smart POS systems, such as system settings, payment core, and storage management, often lack effective access control mechanisms. Unauthorized personnel (such as ordinary store clerks or customers) may cause merchants economic losses and reputational damage through simple operations: accessing system settings to modify network configurations; uninstalling important POS software; installing malicious programs; and exporting sensitive transaction data through file managers.

[0006] 3. Weak access control mechanisms: Existing smart POS systems typically use a single password verification or a simple PIN code verification. This verification method has several security vulnerabilities: the password may be observed by others or obtained through social engineering; the lack of multi-factor authentication makes it impossible to effectively verify the operator's identity; there is no brute-force attack prevention mechanism, allowing attackers to try the password multiple times; and the verification interface may be simulated or overwritten by malicious applications, leading to password leakage.

[0007] 4. System protection measures can be uninstalled: Even if some smart POS systems have security protection applications installed, these applications still run at the application layer and can be uninstalled by users or malicious programs. Once the protection applications are removed, the system will be completely unprotected, and all security measures will be rendered ineffective.

[0008] 5. Lack of dedicated protection for POS scenarios: General Android security solutions cannot fully consider the special business scenarios of smart POS, such as protection of the payment core process, access control of transaction data, and protection of settlement account parameters, which leads to specific security threats to the POS system.

[0009] Therefore, there is an urgent need for a technical solution that can achieve unbypassable access control at the core level of the operating system, provide dedicated protection for smart POS business scenarios, and adopt a multi-factor collaborative authentication mechanism to ensure the security and management controllability of smart POS systems. Summary of the Invention

[0010] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for administrator permission control and program protection based on the framework layer of an intelligent POS system. By embedding permission control logic into the core framework of the operating system, it achieves non-bypass interception and protection of critical resources and operations, ensuring that only operations authorized by the administrator can be executed, thereby solving the aforementioned problems existing in the prior art.

[0011] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0012] A method for administrator access control and program protection based on the framework layer of a smart POS system includes the following steps:

[0013] S1. Integrate a guardian module into the Framework layer of the smart POS system. The guardian module builds a POS-specific operation interception rule base and monitors access requests to protected resources through Intent interception and process monitoring.

[0014] S2. When an access request to a protected resource is detected, the guardian module forcibly triggers the administrator authentication interface rendered by the Framework layer.

[0015] S3. Perform three-factor collaborative authentication through the administrator authentication interface, including fingerprint verification, static password verification, and dynamic password verification;

[0016] S4. The guardian module allows access requests only after all three-factor authentications are passed; otherwise, it blocks the operation.

[0017] The guardian module is registered as a system-level non-uninstallable service at the Framework layer, and uses a reflection interception mechanism to prevent external applications from obtaining the core methods within the module through reflection.

[0018] Preferably, in step S1, the guardian module registers a process monitoring hook at the Framework layer through ActivityManagerService to scan the system process list in real time, and triggers administrator authentication when any of the following conditions are detected:

[0019] Scenario 1: An external application attempts to modify payment parameters by carrying a custom action via an Intent;

[0020] Scenario 2: An unauthorized process reads memory data from the payment core process;

[0021] Scenario 3: Accessing the protected system settings module.

[0022] Preferably, the reflection interception mechanism is implemented as follows:

[0023] During initialization, the daemon module prevents external applications from accessing its core methods via reflection by using the ClassLoader's setAccessible(false) method. Interception logic is injected into the Framework layer to trigger a system-level exception and forcibly terminate the calling process when an application attempts to access the daemon module's private methods or modify static variables within the module.

[0024] Preferably, in step S3, the specific process of three-factor collaborative authentication is as follows:

[0025] S31, the user first performs fingerprint verification, and if the fingerprint verification fails, the number of static password attempts is reduced from 5 to 3;

[0026] S32, After fingerprint verification is successful, the user enters a static password for verification. The static password is stored using PBKDF2-HMAC-SHA256 salted hashing.

[0027] S33. After the static password verification is successful, the remote server generates a dynamic password with a validity period of 30 seconds based on a one-time password algorithm that uses a pre-shared key and time synchronization, and sends it to the client via HTTPS.

[0028] S34: Within the validity period, the user enters a dynamic password, and the server verifies it using the device's SN number, motherboard serial number, and chip serial number.

[0029] Preferably, the three-factor collaborative authentication also includes the following protection mechanisms:

[0030] 3a. If fingerprint verification fails 3 times in a row, the system will lock the static password input function and trigger a device alarm.

[0031] 3b. If the dynamic password is entered incorrectly twice in a row, the system will temporarily freeze the dynamic password request function. It can only be unfrozen after passing both fingerprint verification and static password verification.

[0032] 3c. If the static password fails 5 times in a row, the account will be locked and an additional unlock password will be required.

[0033] Preferably, the static password verification uses the AES-256-GCM algorithm to encrypt and store the shared key, and the user password is salted and hashed using PBKDF2-HMAC-SHA256, using random salt values ​​and a high number of iterations to enhance the resistance to brute-force attacks.

[0034] Preferably, the protected resources include: the system settings module, payment core process, transaction data file, configuration file of the smart POS system, and the Settings operation module to be protected; the Settings operation module to be protected is hidden or trimmed and integrated into a unified activity interface, and administrator authentication is required before opening the interface.

[0035] An administrator access control and program protection system based on the intelligent POS system Framework layer includes:

[0036] The guardian module, integrated into the Framework layer of the smart POS system, builds a POS-specific operation interception rule base and monitors access requests to protected resources through Intent interception and process monitoring. The guardian module is registered as a system-level non-removable service and set to persistent=true.

[0037] The administrator authentication interface, rendered by the Framework layer, is used for access control of critical system resources and operations, and supports three-factor collaborative authentication of fingerprint verification, static password verification, and dynamic password verification.

[0038] The reflection interception module prevents external applications from accessing the core methods within the guardian module via reflection through the ClassLoader's setAccessible(false) method, and injects interception logic into the Framework layer;

[0039] The remote authentication server generates dynamic passwords using a time-synchronized one-time password algorithm based on a pre-shared key, and verifies them using the device's SN number, motherboard serial number, and chip serial number.

[0040] Preferably, the administrator authentication interface further includes:

[0041] The fingerprint verification unit is used to collect and verify the user's fingerprint, and adjusts the number of static password attempts when fingerprint verification fails;

[0042] The static password verification unit uses PBKDF2-HMAC-SHA256 to perform salted hash storage and verification of user passwords;

[0043] The dynamic password verification unit receives a dynamic password with a validity period of 30 seconds sent by a remote server and verifies it within the validity period.

[0044] Lock the protection unit, monitor the number of failures of each factor, and trigger the corresponding locking and alarm mechanisms.

[0045] Preferably, the guardian module is registered in the ServiceManager as a System Service in the Framework layer and marked as persistent=true. When the application attempts to uninstall the guardian module via the pm uninstall command or stop the service via ActivityManager, the system verifies the operation permission and refuses to execute.

[0046] The beneficial effects of this invention are:

[0047] Building an Unbypassable Security Barrier: By embedding access control logic into the Android system's Framework layer, this invention leverages the Framework layer's core position in the system architecture to construct a security barrier that cannot be easily bypassed by upper-layer applications. The Framework layer, located between the application layer and the Linux kernel layer, is a core component of the Android system; any operation at the application layer must ultimately be executed through the Framework layer. Therefore, access control implemented at the Framework layer has a natural priority advantage, allowing for interception and verification before requests reach the system core.

[0048] Dedicated Protection for POS Scenarios: This invention addresses the core business scenarios of smart POS systems by building a dedicated POS operation interception rule library at the Framework layer. Through a dual mechanism of Intent interception and process monitoring, it achieves accurate identification and blocking of critical operations related to payment, data, and configuration. This differentiated design far surpasses the general protection solutions for ordinary Android devices, effectively protecting against security threats unique to POS systems, such as payment parameter tampering, transaction data leakage, and settlement account modification.

[0049] Multi-factor collaborative authentication enhances security: The multi-factor authentication (fingerprint + static password + dynamic password) of this invention is not a simple superposition, but rather a collaborative protection chain formed through the state linkage between factors. Fingerprint verification serves as a pre-entry threshold, static password as a basic guarantee, and dynamic password as real-time protection; each factor mutually restricts and complements the others. In particular, the design of binding the dynamic password to device hardware information (SN number, motherboard serial number, chip serial number) effectively prevents password theft or use on other devices, significantly improving authentication security.

[0050] Dual protection mechanisms prevent bypass: This invention constructs a dual anti-bypass protection system through reflection interception and system-level service registration. The reflection interception mechanism prevents external applications from reflecting on the core methods of the guardian module using the `setAccessible(false)` method of `ClassLoader`, and embeds interception logic at the Framework layer to monitor reflection behavior. The system-level service registration mechanism registers the guardian module as a System Service with `persistent=true`, making it impossible to uninstall or stop. This dual protection ensures that the guardian module's runtime logic cannot be tampered with or uninstalled.

[0051] Flexible emergency protection mechanism: This invention features a robust emergency coordination logic. When any authentication factor malfunctions, the system can activate an emergency authentication scheme to ensure uninterrupted core operations while maintaining security. For example, when the fingerprint sensor fails, the system requires both a static password and a dynamic password to be entered simultaneously, along with answering preset security questions. When the network is interrupted and the dynamic password cannot be obtained, the user must complete authentication through a combination of fingerprint verification, static password verification, and physical button presses.

[0052] Significantly improves protection success rate: Through the combined effects of deep protection at the Framework layer, POS-specific operation interception, hardware-bound dynamic passwords, and multi-factor collaborative authentication, this invention significantly improves the protection success rate compared to traditional application-layer protection schemes in actual tests. It can effectively defend against various security threats such as brute-force attacks, permission bypassing, and malicious program attacks, and greatly enhance the transaction security of smart POS systems. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the system architecture of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0055] The present invention provides a method for administrator access control and program protection based on the intelligent POS system Framework layer, comprising the following steps:

[0056] S1. A guardian module is integrated into the Framework layer of the intelligent POS system. The guardian module constructs a POS-specific operation interception rule base and monitors access requests to protected resources through Intent interception and process monitoring.

[0057] S2. When an access request to a protected resource is detected, the guardian module forcibly triggers the administrator authentication interface rendered by the Framework layer;

[0058] S3. Perform three-factor authentication through the administrator authentication interface, including fingerprint verification, static password verification, and dynamic password verification;

[0059] S4. The guardian module allows access requests only after all three-factor authentications are passed; otherwise, it blocks the operation.

[0060] The guardian module is registered as a system-level non-uninstallable service at the Framework layer, and uses a reflection interception mechanism to prevent external applications from obtaining the core methods within the module through reflection.

[0061] Furthermore, in step S1, the guardian module registers a process monitoring hook in the Framework layer through ActivityManagerService to scan the system process list in real time. When any of the following situations are detected, the administrator authentication is triggered: (1) an external application attempts to modify payment parameters by carrying a custom action through an Intent; (2) an unauthorized process reads the memory data of the payment core process; (3) accesses the protected system settings module.

[0062] Furthermore, the reflection interception mechanism is implemented as follows: during initialization, the guardian module uses the ClassLoader's setAccessible(false) method to prevent external applications from obtaining core methods within the guardian module through reflection; interception logic is implanted in the Framework layer, and when an application is detected attempting to obtain a private method of the guardian module or modify a static variable within the module, a system-level exception is triggered and the calling process is forcibly terminated.

[0063] Further, in step S3, the specific process of three-factor collaborative authentication is as follows: (1) The user first performs fingerprint verification. If the fingerprint verification fails, the number of static password attempts is reduced from 5 to 3; (2) After the fingerprint verification is successful, the user enters the static password for verification. The static password is stored using PBKDF2-HMAC-SHA256 with added salt hash; (3) After the static password verification is successful, the remote server generates a dynamic password with a validity period of 30 seconds based on a one-time password algorithm that uses a pre-shared key and is synchronized with the time, and sends it to the client via HTTPS; (4) The user enters the dynamic password within the validity period, and the server verifies it using the device's SN number, motherboard serial number, and chip serial number.

[0064] Furthermore, the three-factor collaborative authentication also includes the following protection mechanisms: (1) If fingerprint verification fails 3 times in a row, the system locks the static password input function and triggers a device alarm; (2) If the dynamic password is entered incorrectly 2 times in a row, the system temporarily freezes the dynamic password request function, which can only be unfrozen after passing the dual verification of fingerprint verification and static password verification; (3) If the static password fails 5 times in a row, the account is locked and an additional unlock password needs to be entered.

[0065] Furthermore, the static password verification uses the AES-256-GCM algorithm to encrypt and store the shared key, and the user password is salted and hashed using PBKDF2-HMAC-SHA256, using random salt values ​​and a high number of iterations to enhance the resistance to brute-force attacks.

[0066] Furthermore, the protected resources include: the system settings module, payment core process, transaction data file, configuration file of the smart POS system, and the Settings operation module to be protected; the Settings operation module to be protected is hidden or trimmed and integrated into a unified activity interface, and administrator authentication is required before opening the interface.

[0067] Figure 1 This is a schematic diagram of the system architecture of the present invention, showing the integration location of the guardian module in the Framework layer and its interaction with various components.

[0068] The present invention will now be described in detail with reference to specific embodiments.

[0069] Example 1: Integration of daemon modules based on the Framework layer

[0070] This embodiment details the integration method and working mechanism of the guardian module in the Android system Framework layer.

[0071] 1. Framework Layer Integration Architecture

[0072] The Android system adopts a layered architecture, from bottom to top: Linux kernel layer, Hardware Abstraction Layer (HAL), Android runtime and native C / C++ libraries, Framework layer (Java API framework), and application layer. The daemon module of this invention is integrated in the Framework layer, specifically located at:

[0073] • Create a SecurityGuardService directory under frameworks / base / services / core / java / com / android / server /

[0074] The core class of the guardian module, SecurityGuardService.java, is implemented in this directory.

[0075] Register and start the SecurityGuardService in SystemServer.java.

[0076] 2. Registration and initialization of the daemon module

[0077] The daemon module is registered to the Framework layer as a System Service. The specific implementation code is as follows:

[0078] / / Add the following to the startOtherServices() method in SystemServer.java

[0079] private void startSecurityGuardService() {

[0080] try {

[0081] SecurityGuardService securityGuard = new SecurityGuardService(mSystemContext);

[0082] ServiceManager.addService("security_guard", securityGuard);

[0083] / / Services marked as persistent cannot be uninstalled by the system.

[0084] securityGuard.setPersistent(true);

[0085] Slog.i(TAG, "Security Guard Service started");

[0086] } catch (Throwable e) {

[0087] Slog.e(TAG, "Failure starting Security Guard Service", e);

[0088] }

[0089] }

[0090] The daemon module is registered as a system service using the ServiceManager.addService() method and marked as a persistent service using setPersistent(true). This ensures that:

[0091] • The guardian module starts automatically when the system starts.

[0092] • The guardian module has system-level permissions

[0093] • The application layer cannot be uninstalled using the `pm uninstall` command.

[0094] • The application layer cannot stop the service through ActivityManager.

[0095] 3. Construction of a POS-specific operation interception rule base

[0096] The guardian module builds a POS-specific operation interception rule base during initialization. This rule base contains the Intent actions, process names, and resource paths that need to be protected. The specific implementation is as follows:

[0097] public class SecurityGuardService extends ISecurityGuard.Stub {

[0098] private HashMap<String, ProtectionRule> mProtectionRules;

[0099] private void initProtectionRules() {

[0100] mProtectionRules = new HashMap<>();

[0101] / / Payment-related protection rules

[0102] mProtectionRules.put("payment.modify_rate", newProtectionRule(

[0103] "com.pos.payment.MODIFY_RATE", / / Intent Action

[0104] ProtectionLevel.CRITICAL, / / Protection Level

[0105] "Payment rate modification" / / Description ));

[0107] mProtectionRules.put("payment.modify_account", newProtectionRule(

[0108] "com.pos.payment.MODIFY_ACCOUNT",

[0109] Protection Level: Critical

[0110] "Settlement Account Modification" ));

[0112] / / System settings protection rules

[0113] mProtectionRules.put("settings.network", new ProtectionRule(

[0114] "android.settings.WIFI_SETTINGS",

[0115] Protection Level: HIGH

[0116] Network Settings ));

[0118] mProtectionRules.put("settings.app_management", newProtectionRule(

[0119] "android.settings.APPLICATION_SETTINGS",

[0120] Protection Level: HIGH

[0121] Application Management ));

[0123] / / Data access protection rules

[0124] mProtectionRules.put("data.transaction", new ProtectionRule(

[0125] " / data / pos / transaction / ", / / File path

[0126] Protection Level: Critical

[0127] "Transaction Data" ));

[0129] mProtectionRules.put("data.config", new ProtectionRule(

[0130] " / data / pos / config / ",

[0131] Protection Level: HIGH

[0132] "Configuration file" ));

[0134] / / Process protection rules

[0135] mProtectionRules.put("process.payment_core", newProtectionRule(

[0136] "com.unionpay.payment", / / Process name

[0137] Protection Level: Critical

[0138] UnionPay Payment Core Process ));

[0140] }

[0141] }

[0142] Each protection rule includes:

[0143] • Rule identifier: Used for fast searching and matching

[0144] • Intent action, file path, or process name: used to identify the protected resource

[0145] Protection levels: Divided into four levels: CRITICAL, HIGH, MEDIUM, and LOW.

[0146] • Description information: Used for logging and user prompts.

[0147] 4. Implementation of the Intent interception mechanism

[0148] The guardian module intercepts Intents by hooking the `startActivity()` method of `ActivityManagerService`. The specific implementation is as follows:

[0149] / / Add interception logic in ActivityManagerService.java

[0150] public int startActivity(..., Intent intent, ...) {

[0151] / / Call SecurityGuardService to check Intent

[0152] ISecurityGuard securityGuard = ISecurityGuard.Stub.asInterface(

[0153] ServiceManager.getService("security_guard"));

[0154] if (securityGuard != null) {

[0155] boolean needAuth = securityGuard.checkIntentPermission(intent, callingUid);

[0156] if (needAuth) {

[0157] / / Trigger administrator authentication interface

[0158] securityGuard.showAuthenticationDialog(intent,callingUid);

[0159] return ActivityManager.START_ABORTED;

[0160] }

[0161] }

[0162] / / Existing startActivity logic ...

[0164] }

[0165] Implement the checkIntentPermission() method in SecurityGuardService:

[0166] public boolean checkIntentPermission(Intent intent, int callingUid) {

[0167] String action = intent.getAction();

[0168] / / Check if the Intent action is in the protection rules

[0169] for (ProtectionRule rule : mProtectionRules.values()) {

[0170] if (rule.matchIntent(action)) {

[0171] / / Check if the caller has been authenticated

[0172] if (!isAuthenticated(callingUid)) {

[0173] Slog.w(TAG, "Blocked protected intent: " + action +

[0174] " from uid: " + callingUid);

[0175] return true; / / Authentication required

[0176] }

[0177] }

[0178] }

[0179] return false; / / No authentication required

[0180] }

[0181] 5. Implementation of process monitoring mechanism

[0182] The guardian module registers process monitoring hooks through ActivityManagerService at the Framework layer to scan the system process list in real time and detect suspicious behavior. The specific implementation is as follows:

[0183] public class SecurityGuardService extends ISecurityGuard.Stub {

[0184] private ProcessMonitor mProcessMonitor;

[0185] private void startProcessMonitor() {

[0186] mProcessMonitor = new ProcessMonitor(mContext);

[0187] mProcessMonitor.start();

[0188] }

[0189] private class ProcessMonitor extends Thread {

[0190] private static final int SCAN_INTERVAL = 1000; / / Scans once per second

[0191] @Override

[0192] public void run() {

[0193] while (!isInterrupted()) {

[0194] try {

[0195] scanProcesses();

[0196] Thread.sleep(SCAN_INTERVAL);

[0197] } catch (InterruptedException e) {

[0198] break;

[0199] }

[0200] }

[0201] }

[0202] private void scanProcesses() {

[0203] ActivityManager am = (ActivityManager)mContext.getSystemService(

[0204] Context.ACTIVITY_SERVICE);

[0205] List <runningappprocessinfo>processes =am.getRunningAppProcesses();

[0206] for (RunningAppProcessInfo process : processes) {

[0207] / / Check if any unauthorized processes are attempting to access the payment core process

[0208] if (isProtectedProcess(process.processName)) {

[0209] checkProcessAccess(process);

[0210] }

[0211] }

[0212] }

[0213] private void checkProcessAccess(RunningAppProcessInfoprocess) {

[0214] / / Check if the process is attempting to read the memory of the payment core process.

[0215] / / Analyze memory mappings using the / proc / [pid] / maps file

[0216] try {

[0217] String mapsFile = " / proc / " + process.pid + " / maps";

[0218] BufferedReader reader = new BufferedReader(newFileReader(mapsFile));

[0219] String line;

[0220] while ((line = reader.readLine()) != null) {

[0221] / / Check if the memory region of the payment core process is mapped.

[0222] if (line.contains("com.unionpay.payment")) {

[0223] / / Suspicious behavior detected, authentication triggered

[0224] Slog.w(TAG, "Detected suspicious memoryaccess: " +

[0225] process.processName);

[0226] showAuthenticationDialog(null, process.uid);

[0227] break

[0228] }

[0229] }

[0230] reader.close();

[0231] } catch (IOException e) {

[0232] Slog.e(TAG, "Error reading process maps", e);

[0233] }

[0234] }

[0235] }

[0236] }

[0237] Example 2: Reflection Interception and Anti-Bypass Mechanism

[0238] This embodiment details the reflection interception mechanism and bypass protection measures of the guardian module.

[0239] 1. Implementation of the reflection interception mechanism

[0240] To prevent external applications from bypassing the guardian module via reflection, this invention employs the following reflection interception strategy:

[0241] public class SecurityGuardService extends ISecurityGuard.Stub {

[0242] / / Set reflection protection during initialization

[0243] private void setupReflectionProtection() {

[0244] try {

[0245] / / Get all methods of this class

[0246] Method[] methods = SecurityGuardService.class.getDeclaredMethods();

[0247] for (Method method : methods) {

[0248] / / Set reflection access restrictions for core methods

[0249] if (isCriticalMethod(method.getName())) {

[0250] method.setAccessible(false);

[0251] }

[0252] }

[0253] / / Get all fields of this class

[0254] Field[] fields = SecurityGuardService.class.getDeclaredFields();

[0255] for (Field field : fields) {

[0256] / / Set reflection access restrictions for sensitive fields

[0257] if (isSensitiveField(field.getName())) {

[0258] field.setAccessible(false);

[0259] }

[0260] }

[0261] Slog.i(TAG, "Reflection protection enabled");

[0262] } catch (Exception e) {

[0263] Slog.e(TAG, "Failed to setup reflection protection", e);

[0264] }

[0265] }

[0266] private boolean isCriticalMethod(String methodName) {

[0267] return methodName.equals("verifyAdmin") ||

[0268] methodName.equals("interceptIntent") ||

[0269] methodName.equals("grantAccess") ||

[0270] methodName.equals("setAuthenticationResult");

[0271] }

[0272] private boolean isSensitiveField(String fieldName) {

[0273] return fieldName.equals("mProtectionRules") ||

[0274] fieldName.equals("mAuthenticatedUids") ||

[0275] fieldName.equals("mEncryptionKey");

[0276] }

[0277] }

[0278] 2. Implantation of Framework Layer Interception Logic

[0279] Insert interception logic at the Framework layer to monitor and block reflection calls to the daemon module:

[0280] / / Add interception logic to Method.java

[0281] public Object invoke(Object obj, Object... args) throws ... {

[0282] / / Check if the target of the call is SecurityGuardService

[0283] if (obj instanceof SecurityGuardService) {

[0284] / / Check the caller's identity

[0285] int callingUid = Binder.getCallingUid();

[0286] / / Only system processes (uid=1000) are allowed to call this.

[0287] if (callingUid != Process.SYSTEM_UID) {

[0288] / / Log security events

[0289] Slog.e("SecurityGuard", "Blocked reflection attempt fromuid: " +

[0290] callingUid + ", method: " + getName());

[0291] / / Triggering a system-level exception

[0292] throw new SecurityException(

[0293] "Reflection access to SecurityGuardService isforbidden");

[0294] }

[0295] }

[0296] / / Existing invoke logic

[0297] return invokeNative(obj, args, declaringClass, parameterTypes, returnType,

[0298] slot, flag);

[0299] }

[0300] Similarly, add similar interception logic in Field.java:

[0301] / / Add interception logic to Field.java

[0302] public Object get(Object obj) throws ... {

[0303] / / Check if the access target is a SecurityGuardService field

[0304] if (obj instanceof SecurityGuardService) {

[0305] int callingUid = Binder.getCallingUid();

[0306] if (callingUid != Process.SYSTEM_UID) {

[0307] Slog.e("SecurityGuard", "Blocked field access attempt from uid: " +

[0308] callingUid + ", field: " + getName());

[0309] throw new SecurityException(

[0310] "Field access to SecurityGuardService is forbidden");

[0311] }

[0312] }

[0313] return getNative(obj, declaringClass, type, slot, flag);

[0314] }

[0315] 3. Process forced termination mechanism

[0316] The calling process will be terminated immediately upon detection of malicious reflection or tampering.

[0317] private void terminateMaliciousProcess(int uid, String reason) {

[0318] ActivityManager am = (ActivityManager) mContext.getSystemService(

[0319] Context.ACTIVITY_SERVICE);

[0320] / / Log security events

[0321] Slog.e(TAG, "Terminating malicious process - UID: " + uid +

[0322] ", Reason: " + reason);

[0323] / / Terminate process

[0324] am.forceStopPackage(getPackageNameFromUid(uid));

[0325] / / Mark this application as malicious

[0326] markAsMalicious(uid);

[0327] / / Send alarm notification

[0328] sendSecurityAlert("Malicious behavior detected",

[0329] "The application attempted to bypass security protection and has been terminated by the system."

[0330] }

[0331] 4. Protection of system-level service registration

[0332] By registering the daemon module as a persistent service in SystemServer, we ensure that it cannot be uninstalled.

[0333] / / In SystemServer.java

[0334] private void startSecurityGuardService() {

[0335] try {

[0336] SecurityGuardService securityGuard = new SecurityGuardService(mSystemContext);

[0337] ServiceManager.addService("security_guard", securityGuard);

[0338] / / Set as persistent service

[0339] securityGuard.setPersistent(true);

[0340] / / Listen for service stop events

[0341] securityGuard.setServiceDeathCallback(newIBinder.DeathRecipient() {

[0342] @Override

[0343] public void binderDied() {

[0344] / / Restart immediately if service stops unexpectedly.

[0345] Slog.w(TAG, "Security Guard Service died unexpectedly, restarting...");

[0346] startSecurityGuardService();

[0347] }

[0348] });

[0349] Slog.i(TAG, "Security Guard Service started as persistentservice");

[0350] } catch (Throwable e) {

[0351] Slog.e(TAG, "Failure starting Security Guard Service", e);

[0352] }

[0353] }

[0354] Add uninstallation interception logic to PackageManagerService:

[0355] / / Add to PackageManagerService.java

[0356] public void deletePackage(String packageName, ...) {

[0357] / / Check if any critical system services are being uninstalled.

[0358] if (isSystemCriticalService(packageName)) {

[0359] throw new SecurityException(

[0360] "Cannot uninstall system critical service: " +packageName);

[0361] }

[0362] / / Existing deletion logic ...

[0364] }

[0365] private boolean isSystemCriticalService(String packageName) {

[0366] / / Check if it is the package containing SecurityGuardService

[0367] return packageName.equals("android") ||

[0368] packageName.equals("com.android.systemui");

[0369] }

[0370] Example 3: Administrator Authentication Interface and Three-Factor Collaborative Authentication

[0371] This embodiment details the implementation of the administrator authentication interface and the three-factor collaborative authentication mechanism.

[0372] 1. Design and implementation of the administrator authentication interface

[0373] The administrator authentication interface is rendered directly by the Framework layer, using a system-level window (TYPE_SYSTEM_ALERT) to ensure it cannot be overwritten or simulated by upper-layer applications.

[0374] public class AuthenticationDialog extends Dialog {

[0375] private Context mContext;

[0376] private FingerprintManager mFingerprintManager;

[0377] private EditText mStaticPasswordInput;

[0378] private EditText mDynamicPasswordInput;

[0379] private Button mVerifyButton;

[0380] private TextView mStatusText;

[0381] private AuthenticationCallback mCallback;

[0382] private int mStaticPasswordAttempts = 5;

[0383] private int mDynamicPasswordAttempts = 2;

[0384] private boolean mFingerprintVerified = false;

[0385] private boolean mStaticPasswordVerified = false;

[0386] public AuthenticationDialog(Context context) {

[0387] super(context, android.R.style.Theme_DeviceDefault_Dialog_Alert);

[0388] mContext = context)

[0389] / / Set as a system-level dialog box, cannot be overridden

[0390] Window window = getWindow();

[0391] window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);

[0392] window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|

[0393] WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);

[0394] setCancelable(false); / / Cannot be cancelled

[0395] setCanceledOnTouchOutside(false); / / Do not close the window when the outside is touched.

[0396] initUI();

[0397] }

[0398] private void initUI() {

[0399] setContentView(R.layout.authentication_dialog);

[0400] mStaticPasswordInput = findViewById(R.id.static_password);

[0401] mDynamicPasswordInput = findViewById(R.id.dynamic_password);

[0402] mVerifyButton = findViewById(R.id.verify_button);

[0403] mStatusText = findViewById(R.id.status_text);

[0404] / / Password input is disabled initially; fingerprint verification is required first.

[0405] mStaticPasswordInput.setEnabled(false);

[0406] mDynamicPasswordInput.setEnabled(false);

[0407] / / Enable fingerprint verification

[0408] startFingerprintVerification();

[0409] mVerifyButton.setOnClickListener(new View.OnClickListener() {

[0410] @Override

[0411] public void onClick(View v) {

[0412] verifyPasswords();

[0413] }

[0414] });

[0415] }

[0416] / / Fingerprint verification

[0417] private void startFingerprintVerification() {

[0418] mStatusText.setText("Please verify fingerprint");

[0419] mFingerprintManager = (FingerprintManager)mContext.getSystemService(

[0420] Context.FINGERPRINT_SERVICE);

[0421] if (mFingerprintManager == null || !mFingerprintManager.isHardwareDetected()) {

[0422] / / Fingerprint hardware unavailable, entering emergency mode

[0423] handleFingerprintUnavailable();

[0424] return;

[0425] }

[0426] CancellationSignal cancellationSignal = newCancellationSignal();

[0427] mFingerprintManager.authenticate(

[0428] null,

[0429] cancellationSignal

[0430] 0,

[0431] new FingerprintManager.AuthenticationCallback() {

[0432] @Override

[0433] public void onAuthenticationSucceeded(

[0434] FingerprintManager.AuthenticationResultresult) {

[0435] mFingerprintVerified = true;

[0436] mStatusText.setText("Fingerprint verification successful, please enter your static password");

[0437] / / Enable static password input

[0438] mStaticPasswordInput.setEnabled(true);

[0439] mStaticPasswordInput.requestFocus();

[0440] }

[0441] @Override

[0442] public void onAuthenticationFailed() {

[0443] mStatusText.setText("Fingerprint verification failed, please try again");

[0444] / / Reduce the number of static password attempts

[0445] if (mStaticPasswordAttempts > 3) {

[0446] mStaticPasswordAttempts = 3;

[0447] }

[0448] / / Record the number of failures

[0449] handleFingerprintFailure();

[0450] }

[0451] @Override

[0452] public void onAuthenticationError(int errorCode,CharSequence errString) {

[0453] mStatusText.setText("Fingerprint verification error: " +errString);

[0454] handleFingerprintError(errorCode);

[0455] }

[0456] },

[0457] null);

[0458] }

[0459] Fingerprint verification failed.

[0460] private void handleFingerprintFailure() {

[0461] int failureCount = incrementFingerprintFailureCount();

[0462] if (failureCount >= 3) {

[0463] / / After 3 consecutive failures, the static password input will be locked.

[0464] mStaticPasswordInput.setEnabled(false);

[0465] mStatusText.setText("Too many fingerprint verification failures, account locked for 24 hours");

[0466] / / Trigger device alarm

[0467] triggerDeviceAlert();

[0468] / / Send administrator notification

[0469] sendAdminAlert("Fingerprint verification failed",

[0470] "Multiple fingerprint verification failures detected; device locked."

[0471] / / Unlocked in 24 hours

[0472] scheduleLockRelease(24 * 60 * 60 * 1000);

[0473] }

[0474] }

[0475] / / Fingerprint processing hardware unavailable

[0476] private void handleFingerprintUnavailable() {

[0477] mStatusText.setText("Fingerprint sensor unavailable, please enter static and dynamic passwords");

[0478] / / Enable password input

[0479] mStaticPasswordInput.setEnabled(true);

[0480] mDynamicPasswordInput.setEnabled(true);

[0481] / / Reduce the number of attempts

[0482] mStaticPasswordAttempts = 2;

[0483] / / Requires additional security issues

[0484] showSecurityQuestion();

[0485] }

[0486] }

[0487] 2. Static password verification mechanism

[0488] Static passwords are stored using the PBKDF2-HMAC-SHA256 algorithm with added salt and hashing.

[0489] 3. Dynamic password verification mechanism

[0490] Dynamic passwords are implemented based on a time-synchronized one-time password algorithm (TOTP) and are bound to device hardware information.

[0491] 4. The complete process of three-factor collaborative certification

[0492] Implement a complete three-factor authentication process in AuthenticationDialog:

[0493] / / The complete password verification process

[0494] private void verifyPasswords() {

[0495] / / Step 1: Check if the fingerprint has been verified

[0496] if (!mFingerprintVerified) {

[0497] mStatusText.setText("Please complete fingerprint verification first");

[0498] return;

[0499] }

[0500] Step 2: Verify the static password

[0501] String staticPassword = mStaticPasswordInput.getText().toString();

[0502] if (staticPassword.isEmpty()) {

[0503] mStatusText.setText("Please enter your static password");

[0504] return;

[0505] }

[0506] boolean staticVerified = verifyStaticPassword(staticPassword);

[0507] if (!staticVerified) {

[0508] mStaticPasswordAttempts--;

[0509] if (mStaticPasswordAttempts <= 0) {

[0510] / / Static password attempts exhausted

[0511] mStatusText.setText("Too many incorrect attempts with static password, account locked");

[0512] lockAccount();

[0513] return;

[0514] }

[0515] mStatusText.setText("Incorrect static password, " + mStaticPasswordAttempts + " chances remaining");

[0516] mStaticPasswordInput.setText("");

[0517] return;

[0518] }

[0519] mStaticPasswordVerified = true;

[0520] mStatusText.setText("Static password verification successful, retrieving dynamic password...");

[0521] Step 3: Request and verify the dynamic password

[0522] DynamicPasswordManager.requestOTP(new DynamicPasswordManager.OTPCallback() {

[0523] @Override

[0524] public void onSuccess(final String otp, final long expiresAt){

[0525] runOnUiThread(new Runnable() {

[0526] @Override

[0527] public void run() {

[0528] / / Display countdown

[0529] startCountdown(expiresAt);

[0530] Enable dynamic password input

[0531] mDynamicPasswordInput.setEnabled(true);

[0532] mDynamicPasswordInput.requestFocus();

[0533] mStatusText.setText("Please enter the dynamic password (valid for 30 seconds)");

[0534] / / Set the click event for the verification button

[0535] mVerifyButton.setOnClickListener(newView.OnClickListener() {

[0536] @Override

[0537] public void onClick(View v) {

[0538] verifyDynamicPassword(otp);

[0539] }

[0540] });

[0541] }

[0542] });

[0543] }

[0544] @Override

[0545] public void onError(final String error) {

[0546] runOnUiThread(new Runnable() {

[0547] @Override

[0548] public void run() {

[0549] mStatusText.setText("Failed to retrieve dynamic password: " + error);

[0550] / / If the network fails, activate emergency authentication.

[0551] if (error.contains("network") || error.contains("connection")) {

[0552] handleNetworkFailure();

[0553] }

[0554] }

[0555] });

[0556] }

[0557] });

[0558] }

[0559] / / Verify static password

[0560] private boolean verifyStaticPassword(String inputPassword) {

[0561] try {

[0562] / / Read encrypted password data from secure storage

[0563] byte[] encryptedData = readFromSecureStorage("admin_password");

[0564] byte[] decryptedData = StaticPasswordManager.decryptPasswordData(encryptedData);

[0565] / / Extract salt and hash

[0566] byte[] salt = new byte

[32] ;

[0567] byte[] storedHash = new byte[decryptedData.length - 32];

[0568] System.arraycopy(decryptedData, 0, salt, 0, 32);

[0569] System.arraycopy(decryptedData, 32, storedHash, 0,storedHash.length);

[0570] / / Verify password

[0571] return StaticPasswordManager.verifyPassword(inputPassword,storedHash, salt);

[0572] } catch (Exception e) {

[0573] Log.e("AuthDialog", "Static password verification failed",e);

[0574] return false;

[0575] }

[0576] }

[0577] / / Verify dynamic password

[0578] private void verifyDynamicPassword(String serverOTP) {

[0579] String inputOTP = mDynamicPasswordInput.getText().toString();

[0580] if (inputOTP.isEmpty()) {

[0581] mStatusText.setText("Please enter the dynamic password");

[0582] return;

[0583] }

[0584] if (inputOTP.equals(serverOTP)) {

[0585] / / All three-factor authentications passed

[0586] mStatusText.setText("Authentication successful");

[0587] / / Authorized access

[0588] grantAccess();

[0589] / / Close dialog box

[0590] dismiss();

[0591] } else {

[0592] mDynamicPasswordAttempts--;

[0593] if (mDynamicPasswordAttempts <= 0) {

[0594] / / Too many incorrect dynamic password attempts, freezing function.

[0595] mStatusText.setText("Dynamic password failed too many times, feature is frozen");

[0596] freezeDynamicPassword();

[0597] } else {

[0598] mStatusText.setText("Dynamic password error, " + mDynamicPasswordAttempts + " chances remaining");

[0599] mDynamicPasswordInput.setText("");

[0600] }

[0601] }

[0602] }

[0603] / / Freeze dynamic password function

[0604] private void freezeDynamicPassword() {

[0605] mDynamicPasswordInput.setEnabled(false);

[0606] mVerifyButton.setEnabled(false);

[0607] mStatusText.setText("Fingerprint and static password verification must be completed again before the account can be unfrozen");

[0608] / / Reset authentication status

[0609] mFingerprintVerified = false;

[0610] mStaticPasswordVerified = false;

[0611] mStaticPasswordAttempts = 5;

[0612] mDynamicPasswordAttempts = 2;

[0613] / / Requires re-authentication

[0614] startFingerprintVerification();

[0615] }

[0616] / / Emergency authentication for handling network failures

[0617] private void handleNetworkFailure() {

[0618] new AlertDialog.Builder(mContext)

[0619] .setTitle("Network failure")

[0620] .setMessage("Unable to retrieve dynamic password, enable emergency authentication?")

[0621] .setPositiveButton("Enable", newDialogInterface.OnClickListener() {

[0622] @Override

[0623] public void onClick(DialogInterface dialog, int which) {

[0624] startEmergencyAuth();

[0625] }

[0626] })

[0627] .setNegativeButton("Cancel", null)

[0628] .show();

[0629] }

[0630] / / Start emergency authentication

[0631] private void startEmergencyAuth() {

[0632] / / Physical button confirmation required

[0633] mStatusText.setText("Please press and hold the administrator-only button on your device for 3 seconds");

[0634] / / Listen to physical buttons

[0635] registerPhysicalKeyListener(new PhysicalKeyCallback() {

[0636] @Override

[0637] public void onKeyLongPress() {

[0638] mStatusText.setText("Physical button confirmation successful. Please answer the security question.");

[0639] showSecurityQuestion();

[0640] }

[0641] });

[0642] }

[0643] / / Display security issues

[0644] private void showSecurityQuestion() {

[0645] final EditText input = new EditText(mContext);

[0646] input.setInputType(InputType.TYPE_CLASS_NUMBER);

[0647] new AlertDialog.Builder(mContext)

[0648] .setTitle("Security Issue")

[0649] .setMessage("Please enter the last 4 digits of the merchant's registered mobile number")

[0650] .setView(input)

[0651] .setPositiveButton("Confirm", newDialogInterface.OnClickListener() {

[0652] @Override

[0653] public void onClick(DialogInterface dialog, int which) {

[0654] String answer = input.getText().toString();

[0655] if (verifySecurityQuestion(answer)) {

[0656] mStatusText.setText("Emergency authentication successful");

[0657] grantAccess();

[0658] dismiss();

[0659] } else {

[0660] mStatusText.setText("Incorrect answer to security question");

[0661] }

[0662] }

[0663] })

[0664] .show();

[0665] }

[0666] Example 4: Configuration and Access Control of Protected Resources

[0667] This embodiment details how to configure protected resources and how to control access to these resources.

[0668] 1. Protection of the Settings module

[0669] Hide or remove the Settings modules that need protection and integrate them into a unified management interface.

[0670] 2. Protection of core payment processes

[0671] Special protection is provided for the core payment process to prevent unauthorized access.

[0672] 3. File system access control

[0673] Implement access control for sensitive directories and files.

[0674] Example 5: Complete System Workflow

[0675] This embodiment demonstrates the workflow of the system through a complete scenario.

[0676] Scenario: A store clerk attempts to modify the network settings of the POS system.

[0677] Step 1: The store clerk clicks the settings icon.

[0678] The store clerk clicks the "Settings" icon on the main interface of the POS system, and the system launches the Settings application.

[0679] Step 2: The store clerk locates the network settings.

[0680] The clerk looked for the "Network Settings" option in the Settings interface, but found that the option was hidden and only an "Administrator Settings" option was visible.

[0681] Step 3: The store clerk clicks on the administrator settings.

[0682] The store clerk clicks "Administrator Settings," and the Settings application requests administrator authentication via SecurityGuardService.

[0683] Step 4: The Framework layer intercepts and triggers the authentication interface.

[0684] When SecurityGuardService receives an authentication request, it creates and displays the authentication interface rendered by the Framework layer.

[0685] Step 5: Fingerprint Verification

[0686] The authentication interface first requires the store clerk to verify their fingerprint. Since the clerk is not an administrator, the fingerprint verification fails.

[0687] Step 6: Equipment Alarm

[0688] The system detected three consecutive failed fingerprint verifications and triggered a device alarm.

[0689] Step 7: Account Lockout

[0690] The system has locked the authentication attempt and will automatically unlock it after 24 hours.

[0691] Scene Summary

[0692] In this scenario, the system successfully prevented the store clerk from gaining unauthorized access to network settings.

[0693] 1. Sensitive options in the Settings app are hidden and can only be accessed through the "Admin Settings" entry point.

[0694] 2. The SecurityGuardService in the Framework layer intercepts the access request and forcibly triggers the authentication interface.

[0695] 3. The authentication interface is rendered by the Framework layer, and store clerks cannot bypass it by overriding or simulating it.

[0696] 4. After fingerprint verification fails, the system automatically reduces the number of static password attempts.

[0697] 5. Three consecutive failed fingerprint verifications trigger device alarms and account lockout.

[0698] 6. The system sends security alerts to the administrator to ensure that the administrator is aware of security incidents in a timely manner.

[0699] This complete security chain ensures that critical settings of the POS system can only be accessed by authorized administrators, effectively preventing unauthorized operations from both inside and outside the system.

[0700] Example 6: Emergency Scenario Handling

[0701] This example illustrates how the system activates an emergency authentication mechanism when a certain authentication factor becomes unavailable.

[0702] Scenario: Emergency authentication when the fingerprint sensor malfunctions

[0703] When a hardware failure occurs in the fingerprint sensor, the system initiates an emergency authentication process.

[0704] Scenario: Offline authentication during network interruption

[0705] When the network is interrupted and a dynamic password cannot be obtained, the system uses emergency authentication via physical key presses and security questions.

[0706] The method and system for administrator permission control and program protection based on the framework layer of the intelligent POS system provided by this invention can be widely used in fields such as intelligent POS machines, intelligent cash register terminals, and mobile payment devices, and has good industrial applicability.

[0707] Through deep integration of the Framework layer, POS-specific operation interception, multi-factor collaborative authentication, and dual anti-bypass mechanisms, this invention can effectively protect smart POS systems from various security threats, safeguard merchants' core business data and transaction security, and has broad application prospects and significant commercial value.

[0708] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.< / runningappprocessinfo>

Claims

1. A method for administrator access control and program protection based on the Framework layer of an intelligent POS system, characterized in that, Includes the following steps: S1. Integrate a guardian module into the Framework layer of the smart POS system. The guardian module builds a POS-specific operation interception rule base and monitors access requests to protected resources through Intent interception and process monitoring. S2. When an access request to a protected resource is detected, the guardian module forcibly triggers the administrator authentication interface rendered by the Framework layer. S3. Perform three-factor collaborative authentication through the administrator authentication interface, including fingerprint verification, static password verification, and dynamic password verification; S4. The guardian module allows access requests only after all three-factor authentications are passed; otherwise, it blocks the operation. The guardian module is registered as a system-level non-uninstallable service at the Framework layer, and uses a reflection interception mechanism to prevent external applications from obtaining the core methods within the module through reflection.

2. The administrator access control and program protection method according to claim 1, characterized in that, In step S1, the guardian module registers a process monitoring hook at the Framework layer through ActivityManagerService to scan the system process list in real time. When any of the following conditions are detected, administrator authentication is triggered: Scenario 1: An external application attempts to modify payment parameters by carrying a custom action via an Intent; Scenario 2: An unauthorized process reads memory data from the payment core process; Scenario 3: Accessing the protected system settings module.

3. The administrator access control and program protection method according to claim 1, characterized in that, The reflection interception mechanism is implemented as follows: During initialization, the daemon module prevents external applications from accessing its core methods via reflection by using the ClassLoader's setAccessible(false) method. Interception logic is injected into the Framework layer to trigger a system-level exception and forcibly terminate the calling process when an application attempts to access the daemon module's private methods or modify static variables within the module.

4. The administrator access control and program protection method according to claim 1, characterized in that, In step S3, the specific process of three-factor collaborative authentication is as follows: S31, the user first performs fingerprint verification, and if the fingerprint verification fails, the number of static password attempts is reduced from 5 to 3; S32, After fingerprint verification is successful, the user enters a static password for verification. The static password is stored using PBKDF2-HMAC-SHA256 salted hashing. S33. After the static password verification is successful, the remote server generates a dynamic password with a validity period of 30 seconds based on a one-time password algorithm that uses a pre-shared key and time synchronization, and sends it to the client via HTTPS. S34: Within the validity period, the user enters a dynamic password, and the server verifies it using the device's SN number, motherboard serial number, and chip serial number.

5. The administrator access control and program protection method according to claim 4, characterized in that, The three-factor collaborative authentication also includes the following protection mechanisms: 3a. If fingerprint verification fails 3 times in a row, the system will lock the static password input function and trigger a device alarm. 3b. If the dynamic password is entered incorrectly twice in a row, the system will temporarily freeze the dynamic password request function. It can only be unfrozen after passing both fingerprint verification and static password verification. 3c. If the static password fails 5 times in a row, the account will be locked and an additional unlock password will be required.

6. The administrator access control and program protection method according to claim 4, characterized in that, The static password verification uses the AES-256-GCM algorithm to encrypt and store the shared key, and the user password is salted and hashed using PBKDF2-HMAC-SHA256, using random salt values ​​and a high number of iterations to enhance the resistance to brute-force attacks.

7. The administrator access control and program protection method according to claim 1, characterized in that, The protected resources include: the system settings module, payment core process, transaction data file, configuration file of the smart POS system, and the Settings operation module that needs to be protected; the Settings operation module that needs to be protected is hidden or cut off and integrated into a unified activity interface, and administrator authentication is required before opening the interface.

8. A system for administrator access control and program protection based on the framework layer of an intelligent POS system, characterized in that, include: The guardian module, integrated into the Framework layer of the smart POS system, builds a POS-specific operation interception rule base and monitors access requests to protected resources through Intent interception and process monitoring. The guardian module is registered as a system-level non-removable service and set to persistent=true. The administrator authentication interface, rendered by the Framework layer, is used for access control of critical system resources and operations, and supports three-factor collaborative authentication of fingerprint verification, static password verification, and dynamic password verification. The reflection interception module prevents external applications from accessing the core methods within the guardian module via reflection through the ClassLoader's setAccessible(false) method, and injects interception logic into the Framework layer; The remote authentication server generates dynamic passwords using a time-synchronized one-time password algorithm based on a pre-shared key, and verifies them using the device's SN number, motherboard serial number, and chip serial number.

9. The administrator access control and program protection system according to claim 8, characterized in that, The administrator authentication interface also includes: The fingerprint verification unit is used to collect and verify the user's fingerprint, and adjusts the number of static password attempts when fingerprint verification fails; The static password verification unit uses PBKDF2-HMAC-SHA256 to perform salted hash storage and verification of user passwords; The dynamic password verification unit receives a dynamic password with a validity period of 30 seconds sent by a remote server and verifies it within the validity period. Lock the protection unit, monitor the number of failures of each factor, and trigger the corresponding locking and alarm mechanisms.

10. The administrator access control and program protection system according to claim 8, characterized in that, The guardian module is registered in the ServiceManager as a System Service in the Framework layer and marked as persistent=true. When the application attempts to uninstall the guardian module via the pm uninstall command or stop the service via ActivityManager, the system verifies the operation permissions and refuses to execute.