Contents

防盗信息

新增字段:

1
2
3
ACTSPEC,0xAA,0x00,0x00,0x00,0x04		"防盗信息"

ACTSPEC,0xAA,0x00,0x00,0x00,0x04		"IMMO Info"

LIBTEXT目录下增加Helps目录,其中.bin代表不同语言对应的html文件:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
D:\WORK\SVN\repository\Makers3\1IM\FIAT\LIBTEXT\Helps>dir
 驱动器 D 中的卷是 本地磁盘
 卷的序列号是 DAB4-157C

 D:\WORK\SVN\repository\Makers3\1IM\FIAT\LIBTEXT\Helps 的目录

2023/06/29  18:01    <DIR>          .
2023/06/29  18:01    <DIR>          ..
2023/06/26  15:45         3,239,150 CN_FIAT_Html.bin
2023/06/26  15:45        14,968,230 CZ_FIAT_Html.bin
2023/06/26  15:45        14,975,338 DE_FIAT_Html.bin
2023/06/26  15:45        14,886,488 EL_FIAT_Html.bin
2023/06/26  15:45         2,778,513 EN_FIAT_Html.bin
2023/06/26  15:45        14,907,812 ES_FIAT_Html.bin
2023/06/26  15:45        15,053,526 FA_FIAT_Html.bin
2023/06/26  15:45        14,918,474 FR_FIAT_Html.bin
2023/06/26  15:45        14,875,826 HE_FIAT_Html.bin
2023/06/29  17:56    <DIR>          html
2023/06/26  15:45        14,811,854 ID_FIAT_Html.bin
2023/06/26  15:45        14,925,582 IT_FIAT_Html.bin
2023/06/26  15:45        14,968,230 KR_FIAT_Html.bin
2023/06/26  15:45        14,914,920 PL_FIAT_Html.bin
2023/06/26  15:45        14,914,920 PT_FIAT_Html.bin
2023/06/26  15:45        15,167,254 RU_FIAT_Html.bin
2023/06/28  18:02               380 style.css
2023/06/26  15:45        15,320,076 TH_FIAT_Html.bin
2023/06/26  15:45        14,914,920 TR_FIAT_Html.bin
2023/06/26  15:45         3,071,766 TW_FIAT_Html.bin
2023/06/26  15:45        14,954,014 VN_FIAT_Html.bin
              20 个文件    248,567,273 字节
               3 个目录 314,869,313,536 可用字节

筛选功能增加三个数据区(Help,OBD,KEY_PIC):

1
2
3
CString strSelect = "idm,g_nParameter,Help,OBD,KEY_PIC";
CUIFileChoice fileChoice;
fileChoice.SetSelectInfo(strSelect);//筛选条件

防盗信息关键代码(请参考demo工程):

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
void Decrypt(unsigned char* pBuff, int iCnt)
{
	int i = 0;
	const char* XorKeyChar = "VGJHGKKIHKHH";
	const char* AddKeyChar = "DYTJGJGJGJGR";

	if (iCnt > 8)
	{
		for (i = 0; i < (iCnt / 8); i++)
		{
			Decrypt(pBuff + i * 8, 8);
		}
		Decrypt(pBuff + i * 8, (iCnt % 8));
	}
	else
	{
		for (i = 0; i < iCnt; i++)
		{
			pBuff[i] = pBuff[i] + AddKeyChar[i];
			pBuff[i] = ~pBuff[i];
			pBuff[i] = pBuff[i] ^ XorKeyChar[i];
		}
	}
}

void delAllHtml() {
	CMyFileFind fileFind;
	CString strDir = CRunTime::GetInstance()->GetExePath();
	strDir += "Helps\\html\\*.html";

	CGroup<CFileStatus> vctFileStatus;
	//4个参数依次为路径、文件大小最小值、文件大小最大值、排序方式,注意文件大小的单位是bit
	vctFileStatus = fileFind.GetFiles(strDir, 0, 10485760, DATEGROW);

	for (D_U32 i = 0; i < vctFileStatus.GetSize(); i++) {
		/*删除单个文件*/
		CRWFile::DelFile(CRunTime::GetInstance()->GetExePath() + CString("Helps\\html\\") + vctFileStatus[i].m_szFullName);
	}
}

void initHtml() {
	/*删除目录下所有文件及目录本身*/
	//CRWFile::DelDir(CRunTime::GetInstance()->GetExePath() + CString("Helps\\key"), false);
	//CRWFile::DelDir(CRunTime::GetInstance()->GetExePath() + CString("Helps\\OBD"), false);

	/*创建递归目录*/
	//CRWFile::CreateDir(CRunTime::GetInstance()->GetExePath() + CString("Helps\\key"));
	//CRWFile::CreateDir(CRunTime::GetInstance()->GetExePath() + CString("Helps\\OBD"));

	delAllHtml();
}

