Feature: Add menu to set screen strategy for remote control

This commit is contained in:
yuanyuanxiang
2026-01-08 22:10:38 +01:00
parent e0239dce8d
commit 808371ed6e
31 changed files with 541 additions and 425 deletions

View File

@@ -37,12 +37,21 @@ std::string GetMasterId()
std::string GetHMAC(int offset)
{
const Validation * v= (Validation*)(g_MasterID + offset);
std::string hmac = v->Checksum;
if (hmac.empty())
std::string hmac(v->Checksum, 16);
if (hmac.c_str()[0] == 0)
hmac = THIS_CFG.GetStr("settings", "HMAC");
return hmac;
}
void SetHMAC(const std::string str, int offset) {
Validation* v = (Validation*)(g_MasterID + offset);
std::string hmac(v->Checksum, 16);
if (hmac.c_str()[0] == 0) {
memcpy(v->Checksum, str.c_str(), min(16, str.length()));
THIS_CFG.SetStr("settings", "HMAC", str);
}
}
extern "C" void shrink64to32(const char* input64, char* output32); // output32 必须至少 33 字节
extern "C" void shrink32to4(const char* input32, char* output4); // output4 必须至少 5 字节