Commit b8f38739 authored by lyong's avatar lyong

fix:取消授权时候功能处理错误

parent d40b899d
...@@ -232,18 +232,13 @@ function getTempHum() { ...@@ -232,18 +232,13 @@ function getTempHum() {
} }
function writeLic(hexStr) { function writeLic(hexStr) {
var filePath = "/tmp/test_license.txt";
// inner_sn_data.bin
// operation_license
// sn_data.bin
var filePath1 = "/tmp/operation_license"; var filePath1 = "/tmp/operation_license";
var filePath2 = "/tmp/sn_data.bin"; // var filePath2 = "/tmp/sn_data.bin";
const SECURE_APP_PATH = "/mnt/app/eOpteeCtrl" const SECURE_APP_PATH = "/mnt/app/eOpteeCtrl"
console.log('Full license written:' + hexStr); console.log('Full license written:' + hexStr);
var hexLen = hexStr.length; var hexLen = hexStr.length;
// console.log("Writing data: " + hexStr + " to " + filePath);
var result = uart.writeData(hexStr, hexLen, filePath1); var result = uart.writeData(hexStr, hexLen, filePath1);
if (result == 1) { if (result == 1) {
console.log("Data written successfully."); console.log("Data written successfully.");
...@@ -252,25 +247,10 @@ function writeLic(hexStr) { ...@@ -252,25 +247,10 @@ function writeLic(hexStr) {
} }
system("sync"); system("sync");
system(SECURE_APP_PATH + " -b " + filePath1); system(SECURE_APP_PATH + " -b " + filePath1);
var result = uart.writeData(hexStr, hexLen, filePath2);
if (result == 1) {
console.log("Data written successfully.");
} else {
console.log("Failed to write data.");
}
system("sync");
system(SECURE_APP_PATH + " -b " + filePath2);
// console.log('Full license asciiText:' + asciiText);
// handleSNDataBinFile.writeLicenseToBinFile(asciiText)
// handleSNDataBinFile.writeSNDataToBinFile(asciiText)
// system("echo " + asciiText + " > /tmp/test_license.txt")
// handleSNDataBinFile.writeInnerSNDataToBinFile(lic) // handleSNDataBinFile.writeInnerSNDataToBinFile(lic)
system("cp /tmp/operation_license /mnt/userdataA/files/"); system("cp /tmp/operation_license /mnt/userdataA/files/");
system("/mnt/app/eMideaSetMac"); system("/mnt/app/eMideaSetMac");
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment