UNPKG

@dderevjanik/termux-api

Version:

This library allows you to interact with your Android device from Node.js using termux-api

24 lines (23 loc) 773 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fingerprint = fingerprint; const child_process_1 = require("child_process"); /** * Use fingerprint sensor on device to check for authentication. */ async function fingerprint() { return new Promise((resolve, reject) => { const command = `termux-fingerprint`; (0, child_process_1.exec)(command, (error, stdout, stderr) => { if (error) { return reject(`Error: ${error.message}`); } if (stderr) { return reject(`Error: ${stderr}`); } const output = stdout.trim(); const authResult = JSON.parse(output); return resolve(authResult); }); }); }