Ver Fonte

Z991239-5255 #comment 去掉旧安装向导等

oilyang há 1 ano atrás
pai
commit
71d1be12eb

+ 0 - 8
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -193,7 +193,6 @@ void CHealthManagerFSM::s4_on_entry()
 {
 	m_fsmState = HM_FSM_STATE_IDLE;
 	LOG_FUNCTION();
-	m_accessAuthCheckMD5 = 0;
 	CSmartPointer<IEntityFunction> spEntityFunction = GetEntityBase()->GetFunction();
 	CSmartPointer<IConfigInfo> spConfig, spCerConfig;
 	ErrorCodeEnum eErrCer = spEntityFunction->OpenConfig(Config_CenterSetting, spCerConfig);
@@ -202,11 +201,9 @@ void CHealthManagerFSM::s4_on_entry()
 	}
 	else
 	{
-		spCerConfig->ReadConfigValueInt("AccessAuthorization", "CheckMD5", m_accessAuthCheckMD5);
 		m_NewStartPage = "";
 		spCerConfig->ReadConfigValue("NonExclusive", "NewStartPage", m_NewStartPage);
 	}
-	DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("before access auth,read MD5 flag:%d",m_accessAuthCheckMD5);
 }
 void CHealthManagerFSM::s4_on_exit()
 {
@@ -496,11 +493,6 @@ int CHealthManagerFSM::WaitDeamonFinish()
 			break;
 		//Sleep(5000);
 	}
-
-	/** 添加此操作以让状态机停留在s0状态 [Gifur@20211017]*/
-	if (mCofigMode) {
-		return 1;
-	}
 	return 0;
 }
 

+ 4 - 10
Module/mod_healthmanager/HealthManagerFSM.h

@@ -150,10 +150,10 @@ public:
 	CHealthManagerFSM():m_SysState("I"),m_pACClient(NULL)
 	, m_iAccessAuth(AccessAuth_Init)
 	, m_bIdleToMaintain(false), m_custMngerState(0), m_pDevCtrlClient(NULL), m_bHasAuthEver(false)
-	, m_checkCode(""), m_accessAuthCheckMD5(0), m_havReceiveMD5OK(0), m_bFirstAccessAuth(true)
+	, m_checkCode(""), m_bFirstAccessAuth(true)
 	, m_bIEBeforeHealth(false), m_hasCfgGpioInRootIni(false), m_csErrEntity(""), m_bInAccessAuthDoWork(false)
 	, m_bEntityNewStart(true), m_iDoNotUpdateWKDaily(0)
-	, m_wkUpdatePeriod(1), mCofigMode(false), m_bPinPadOpenSuc(false){}
+	, m_wkUpdatePeriod(1), m_bPinPadOpenSuc(false){}
 	~CHealthManagerFSM(){}
 	virtual ErrorCodeEnum OnInit();
 	virtual ErrorCodeEnum OnExit();
@@ -174,11 +174,6 @@ public:
 	void s11_on_exit();
 	unsigned int s11_on_event(FSMEvent* pEvt);
 
-	void SetConfigMode(bool inConfig = true) {
-		mCofigMode = inConfig;
-	}
-
-
 	ErrorCodeEnum Initial();
 
 	//该函数建议废弃
@@ -240,8 +235,8 @@ private:
 
 private:
 	CSimpleStringA m_SysState,m_checkCode,m_csErrEntity,m_NewStartPage;
-	int m_devCfgNum, m_AccessAuthTries, m_InitTries, m_fsmState, m_stateBeforeMaintain, m_custMngerState, m_preFsmState, m_accessAuthCheckMD5
-		,m_havReceiveMD5OK,m_iAccessAuth/*-1 未准入; 0 准入失败;1 准入成功*/, m_iDoNotUpdateWKDaily, m_wkUpdatePeriod/*if exceed the period time,we should update key*/;
+	int m_devCfgNum, m_AccessAuthTries, m_InitTries, m_fsmState, m_stateBeforeMaintain, m_custMngerState, m_preFsmState
+		,m_iAccessAuth/*-1 未准入; 0 准入失败;1 准入成功*/, m_iDoNotUpdateWKDaily, m_wkUpdatePeriod/*if exceed the period time,we should update key*/;
 	AccessAuthService_ClientBase *m_pACClient;
 	bool m_bIdleToMaintain, m_bHasAuthEver, m_bFirstAccessAuth
 		, m_bIEBeforeHealth, m_hasCfgGpioInRootIni, m_bInAccessAuthDoWork, m_bEntityNewStart, m_bPinPadOpenSuc;