CString creatHtml(CString fileName) {
	CString inputFilePath = CRunTime::GetInstance()->GetExePath() + CString("Helps\\") + CRunTime::GetInstance()->GetLanguage() + CString("_FIAT_Html.bin");

	CMyFile inputFile;
	if (!inputFile.Open(inputFilePath, CMyFile::modeReadWrite)) {
		adsMessageBox(inputFilePath + " file not find", DF_MB_OK);
		return "";
	}

	CString data_name;
	unsigned int position_ = 0;
	while (inputFile.GetPosition() < inputFile.GetLength()) {
		inputFile.Seek(position_, CMyFile::SeekPosition::begin);


		inputFile.ReadString(data_name);

		unsigned int data_size;
		inputFile.Read(&data_size, 4);	//文件大小
		position_ = inputFile.GetPosition() + data_size;

		if (data_name.CompareNoCase(CRunTime::GetInstance()->GetLanguage() + "_" + fileName + ".html") == 0) {
			// 写data
			{
				CMyFile data_output;
				data_output.Open(CRunTime::GetInstance()->GetExePath() + "Helps\\html\\" + data_name, CMyFile::modeCreate);
				unsigned char* ptr_data = new unsigned char[data_size];
				inputFile.Read(ptr_data, data_size);
				Decrypt(ptr_data, data_size);
				data_output.Write(ptr_data, data_size);
				data_output.Close();
				delete[] ptr_data;
			}
			break;
		}
	}

	inputFile.Close();

	return data_name;
}


// 点击防盗数据
else if (Helps == iBtnSel) {
    CString html_path = creatHtml(html_name);

    if (!html_path.IsEmpty()) {
        adsHtmlBox(adsGetTextFromTextLib(CBinary(STRID_ACTSPEC"\xAA\x00\x00\x00\x04", 6)), CRunTime::GetInstance()->GetExePath() + "Helps\\html\\" + html_path);
        initHtml();
    }
    else {
        WriteLog("htmls path error!!!");
        adsMessageBox("htmls path error!!!", DF_MB_OK);
    }
}

数据库文档对比及填充:

1
2
3
4
5
6
道通数据库字段:

	区域 品牌 子品牌 车型 车型(中文) 年款 钥匙类型 Help OBD接口位置 KEY_PIC

我们的数据库字段:
	Brand	Area	Model	System	Year Help OBD KEY_PIC

对比相应字段即可确定,最后填充我们数据库字段:Help,OBD,KEY_PIC

确保比对的数据段一致即可。

先通过工具填充,填充率95%++(请参考工程Html_fill),再人工填充比对。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
D:\WORK\SVN\repository\Makers3\1CD\Html_fill\LIBTEXT\Files>dir
 驱动器 D 中的卷是 本地磁盘
 卷的序列号是 DAB4-157C

 D:\WORK\SVN\repository\Makers3\1CD\Html_fill\LIBTEXT\Files 的目录

2023/06/30  11:04    <DIR>          .
2023/06/30  11:04    <DIR>          ..
2023/06/20  14:57    <DIR>          FIAT
2023/06/20  15:23               551 merge.bin
2023/06/20  15:18             1,123 MyVehicle.bin
2023/06/20  15:17             1,393 Vehicle808.bin
               3 个文件          3,067 字节
               3 个目录 314,864,852,992 可用字节

MyVehicle.bin文件存放我们的字段信息,Vehicle808.bin文件存放道通的信息,merge.bin文件为填充的信息,直接复制到我们的数据库即可。

关键代码说明:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
bool compareVehicle(MyVehicle &myVehicle, Vehicle808 &vehicle808) {

	// 区域比较
	if ((!myVehicle.Area.IsEmpty() && vehicle808.Area.IsEmpty()) && (myVehicle.Area.CompareNoCase(vehicle808.Area) != 0)) {
		return false;
	}

	// 品牌忽略大小比较,需确保品牌名称一致
	if (myVehicle.Brand.CompareNoCase(vehicle808.Brand) == 0) {
		CString model = vehicle808.Model;
		CString model_cn = vehicle808.Model_cn;
		model.MakeUpper();
		model_cn.MakeUpper();
		myVehicle.Model.MakeUpper();
		// 中文和英文车型模糊匹配,忽略大小写
		if (myVehicle.Model.Find(model) != -1 || myVehicle.Model.Find(model_cn) != -1) {
			// 钥匙类型大小比较,需确钥匙类型名称一致,说明:除了机械钥匙、智能钥匙等,其他的道通与我们可能是有区别的,这里的差异需要注意
			if (myVehicle.System.CompareNoCase(vehicle808.System) == 0) {
				if (compareByYear(myVehicle.Year, vehicle808.Year)) {
					return true;
				}
			}
		}
	}

	return false;
}
0%