index.js 681 B

123456789101112131415161718192021
  1. const { execSync } = require('child_process');
  2. const path = require('path');
  3. const _getDevicesId = () => execSync(path.join(__dirname, './check.exe getDevicesId')).toString('utf-8').trim()
  4. const _regeditKey = (devicesId, code) => execSync(path.join(__dirname, `./check.exe regeditKey ${devicesId} ${code}`)).toString('utf-8').trim()
  5. const _validate = () => execSync(path.join(__dirname, './check.exe validate')).toString('utf-8').trim()
  6. const getDevicesId = () => _getDevicesId()
  7. const regeditKey = (devicesId, code) => _regeditKey(devicesId, code)
  8. const validate = () => _validate()
  9. module.exports = {
  10. getDevicesId,
  11. regeditKey,
  12. validate
  13. }