@@ -250,7 +245,6 @@ private:
 	DeviceControlService_ClientBase *m_pDevCtrlClient;
 	CSystemStaticInfo m_sysInfo;
 	std::map<string, string> m_computerInfo;
-	bool mCofigMode;
 };
 
 struct WaitDeamonFinishTask : public ITaskSp

+ 0 - 164
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -1785,108 +1785,6 @@ void CHealthManagerEntity::ControlEntityLife(SpReqAnsContext<HealthManagerServic
 	ctx->Answer(result);
 }
 
-ErrorCodeEnum CHealthManagerEntity::GetTmpRootFilePath(CSimpleStringA& rootPath, CSimpleStringA& rootTmpPath, CSimpleStringA& rootBackPath)
-{
-	CSimpleStringA strRootCfgPath;
-	ErrorCodeEnum ec = GetFunction()->GetPath("HardwareCfg", strRootCfgPath);
-	rootPath = strRootCfgPath;
-	rootPath += SPLIT_SLASH_STR;
-	rootPath += "root.ini";
-
-	rootTmpPath = rootPath + ".tmp";
-
-
-	SYSTEMTIME curTime = CSmallDateTime::GetNow().ToSystemTime();
-	CSimpleStringA strBackupFileSuffix = CSimpleStringA::Format(".bak%04d%02d%02d%02d%02d%02d%03d",
-		curTime.wYear, curTime.wMonth, curTime.wDay, curTime.wHour, curTime.wMinute, curTime.wSecond, curTime.wMilliseconds);
-
-	rootBackPath = rootPath + strBackupFileSuffix;
-
-	return ec;
-}
-
-void CHealthManagerEntity::RecordInstallBeginTimeStamp(const CSimpleString& strTimeStamp, BOOL forceReset)
-{
-	if (!forceReset) {
-		/** 有时间戳记录的情况下不再覆盖记录 [Gifur@2023823]*/
-		CSimpleStringA strReserved(true);
-		const ErrorCodeEnum rc = GetInstallBeginTimeStamp(strReserved);
-		if (!strReserved.IsNullOrEmpty()) {
-			return;
-		}
-	}
-
-	CSmartPointer<IConfigInfo> pConfig;
-	GetFunction()->OpenConfig(Config_Cache, pConfig);
-    if (strTimeStamp.IsNullOrEmpty()) {
-        pConfig->WriteConfigValue("TerminalDeploy", "StartTimeStamp", CSimpleStringA::Format("0x%08X", (DWORD)CSmallDateTime::GetNow()));
-    } else {
-        pConfig->WriteConfigValue("TerminalDeploy", "StartTimeStamp", strTimeStamp);
-    }
-}
-
-ErrorCodeEnum CHealthManagerEntity::GetInstallBeginTimeStamp(CSimpleString& strTimeStamp)
-{
-	CSmartPointer<IConfigInfo> pConfig;
-	GetFunction()->OpenConfig(Config_Cache, pConfig);
-	CSimpleStringA strValue(true);
-	pConfig->ReadConfigValue("TerminalDeploy", "StartTimeStamp", strValue);
-	if (strValue.IsNullOrEmpty()) {
-		return Error_DataCheck;
-	}
-
-	strTimeStamp = strValue;
-	return Error_Succeed;
-
-}
-
-ErrorCodeEnum CHealthManagerEntity::GetGuidePageUrlWithStep(int whichStep, CSimpleStringA& strUrl)
-{
-	strUrl.Clear();
-	CSimpleStringA pagePath;
-	ErrorCodeEnum ec = GetFunction()->GetPath("Base", pagePath);
-	pagePath.Append(SPLIT_SLASH_STR "res" SPLIT_SLASH_STR "ManagerDesktop" SPLIT_SLASH_STR "guide.html");
-	if (whichStep > 0) {
-		CSimpleStringA terminalNo;
-		CSimpleStringA vendorType;
-		CSimpleStringA serverIP;
-		do {
-			CSmartPointer<IConfigInfo> pConfig;
-			GetFunction()->OpenConfig(Config_Cache, pConfig);
-			const ErrorCodeEnum ec0 = pConfig->ReadConfigValue("TerminalDeploy", "TerminalNo", terminalNo);
-			const ErrorCodeEnum ec1 = pConfig->ReadConfigValue("TerminalDeploy", "Manufacturer", vendorType);
-			const ErrorCodeEnum ec2 = pConfig->ReadConfigValue("TerminalDeploy", "ServerIP", serverIP);
-			Dbg("read step: %s, %s, %s", SpStrError(ec0), SpStrError(ec1), SpStrError(ec2));
-		} while (false);
-
-		pagePath = CSimpleStringA::Format("%s?page=%d", pagePath.GetData(), whichStep);
-		bool prefix(true);
-
-		if (!terminalNo.IsNullOrEmpty() || !vendorType.IsNullOrEmpty() || !serverIP.IsNullOrEmpty()) {
-
-			CSimpleStringA strSearch(true);
-			if (!terminalNo.IsNullOrEmpty()) {
-				if (prefix) strSearch += "&";
-				strSearch += CSimpleStringA("terminalno=") + terminalNo;
-				prefix = true;
-			}
-			if (!vendorType.IsNullOrEmpty()) {
-				if (prefix) strSearch += "&";
-				strSearch += CSimpleStringA("vendor=") + vendorType;
-				prefix = true;
-			}
-			if (!serverIP.IsNullOrEmpty()) {
-				if (prefix) strSearch += "&";
-				strSearch += CSimpleStringA("ip=") + serverIP;
-				prefix = true;
-			}
-			pagePath += strSearch;
-		}
-	}
-	strUrl = CSimpleStringA("file:///") + pagePath + CSimpleStringA("");
-	return ec;
-}
-
 namespace
 {
 
@@ -1915,37 +1813,6 @@ namespace
 	}
 }
 
-ErrorCodeEnum CHealthManagerEntity::TellChromiumOpenGuidePage(const CSimpleStringA& pageUrl)
-{
-	ErrorCodeEnum result(Error_Succeed);
-	auto pClient = new ChromiumSrv_ClientBase(this);
-	result = pClient->Connect();
-	if (result == Error_Succeed) {
-		ChromiumSrv_OpenBrowser_Req req;
-		ChromiumSrv_OpenBrowser_Ans ans;
-		req.mainUrl = pageUrl;
-		req.viceUrl = "";
-		req.type = "OutsideRequest";
-		req.name = "GuidePage";
-		req.exclusiveMode = true;
-		req.top = -1;
-
-		result = (*pClient)(EntityResource::getLink().upgradeLink())->OpenBrowser(req, ans, 10000);
-		if (result == Error_Succeed) {
-			Dbg("Request Chromium::OpenBrowser succ!");
-		}
-		else {
-			Dbg("Request Chromium::OpenBrowser  failed: %s", SpStrError(result));
-		}
-		pClient->GetFunction()->CloseSession();
-	}
-	else {
-		pClient->SafeDelete();
-		Dbg("Connect to Chromium entity failed: %s", SpStrError(result));
-	}
-	return result;
-}
-
 ErrorCodeEnum CHealthManagerEntity::DealSpecifiedEntity(DealType type, LPCTSTR lpcszEntityName, LPCTSTR lpcszCmdline, bool bForce, CSimpleStringA& strErrMsg)
 {
 	ErrorCodeEnum result(Error_Succeed);
@@ -2052,37 +1919,6 @@ bool CHealthManagerEntity::IsTestMode()
 	return !!flag;
 }
 
-bool CHealthManagerEntity::IsLackOfConfig(int& stepMode)
-{
-	stepMode = 0;
-	int lastRecordTime = 0;
-	CSystemRunInfo runInfo;
-	ErrorCodeEnum ec = GetFunction()->GetSystemRunInfo(runInfo);
-	if (ec != Error_Succeed) {
-		stepMode = ec;
-		Dbg("get framework info failed: %s", SpStrError(ec));
-		return false;
-	}
-	if (runInfo.eState == FrameworkState_NotConfig) {
-		Dbg("not config from framework");
-		stepMode = -1;
-		return true;
-	}
-	else {
-		CSmartPointer<IConfigInfo> pConfig;
-		GetFunction()->OpenConfig(Config_Cache, pConfig);
-		int stepStatus(0);
-		pConfig->ReadConfigValueInt("TerminalDeploy", "CurrStep", stepMode);
-		pConfig->ReadConfigValueInt("TerminalDeploy", "CurrState", stepStatus);
-		pConfig->ReadConfigValueInt("TerminalDeploy", "TimeStamp", lastRecordTime);
-
-		if (stepMode != DeployStep_Begin && DeployStep_Finished != stepMode) {
-			Dbg("not config from cache: step=%d, status=%d", stepMode, stepStatus);
-			return true;
-		}
-	}
-	return false;
-}
 void CHealthManagerEntity::OnEntityStateHook(const char* pszEntityName, const char* pszTriggerEntity, EntityStateEnum eState, EntityStateEnum eLastState)
 {
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s trigger by %s: from %s to %s", pszEntityName, pszTriggerEntity, SpStrEntityState(eLastState), SpStrEntityState(eState));

+ 2 - 30
Module/mod_healthmanager/mod_healthmanager.h

@@ -105,22 +105,8 @@ public:
 
 	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext) 
 	{
-        int curStep(0);
-#if defined(RVC_OS_LINUX)
-		bool isNeedConfig = IsLackOfConfig(curStep);
-        if (isNeedConfig) {
-            if (curStep == -1) { /** 无root.ini [Gifur@2022422]*/
-                CSimpleStringA strNow(true);
-                RecordInstallBeginTimeStamp(strNow);
-			}
-            m_fsm.SetConfigMode(true);
-		}
-#else
-		bool isNeedConfig(false);
-#endif
-
 		ErrorCodeEnum eErrCode = m_fsm.Init(this);
-		if (eErrCode == Error_Succeed && !isNeedConfig) {
+		if (eErrCode == Error_Succeed) {
             DoRestart();
 		}
 
@@ -254,12 +240,7 @@ public:
 		const char *pszValue, const char *pszOldValue, const char *pszEntityName);
 	virtual void OnBroadcastEvent(CUUID SubID, const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, CAutoBuffer Buffer);
 	virtual void OnTimeout(DWORD dwTimerID);
-	/*!
-	 * @brief 判断是否为未配置模式
-	 * @param[out] 如果为未配置模式,stepMode 等于 0 为从头开始配置,其他为阶段性配置,详情见 DeployStep_* 定义
-	 * @return : true: 为未配置模式,false:正常模式
-	 */
-	bool IsLackOfConfig(int& stepMode);
+
 	virtual void OnEntityStateHook(const char* pszEntityName, const char* pszTriggerEntity, EntityStateEnum eState, EntityStateEnum eLastState);
 	virtual void OnUserStateHook(const char* pszEntityName, DWORD dwState, DWORD dwLastState) { return; }
 	virtual void OnCeateConnection(const char* pszCallerEntity, const char* pszServiceEntity) { return; }
@@ -311,15 +292,6 @@ private:
 
 	bool IsTestMode();
 
-	ErrorCodeEnum GetTmpRootFilePath(CSimpleStringA& rootPath, CSimpleStringA& rootTmpPath, CSimpleStringA& rootBackPath);
-
-	void RecordInstallBeginTimeStamp(const CSimpleString& strTimeStamp, BOOL forceReset = FALSE);
-    ErrorCodeEnum GetInstallBeginTimeStamp(CSimpleString& strTimeStamp);
-
-	ErrorCodeEnum GetGuidePageUrlWithStep(int whichStep, CSimpleStringA& strUrl);
-
-	ErrorCodeEnum TellChromiumOpenGuidePage(const CSimpleStringA& pageUrl);
-
 	ErrorCodeEnum DealSpecifiedEntity(DealType type, LPCTSTR lpcszEntityName, LPCTSTR lpcszCmdline, bool bForce, CSimpleStringA& strErrMsg);
 	void ToCalcRebootHourAndMinute(int restartBegin, int restartEnd);
 };