基于自主发明专利的杰林码哈希算法、对称加密算法和无损压缩算法的可文件追踪管控且支持linux和windows的文件压缩包工具SDK和JLM PACK软件介绍

基于自主发明专利的杰林码哈希算法、对称加密算法和无损压缩算法的可文件追踪管控且支持linux和windows的文件压缩包工具SDK1.0版发布,下载链接为:

JLM PACK CSDN下载链接

JLM PACK SDK和软件的官方网站

注意测试授权证书yesine_jlmpack_test.license的有效期到2024年12月,如果需要更长的测试授权,请联系我们!

1、如果你的文件需限制查看人员的设备、账户或时间,可以采用JLM PACK打包,打包后除了有权限的设备,账户或在有效时间内解压,否则均会造成.jlm文件的自毁。通过软件的系统后台可以及时控制打包后的文件传播、自毁等。

2、如果你想实时观察文件的动向,可以用我们的JLM PACK打包软件,能通过系统后台或软件查看当前文件被谁解压过?被谁修改过?是否传播到了本公司以外、某政府以外,或国外?

3、支持linux和windows,最主要的是支持麒麟、鸿蒙,Ununtu,安卓等系统,支持服务器的应用。

4、软件和系统后台均支持独立出售,自定义文件特征(如特殊领域对哈希值的长度,对称加密的密钥长度有特殊要求),也支持定制开发!

一、特色

1、完全采用我国自主发明专利算法,杰林码哈希算法,杰林码对称加密算法以及杰林码无损压缩算法等,该算法均采用了加权概率模型的全新国产编码算法。

采用了随机哈希算法和随机对称加密算法,相同的文件相同的密码,每次加密后的密文均不相同。

在这里插入图片描述

2、支持权限管控和文件追踪,比如限制解压的人群、IP、设备和时间,查看文件被那些用户查看过等
3、个人用户基础的压缩解压功能免费
在这里插入图片描述
在这里插入图片描述
4、SDK需要商业授权,支持自定义分割包,文件包的后缀为.jlm,支持linux和windows,支持x86,x64(RAM和RISC需联系我们获取),支持国产的麒麟。
5、编译码效率快,大概能做到12MB-50MB/s的处理效率,由设备性能而定。

二、JLM PACK软件-支持麒麟、ubuntu和WINDOWS等

1、软件界面
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2、该工具软件将于2024年7月正式面向市场,个人基本功能永久免费,企业和政府收费,具体请参考官网:www.jlmpack.com。
3、软件支持换皮肤,中英文等,同步国内外发布!
4、后续将支持防勒索病毒灾难备份,自检错,文件锁,安全策略等功能。

三、JLM PACK SDK

1、Config.h用于宏定义,部分参数可以根据要求进行配置

#pragma once
/*************************************************************************** @作者 王杰林 2024-05-08* @功能 配置信息,主要方便调整SDK中部分参数* @版权 湖南遥昇通信技术有限公司* @版本 1.0* @邮件 254908447@qq.com**************************************************************************/
#ifndef JLMPACKCONFIG_H  
#define JLMPACKCONFIG_H/**************************************************************************采用预处理指令自定义跨平台的函数接口**************************************************************************/
#if defined(_WIN32) || defined(_WIN64)
#include "Windows.h"
#include "direct.h"// windows下删除目录函数为RemoveDirectoryA
#define removeEmptyFolder RemoveDirectoryA
// windows下创建目录函数为_mkdir
#define JlmPack_CreateFolder(path) _mkdir(path)
#else
#include "sys/stat.h"
#include "sys/types.h"
#include "unistd.h"// linux和unix下的删除目录函数为rmdir
#define removeEmptyFolder rmdir
// linux和unix下的创建目录函数为mkdir
#define JlmPack_CreateFolder(path) mkdir(path, S_IRWXU)
#endif/**************************************************************************JLMPACK的一些核心宏定义**************************************************************************/// 随机读取文件中READ_BYTE_LIMIT_TO_COMPUTE_HASH个字节用于计算哈希值
#define READ_BYTE_LIMIT_TO_COMPUTE_HASH 1024
// 随机加密的随机数长度,随机数越大安全性越高
#define RANDOM_BYTE_LIMIT 6
// 当前文件的哈希值长度,建议8到16字节
#define HASH_BYTE_LIMIT 8
// 统一规范文件名(不含路径,带后缀)的最大字节数
#define NAME_BYTE_LIMIT 200
// 统一规范路径(带文件名和后缀)的最大字节数
#define URL_BYTE_LIMIT 1000
// 最大允许的目录数,即所有的目录和子目录、文件的总和不能超过CATALOG_MAX_LIMIT,可在此处调整
#define CATALOG_MAX_LIMIT 10000
// 目录嵌套深度,即文件夹下的文件夹,最大嵌套深度
#define FOLDERS_NESTED_MAX_LIMIT 1000// 哈希值的长度限制
#define JLM_FILE_HASH_BYTE_LIMIT 64
#define PACK_FILE_HASH_BYTE_LIMIT 32// JLM_EXTRA中部分对象的字节长度限制
#define EXTRA_BYTE_LIMIT 100// JlmPack_JLMSE函数的两个状态:加解密模式
#define ENCODE_MODEL 0
#define DECODE_MODEL 1// 日志描述的字节大小
#define NOTE_BYTE_LIMIT 200// 限制二进制文件读写的最大缓存为10MB,可以设置和调整以适应最佳效率,不能低于4MB,不能太大占内存过多
#define BINARY_FILE_MAX_LIMIT 10485760  //10485760  16777216// 设置包的最大个数,一般来讲打包的目的是把大量的文件和文件夹打包成为几个压缩包,这里设置为100,能满足很多情况下,注意配合PACK_BYTES_LIMIT设置
#define MAX_NUMBER_PACKS 100// 将JLM压缩包切割成多个包,每个包最大字节数为PACK_BYTES_LIMIT,通过JLM_FILE.packBytesLength自定义
#define JLMPACK_BYTES_LIMIT 4227858432ULL#endif

2、JlmPack.h的头文件

#pragma once
/*************************************************************************** @作者 王杰林 2024-06-20* @功能 遍历全部目录的文件夹以及文件,并保存到目录对象中,支持linux和windows* @版权 湖南遥昇通信技术有限公司* @版本 1.0* @邮件 254908447@qq.com**************************************************************************/
#ifndef JLMPACK_H  
#define JLMPACK_H// 包含配置头文件,必不可少
#include "Config.h"// JLM文件的头部信息,头部信息必须是放在第1个包的初始位置,下面的顺序不能修改的,修改可能会出错
typedef struct
{unsigned char jlmHeadSign[4];                              // JLM压缩包文件的头部标识为{ 'J', 'L', 'M', ' '},音频为{ 'J', 'L', 'M', 'A'},视频为{ 'J', 'L', 'M', 'V'},无法修改,就算传递进来也会被重置unsigned char consistencyMark[PACK_FILE_HASH_BYTE_LIMIT];  // 用来统一主包和子包以及系统后台信息,具有相同的consistencyMark才算一个JLM文件unsigned int packID;							           // 包编号分别为1,2,3,...等等,注意一定是从1开始unsigned int catalogBytesLength;                           // 目录的原始字节长度,尚未编码的字节长度,也是jlm文件除了JLM_FILE以外的目录存放长度unsigned int packSize;                                     // 整个jlm根据packBytesLength切割成packSize个子包unsigned int packBytesLength;                              // 单个包的字节数量(默认最大单个包大小为PACK_BYTES_LIMIT字节数)unsigned int encryptionWindow;                             // 加密轮函数的字节窗口,自动设定为BINARY_FILE_MAX_LIMIT - 2097152,解码时该值修改后将无法解密unsigned int extraSize;                                    // 记录JLM_EXTRA的字节数,如果extraSize = 0说明没有JLM_EXTRA,如果extraSize = sizeof(JLM_EXTRA)说明存在JLM_EXTRAunsigned long long fileBytesLength;                        // 压缩后的总字节长度,包括了头部信息的字节数,加密压缩后的数字证书和目录以及文件数据等(最大2^64-1个字节)unsigned char license[JLM_FILE_HASH_BYTE_LIMIT];           // 数字证书的数字指纹,商业授权版:由湖南遥昇通信技术有限公司颁发的SDK授权数字证书哈希值;个人版本由官网申请的个人证书哈希值
}JLM_FILE;/**************************************************************************************
JLM_CATALOG目录对象,非常重要,是预览目录的重要结构体,仅用于展示JLM压缩包中的目录信息
***************************************************************************************/
typedef struct
{int ID;                                  // 当前目录的IDint FID;                                 // 上一层目录的ID号,顶层该ID号为0char type;                               // 文件类型,是文件夹还是文件类型,0表示文件夹,1表示文件char name[NAME_BYTE_LIMIT];              // 当前文件或文件夹的名称,包括了后缀名unsigned long long byteslength;          // 原始文件的字节长度,如果是文件夹,则包括了文件夹下的所有文件,如果是文件则是文件的字节数unsigned char hv[HASH_BYTE_LIMIT];       // 哈希值(校验或签名),最大支持8个字节(默认是4个字节)long long time;                          // 文件创建的时间
}JLM_CATALOG;/**************************************************************************************
目录列表信息对象,非常重要,是预览目录的重要结构体,也是权限验证的重要结构体
***************************************************************************************/
typedef struct
{int ID;                                  // 当前目录的IDint FID;                                 // 上一层目录的ID号,方便进行退回char name[NAME_BYTE_LIMIT];              // 目录名称unsigned long long byteslength;          // 目录下的所有字节数long long time;                          // 目录创建的时间JLM_CATALOG* CatalogList;                // 子目录队列int CatalogListSize;                     // 子目录列表规模
}JLM_CATALOGINFOR;/**************************************************************************************
JLM_EXTRA对象属于可选项和可自定义结构体,主要用于版权控制,不建议随意修改,只能增加
1、主函数采用sizeof(JLM_EXTRA)计算JLM_EXTRA的实际字节数并写入到文件末尾,所以不能定义指针变量
2、存放在JLM文件的最末尾(或者最后一个包),文件末尾从fileLength - extraLength字节开始属于JLM_EXTRA对象
***************************************************************************************/
typedef struct
{char owner[EXTRA_BYTE_LIMIT];                        // 版权拥有人(公司或个人)char promulgator[EXTRA_BYTE_LIMIT];                  // 颁布人,或发行人(公司或个人)char contact[EXTRA_BYTE_LIMIT];                      // 联系方式char versionNumber[EXTRA_BYTE_LIMIT];                // 版本号long long datetime;                                  // 发布时的系统时间戳unsigned char authorization;                         // 本JLM压缩包对外授权分类,0表示免费,1表示共享授权,2表示商业授权(具体的方式由用户自定义)unsigned char signature[JLM_FILE_HASH_BYTE_LIMIT];   // 数字签名,采用了JLMHA算法
}JLM_EXTRA;/**************************************************************************************
日志结构体,即创建、解包、追加和删除均有日志文件输出,输出的日志文件可以在本地生成也可以存储到网络上
本日志文件只记录时间,动作,至于其他更多信息,可以通过LOGS结构体追加信息
***************************************************************************************/
typedef struct
{// 下面这4个对象属于系统对象严禁修改名字和删除,内容由库自动完成填入int type;                                                  // 0表示创建,1表示解包,2表示插入,3表示删除,4表示修改(一般指部分文件的重命名),5表示预览目录unsigned char consistencyMark[PACK_FILE_HASH_BYTE_LIMIT];  // 用来统一主包和子包以及系统后台信息unsigned char fileName[NAME_BYTE_LIMIT];                   // 文件名long long datetime;                                        // 发生的系统时间戳// 可以在此处追加其他对象,追加的对象和处理请到JLMPackAuthorityControl类中处理
}JLM_LOG;/**************************************************************************************
VARIABLES变量传递,函数不同则对变量要求不同,请参考各函数的说明
***************************************************************************************/
typedef struct
{/*************************************************************************** 授权文件YESINE.license的路径,该路径必须正确而且证书也必须是正确有效才能使用本SDK中的所有函数**************************************************************************/unsigned char* licenseFilePath;/*************************************************************************** 总字节数totalBytes,和累计字节数Cumulative,主要用于进度条的计算**************************************************************************/unsigned long long totalBytes;unsigned long long cumulativeBytes;/*************************************************************************** jlmFile为JLM文件格式信息* jlmExtra为JLM文件扩展信息**************************************************************************/JLM_FILE* jlmFile;                              // 输入或输出jlm文件头信息,见结构体JLM_FILEJLM_EXTRA* jlmExtra;                            // 输入或输出jlm文件扩展信息,见结构体JLM_EXTRA/*************************************************************************** RandomBytes为编码前或译码后的随机数数组,随机数是抗量子破解的核心* RandomBytes_size为随机数数组中字节个数**************************************************************************/unsigned char* RandomBytes;                     // 输入或输出随机数,用于生成密钥int RandomBytes_size;                           // 输入或输出随机数的字节数/*************************************************************************** Passwords为编码或译码的密码数组,将根据用户的需要是否* Passwords_size为密码数组中字节个数,Passwords_size >= 0且Passwords_size < 64,不建议太长怕忘记后无法找回**************************************************************************/unsigned char* Passwords;                       // 输入加解密密码,译码时密码是解密的关键int Passwords_size;                             // 输入加解密密码长度/*************************************************************************** jlmFileUrl为编码后或解码前的jlm文件的路径和文件名,可以包括".jlm"* 支持XXX.jlm首包路径,也支持XXX_packX.jlm子包路径,任何这样的路径输入给jlmFileUrl均可定位到首包的路径**************************************************************************/unsigned char* jlmFileUrl;/*************************************************************************** pathList为编码前或解码后的各类文件和文件夹的路径列表,pathList中允许.jlm文件* pathListSize为pathList中路径的个数* 注意:编码时pathList为各类文件和文件夹的路径,所以pathListSize大于等于* 译码时pathList只能是译码后的文件夹路径,且pathListSize只能等于1**************************************************************************/unsigned char** pathList;                          // 待编码文件的路径列表或译码后存放文件的文件夹路径,pathList[i]代表一个路径int pathListSize;                               // pathList中路径个数/*************************************************************************** 签名的数字证书哈希值(数据指纹),用于计算JLM_FILE.cer**************************************************************************/unsigned char* license;                       // 签名的数字证书哈希值(数据指纹),用于计算JLM_FILE.licenseint license_size;                             // 签名的数字证书哈希值字节长度,fatherCer_size为0时说明无签名,此时JLM_FILE.cer为全0序列/*************************************************************************** rule为目录权限规则,用于管理目录打开条件,请参考SDK说明书**************************************************************************/short rule;                                     // 权限编号/*************************************************************************** IdList为待处理的ID列表,比如删除某些ID、追加文件到某个ID下、译码某些ID对应的文件夹或文件等* IdList_Size为IdList中ID的个数**************************************************************************/int* IdList;                                    // ID列表,主要用于译码、删除和增加,创建JLM文件时IdList无效int IdList_Size;                                // IdList中ID的个数/*************************************************************************** 临时运算变量,重复使用**************************************************************************/unsigned char* InByteArray;                     // 用于压缩和加密编码的临时输入,包括了文件复制等等unsigned int InByteArray_Size;unsigned char* OutByteArray;                    // 用于解压和解密译码的临时输出,包括了文件复制等等unsigned int OutByteArray_Size;unsigned char* WriteOrReadBuff;                 // 用于写文件,大小和OutByteArray、InByteArray一致unsigned int WriteOrReadBuff_Size;/*************************************************************************** 日志输入信息**************************************************************************/JLM_LOG* log;                                   // 日志文件}VARIABLES;#ifdef __cplusplus
extern "C" {
#endif/*************************************************************************************获取授权证书内数字签名的函数输入:VARIABLES* vars返回:Errsign:错误标识,0无错,大于1为错误*************************************************************************************/int JlmPack_GetLicense(VARIABLES* vars);/*************************************************************************************JLMHA哈希算法函数,根据输入的数据获取长度为OutByteArray_size的哈希值,返回1表示计算成功1、根据InByteArray生成哈希值,RandomByte是随机生成的字节值,HashByteArray的第0个字节用于存放RandomByte的值2、验证的时候,必须将老的哈希值A第一个字节作为RandomByte传递给JLMHA,然后再根据InByteArray计算出新的哈希值B,比较两者是否相同输入:RandomByte:生成哈希值时RandomByte为0-255的随机数;检验哈希值时RandomByte必须是哈希值的首个字节(前8个比特)InByteArray:用于计算哈希值的原始数据InByteArray_size:InByteArray的字节数HashByteArray:生成哈希值时HashByteArray中HashByteArray_size个字节必须为0x00;迭代计算哈希值时HashByteArray中HashByteArray_size可以为上一次得出的哈希值HashByteArray_size:需要生成的哈希值长度,可自定义返回:Errsign:错误标识,0无错,大于1为错误*************************************************************************************/int JlmPack_JLMHA(unsigned char RandomByte, unsigned char* InByteArray, unsigned int InByteArray_size, unsigned char* HashByteArray, unsigned int HashByteArray_size);/*************************************************************************************JLMSE对称加密算法函数,注意本函数不做密码校验,无论密码输入是否正确,均会给出一个译码结果输入:RandomBytes:随机数,主要是抗量子计算破解RandomBytes_size:随机数的长度Passwords:加密或解码密码Passwords_size:密码的长度InByteArray:需要编译码的字节缓存InByteArray_size:InByteArray的字节数OutByteArray:加解密后的字节缓存OutByteArray_size:输入需要编译码的字节数,返回实际编译码的字节数model:加密模式model = 0,解密模式model = 1返回:Errsign:错误标识,0无错,大于0出错*************************************************************************************/int JlmPack_JLMSE(unsigned char* RandomBytes, unsigned int RandomBytes_size, unsigned char* Passwords, unsigned int Passwords_size, unsigned char* InByteArray, unsigned int InByteArray_size, unsigned char* OutByteArray, unsigned int* OutByteArray_size, int model);/*************************************************************************************创建函数,根据参数相关的信息创建一个jlm压缩包特别注意:1、文件或文件夹通过pathList传递2、编码后jlm文件的路径通过jlmFileUrl传递,必须是带文件名(允许不带后缀.jlm)3、各权限编号通过rule传递4、IdList和IdList_Size在本函数内是无效的5、fatherCer为父亲节点的数字证书的数字指纹,可以为空,如果不为空必须与网站后台或license的指纹一致(fatherCer可以查询用户的数字证书),而且整个jlm文件全部采用fatherCer进行签名6、密码通过Passwords传递7、随机数通过RandomBytes传递,建议采用4-16个随机数,这个是防止量子破解的核心,不建议为空输入:VARIABLES*:参数变量返回:Errsign:错误标识log中的信息*************************************************************************************/int JlmPack_Create(VARIABLES* vars);/*************************************************************************************获取权限值的函数,除了JlmPack_Create函数,其他函数在使用前都必须完成权限检验特别注意:1、编码后jlm文件的路径通过jlmFileUrl传递,必须是带文件名(允许不带后缀.jlm)2、权限值通过vars->rule返回3、权限获取不记录日志输入:VARIABLES*:参数变量返回:Errsign:错误标识*************************************************************************************/int JlmPack_GetRule(VARIABLES* vars);/*************************************************************************************解包函数:输入IdList列表,解压和解密出IdList列表下面的所有文件或文件夹,解压需要做权限控制特别注意:1、如果解压整个压缩包,仅需在IdList中包括了0的ID号2、译码后的文件存储路径通过pathList[0]传递,而且仅允许pathListSize = 03、待解压的JLM压缩包路径通过jlmFileUrl传递,支持jlmFileUrl = XXX_PackX.jlm(程序会自动找到主文件XXX.jlm)4、其他的通过对应的参数传递,注意RandomBytes会被本函数覆盖掉安全方案:1、用Passwords直接解密jlm文件的目录信息,如果解密错误返回无法解密2、如果解密正确,则可获得CatalogInfor对象以及rule的值,如果rule表达了需要强制服务器校验,则进行第3步,否则直接译码3、将rule、JLM_FILE.cer、JLM_FILE.consistencyMark和Username、Mac(本地获取)、CPU编号(本地获取)等等信息经过随机加密后推送给后台系统进行验证4、验证失败返回NULL,则函数UnpackJlmPackFile将根据rule进行动作5、如果验证成功,则返回当前文件在服务器上的全部日志信息输入:VARIABLES*:参数变量返回:Errsign:错误标识*************************************************************************************/int JlmPack_Unpack(VARIABLES* vars);/*************************************************************************************向Jlm文件中追加新待编码文件的函数,追加的过程不会解密任何文件,仅仅重新组织jlm文件包和修改目录信息特别注意1、只能设置IdList_Size = 1且IdList[0] = 某ID号(可以为0,表示新增信息存放在根目录下),意思是把新增信息存放在某个目录ID下,如果当前的ID为文件将自动存储到2、待添加的文件和文件夹路径通过pathList传递3、jlm压缩包文件路径通过jlmFileUrl传递,支持jlmFileUrl = XXX_PackX.jlm(程序会自动找到主文件XXX.jlm)4、其他的通过对应的参数传递输入:VARIABLES*:参数变量返回:Errsign:错误标识*************************************************************************************/int JlmPack_Insert(VARIABLES* vars);/*************************************************************************************删除Jlm压缩包中某些文件的函数,删除的过程不会解密任何文件,仅仅重新组织jlm文件包和修改目录信息特别注意1、待删除的目录ID号通过IdList传递,此时IdList_Size>=12、jlm压缩包文件路径通过jlmFileUrl传递,支持jlmFileUrl = XXX_PackX.jlm(程序会自动找到主文件XXX.jlm)3、其他的通过对应的参数传递输入:VARIABLES*:参数变量返回:Errsign:错误标识*************************************************************************************/int JlmPack_Delete(VARIABLES* vars);/*************************************************************************************重命名某个ID的名称,要求是密码必须正确且权限足够,重命名过程无法修改目录中的任何缀名,防止文件格式错误特别注意:1、只能设置IdList_Size = 1且IdList[0] = 某ID号(可以为0,浏览根目录同级的文件和文件夹),每次只能针对一个ID进行重命名2、jlm压缩包文件路径通过jlmFileUrl传递,支持jlmFileUrl = XXX_PackX.jlm(程序会自动找到主文件XXX.jlm)3、新的名称用pathList[0]传递,所以pathListSize = 1输入:VARIABLES*:参数变量,重点是jlmFileUrl和IdList[0]返回:JLM_CATALOGINFOR*:目录信息*************************************************************************************/int JlmPack_Rename(VARIABLES* vars);/*************************************************************************************预览Jlm压缩包的某个ID下的同级文件和文件夹列表,要求是密码必须正确且权限足够特别注意:1、只能设置IdList_Size = 1且IdList[0] = 某ID号(可以为0,浏览根目录同级的文件和文件夹)如果IdList[0]指向的是文件表示当前文件的同级文件和文件夹如果IdList[0]指向的是文件夹表示当前文件夹下的同级的文件和文件夹2、jlm压缩包文件路径通过jlmFileUrl传递,支持jlmFileUrl = XXX_PackX.jlm(程序会自动找到主文件XXX.jlm)3、其他的通过对应的参数传递输入:VARIABLES*:参数变量,重点是jlmFileUrl和IdList[0]返回:JLM_CATALOGINFOR*:目录信息*************************************************************************************/JLM_CATALOGINFOR* JlmPack_BrowseCatalog(VARIABLES* vars, int* errSign);#ifdef __cplusplus
}
#endif
#endif

3、main.c程序,各个功能函数的测试!

#include "JlmPack.h"
#include "stdio.h"
#include "stdlib.h"
#include "memory.h"
#include "string.h"
#include "locale.h"#if defined(_WIN32) || defined(_WIN64)
#include "Windows.h"
#define _WINDOWS
#elif defined(__linux__)
#define _LINUX
#else
#error "Unsupported platform"
#endif// 检验JlmPack_JLMHA和JlmPack_JLMSE,测试通过了
int main3() { // 3int errSign = 0;unsigned int i;unsigned char* RandomBytes = NULL, * RandomBytes1 = NULL;unsigned char* InByteArray = NULL;unsigned char* HashByteArray = NULL;unsigned char* OutByteArray = NULL, * OutByteArray1 = NULL;unsigned int InByteArray_size = BINARY_FILE_MAX_LIMIT;unsigned int OutByteArray_size = BINARY_FILE_MAX_LIMIT * 2;unsigned int OutByteArray_size1 = BINARY_FILE_MAX_LIMIT * 2;unsigned char RandomByte;unsigned char* ucPassword = "";unsigned int uiPasswordLen = 0;unsigned char* ucPassword1 = "";unsigned int uiPassword1Len = 0;unsigned int RandomBytes_size = 64;unsigned int HashByteArray_size = 4;HashByteArray = (unsigned char*)malloc(HashByteArray_size * sizeof(unsigned char));RandomBytes = (unsigned char*)malloc(RandomBytes_size * sizeof(unsigned char));RandomBytes1 = (unsigned char*)malloc(RandomBytes_size * sizeof(unsigned char));InByteArray = (unsigned char*)malloc(InByteArray_size * sizeof(unsigned char));OutByteArray = (unsigned char*)malloc(OutByteArray_size * sizeof(unsigned char));OutByteArray1 = (unsigned char*)malloc(OutByteArray_size1 * sizeof(unsigned char));if (HashByteArray == NULL || RandomBytes == NULL || RandomBytes1 == NULL || InByteArray == NULL || OutByteArray == NULL || OutByteArray1 == NULL) goto ERR;// 生成随机数srand((unsigned)time(NULL));printf("生成%d个随机数:\n", RandomBytes_size);for (i = 0; i < RandomBytes_size; ++i) {RandomBytes[i] = rand() % 0xFF;RandomBytes1[i] = 0x00;printf("%02X,", RandomBytes[i]);}printf("\n\n");printf("生成%d个随机待编码数据:\n", InByteArray_size);for (i = 0; i < InByteArray_size; ++i) {InByteArray[i] = rand() % 0xFF; // 0x01;// if (i < 1024) printf("%02X,", InByteArray[i]);}printf("\n\n");errSign = JlmPack_JLMSE(RandomBytes, RandomBytes_size, ucPassword, uiPasswordLen, InByteArray, InByteArray_size, OutByteArray, &OutByteArray_size, ENCODE_MODEL);if (errSign == 0x00) {printf("编码后的字节为:%d个\n", OutByteArray_size);for (i = 0; i < OutByteArray_size && i < 1024; ++i) {printf("%02X,", OutByteArray[i]);}}else {printf("错误!编号为:%d", errSign);}printf("\n\n");errSign = JlmPack_JLMSE(RandomBytes1, RandomBytes_size, ucPassword1, uiPassword1Len, OutByteArray, OutByteArray_size, OutByteArray1, &OutByteArray_size1, DECODE_MODEL);if (errSign == 0x00) {printf("\n\n译码后的随机数为:\n");for (i = 0; i < RandomBytes_size; ++i) {printf("%02X,", RandomBytes1[i]);}printf("\n");printf("译码后的字节为:%d个\n", OutByteArray_size1);for (i = 0; i < OutByteArray_size1; ++i) {if (OutByteArray1[i] != InByteArray[i]) {printf("译码错误!");goto ERR;}if (i < 1024) printf("%02X,", OutByteArray1[i]);}}else {printf("错误!编号为:%d", errSign);}printf("\n\n编译码正确!!\n");// 计算InByteArray的哈希值RandomByte = rand() % 0xFF;errSign = JlmPack_JLMHA(RandomByte, InByteArray, InByteArray_size, HashByteArray, HashByteArray_size);if (errSign == 0x00) {printf("InByteArray的哈希值:\n");for (i = 0; i < HashByteArray_size; ++i) {printf("%02X,", HashByteArray[i]);}}printf("\n\n");
ERR:if (HashByteArray) free(HashByteArray);if (RandomBytes) free(RandomBytes);if (InByteArray) free(InByteArray);if (OutByteArray) free(OutByteArray);if (OutByteArray1) free(OutByteArray1);// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}// 测试创建目录,测试通过
int Create() { // 4// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); // en_US.UTF-8VARIABLES* vars = NULL;int i, errSign = 0, listSize = 2;unsigned char* ucPassword = "123456";unsigned char* owner = "湖南遥昇通信技术有限公司";unsigned char* promulgator = "马力哥";unsigned char* contact = "18163682727";unsigned char* versionNumber = "V1.0.0";unsigned char* signature = "测试测试!";unsigned long datetime = 0;unsigned char authorization = 0;vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT; // 建议为2-8个字节vars->Passwords_size = (int)(strlen(ucPassword) + 1);vars->pathListSize = 2;vars->rule = 0;vars->pathList = (unsigned char**)malloc(vars->pathListSize * sizeof(unsigned char*));if (vars->pathList == NULL) goto ERR;for (i = 0; i < vars->pathListSize; ++i) {vars->pathList[i] = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->pathList[i] == NULL) goto ERR;}vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 设置扩展信息strncpy(vars->jlmExtra->owner, owner, strlen(owner));vars->jlmExtra->owner[strlen(owner)] = '\0';strncpy(vars->jlmExtra->promulgator, promulgator, strlen(promulgator));vars->jlmExtra->promulgator[strlen(promulgator)] = '\0';strncpy(vars->jlmExtra->contact, contact, strlen(contact));vars->jlmExtra->contact[strlen(contact)] = '\0';strncpy(vars->jlmExtra->versionNumber, versionNumber, strlen(versionNumber));vars->jlmExtra->versionNumber[strlen(versionNumber)] = '\0';strncpy(vars->jlmExtra->signature, signature, strlen(signature));vars->jlmExtra->signature[strlen(signature)] = '\0';vars->jlmExtra->datetime = datetime;vars->jlmExtra->authorization = authorization;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 此处需要从服务器上获取某个账户的证书指纹或SDK的商业授权下的证书指纹,如果某个账户下有指纹则vars->license_size为指纹的实际长度,否则vars->license_size = 0vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);vars->license_size = 0;if (vars->license == NULL) goto ERR;// 开辟临时运算缓存vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// 设定每个包的大小,如果不设置则默认按照JLMPACK_BYTES_LIMIT来设置vars->jlmFile->packBytesLength = 6291456;// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* url1 = "D:\\CatalogTest";const char* url2 = "D:\\Lena.bmp";const char* outurl = "D:\\test.jlm";const char* licensePath = "D:\\YESINE.license";
#elif defined(_LINUX)printf("_LINUX\n");const char* url1 = "/home/wangjielin/Desktop/CatalogTest";const char* url2 = "/home/wangjielin/Desktop/Lena.bmp";const char* outurl = "/home/wangjielin/Desktop/test.jlm";const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";
#endifstrcpy(vars->licenseFilePath, licensePath);strcpy(vars->pathList[0], url1);strcpy(vars->pathList[1], url2);strcpy(vars->Passwords, ucPassword);strcpy(vars->jlmFileUrl, outurl);srand((unsigned)time(NULL));// 调用创建接口errSign = JlmPack_Create(vars);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("创建成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->license) free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);if (vars->pathList) {for (i = vars->pathListSize - 1; i >= 0; --i) if (vars->pathList[i]) free(vars->pathList[i]);free(vars->pathList);}free(vars);}
}// 测试解包,测试通过
int Unpack() { // 5// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); //en_US.UTF-8VARIABLES* vars = NULL;int i, errSign = 0;unsigned char* ucPassword = "123456";vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT;   // 编码和解码这个值必须相同vars->Passwords_size = strlen(ucPassword) + 1;vars->pathListSize = 1;vars->rule = 0;vars->license_size = 0;vars->IdList_Size = 2;vars->pathList = (unsigned char**)malloc(vars->pathListSize * sizeof(unsigned char*));if (vars->pathList == NULL) goto ERR;for (i = 0; i < vars->pathListSize; ++i) {vars->pathList[i] = (unsigned char*)malloc(URL_BYTE_LIMIT * sizeof(unsigned char*));if (vars->pathList[i] == NULL) goto ERR;}vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 同上vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 开辟临时运算缓存,译码过程中开辟相同的缓存大小即可vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// ID列表vars->IdList = (int*)malloc(vars->IdList_Size * sizeof(int));if (vars->IdList == NULL)  goto ERR;// 复制密码,去除“\0”strcpy(vars->Passwords, ucPassword);// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* licensePath = "D:\\YESINE.license";const char* jlmFileUrl = "D:\\test.jlm";//const char* jlmFileUrl = "D:\\test_pack4.jlm";const char* outurl = "D:\\testDecode\\"; // 解码的文件夹路径// 输入解码ID号vars->IdList[0] = 0; //2vars->IdList[1] = 18;#elif defined(_LINUX)printf("_LINUX\n");const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";const char* jlmFileUrl = "/home/wangjielin/Desktop/test.jlm";//const char* jlmFileUrl = "/home/wangjielin/Desktop/test_pack3.jlm";const char* outurl = "/home/wangjielin/Desktop/testDecode/"; // 解码的文件夹路径// 输入解码ID号,由于linux和windows的排序可能不一致,译码同一个东西vars->IdList[0] = 0;vars->IdList[1] = 18;#endifstrcpy(vars->licenseFilePath, licensePath);// jlm的文件路径strcpy(vars->jlmFileUrl, jlmFileUrl);// 把outurl赋值给vars->pathList[0]strcpy(vars->pathList[0], outurl);printf("vars->pathList[0] = %s\n", vars->pathList[0]);// 给vars->IdList中的数据errSign = JlmPack_Unpack(vars);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("译码成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->license) free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);if (vars->IdList) free(vars->IdList);if (vars->pathList) {for (i = vars->pathListSize - 1; i >= 0; --i) if (vars->pathList[i]) free(vars->pathList[i]);free(vars->pathList);}free(vars);}
}
// 联合测试创建和解包
int main5() { // 5Create();// 休眠3秒,因为有可能文件还没有写完,就开始执行解包容易出现错误
#ifdef _WINDOWSSleep(5000); // windows下暂停3秒
#elif defined(_LINUX)sleep(5);   // linux下暂停3秒
#endifprintf("\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n");Unpack();// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}// 测试追加文件,经过测试追加后能正常解包
int main6() { // 6// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); //en_US.UTF-8VARIABLES* vars = NULL;int i, errSign = 0;unsigned char* ucPassword = "123456";vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT;   // 编码和解码这个值必须相同vars->Passwords_size = strlen(ucPassword) + 1;vars->pathListSize = 2;  // 待添加到jlm文件包中的目录vars->rule = 0;vars->license_size = 0;vars->IdList_Size = 1;  // 添加文件时只能设置为1,否则将报错vars->pathList = (unsigned char**)malloc(vars->pathListSize * sizeof(unsigned char*));if (vars->pathList == NULL) goto ERR;for (i = 0; i < vars->pathListSize; ++i) {vars->pathList[i] = (unsigned char*)malloc(URL_BYTE_LIMIT * sizeof(unsigned char*));if (vars->pathList[i] == NULL) goto ERR;}vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 同上vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 开辟临时运算缓存,译码过程中开辟相同的缓存大小即可vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// ID列表vars->IdList = (int*)malloc(vars->IdList_Size * sizeof(int));if (vars->IdList == NULL)  goto ERR;// 复制密码,去除“\0”strcpy(vars->Passwords, ucPassword);// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* licensePath = "D:\\YESINE.license";const char* jlmFileUrl = "D:\\test.jlm";//const char* jlmFileUrl = "D:\\test_pack5.jlm";const char* addUrl1 = "D:\\目录测试"; // 待添加的文件路径const char* addUrl2 = "D:\\中国计算机学会推荐国际学术会议和期刊目录-2022.pdf"; // 待添加的文件路径// 输入解码ID号vars->IdList[0] = 0; //2#elif defined(_LINUX)printf("_LINUX\n");const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";const char* jlmFileUrl = "/home/wangjielin/Desktop/test.jlm";//const char* jlmFileUrl = "/home/wangjielin/Desktop/test_pack9.jlm";const char* addUrl1 = "/home/wangjielin/Desktop/WJLCoding"; // 解码的文件夹路径const char* addUrl2 = "/home/wangjielin/Desktop/JLMAudio"; // 解码的文件夹路径// 输入解码ID号,由于linux和windows的排序可能不一致,译码同一个东西vars->IdList[0] = 3;#endifstrcpy(vars->licenseFilePath, licensePath);// jlm的文件路径strcpy(vars->jlmFileUrl, jlmFileUrl);// 把outurlX赋值给vars->pathListstrcpy(vars->pathList[0], addUrl1);strcpy(vars->pathList[1], addUrl2);printf("vars->pathList[0] = %s\n", vars->pathList[0]);printf("vars->pathList[1] = %s\n", vars->pathList[1]);errSign = JlmPack_Insert(vars);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("追加成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->license) free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);if (vars->IdList) free(vars->IdList);if (vars->pathList) {for (i = vars->pathListSize - 1; i >= 0; --i) if (vars->pathList[i]) free(vars->pathList[i]);free(vars->pathList);}free(vars);}// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}
// 测试删除某些ID即一下的目录信息,测试通过
int main7() { // 7// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); //en_US.UTF-8VARIABLES* vars = NULL;int i, errSign = 0;unsigned char* ucPassword = "123456";vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT;   // 编码和解码这个值必须相同vars->Passwords_size = strlen(ucPassword) + 1;vars->pathListSize = 0;  // 删除目录,此参数为0vars->rule = 0;vars->license_size = 0;vars->IdList_Size = 3;  // 添加文件时只能设置为1,否则将报错vars->pathList = (unsigned char**)malloc(vars->pathListSize * sizeof(unsigned char*));if (vars->pathList == NULL) goto ERR;for (i = 0; i < vars->pathListSize; ++i) {vars->pathList[i] = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->pathList[i] == NULL) goto ERR;}vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 同上vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 开辟临时运算缓存,译码过程中开辟相同的缓存大小即可vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// ID列表vars->IdList = (int*)malloc(vars->IdList_Size * sizeof(int));if (vars->IdList == NULL)  goto ERR;// 复制密码,去除“\0”strcpy(vars->Passwords, ucPassword);// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* licensePath = "D:\\YESINE.license";//const char* jlmFileUrl = "D:\\test.jlm";const char* jlmFileUrl = "D:\\test_pack2.jlm";// 输入待删除的ID号,为0时vars->IdList[0] = 3; //2vars->IdList[1] = 7;vars->IdList[2] = 23;#elif defined(_LINUX)printf("_LINUX\n");const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";//const char* jlmFileUrl = "/home/wangjielin/Desktop/test.jlm";const char* jlmFileUrl = "/home/wangjielin/Desktop/test_pack2.jlm";// 输入待删除的ID号vars->IdList[0] = 5;vars->IdList[1] = 18;vars->IdList[2] = 19;#endifstrcpy(vars->licenseFilePath, licensePath);// jlm的文件路径strcpy(vars->jlmFileUrl, jlmFileUrl);errSign = JlmPack_Delete(vars);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("删除成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->license) free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);if (vars->IdList) free(vars->IdList);if (vars->pathList) {for (i = vars->pathListSize - 1; i >= 0; --i) if (vars->pathList[i]) free(vars->pathList[i]);free(vars->pathList);}free(vars);}// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}// 测试重命名功能,测试通过
int main8() { // 8// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); //en_US.UTF-8VARIABLES* vars = NULL;int i, errSign = 0;unsigned char* ucPassword = "123456";vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT;   // 编码和解码这个值必须相同vars->Passwords_size = strlen(ucPassword) + 1;vars->pathListSize = 1;  // 重命名需要通过vars->pathList[0]传递新的文件名vars->rule = 0;vars->license_size = 0;vars->IdList_Size = 1;  // 每次只能针对一个文件名进行重命名vars->pathList = (unsigned char**)malloc(vars->pathListSize * sizeof(unsigned char*));if (vars->pathList == NULL) goto ERR;for (i = 0; i < vars->pathListSize; ++i) {vars->pathList[i] = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->pathList[i] == NULL) goto ERR;}vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 同上vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 开辟临时运算缓存,译码过程中开辟相同的缓存大小即可vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// ID列表vars->IdList = (int*)malloc(vars->IdList_Size * sizeof(int));if (vars->IdList == NULL)  goto ERR;// 复制密码,去除“\0”strcpy(vars->Passwords, ucPassword);// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* licensePath = "D:\\YESINE.license";//const char* jlmFileUrl = "D:\\test.jlm";const char* jlmFileUrl = "D:\\test_pack2.jlm";unsigned char* newName = "草帽女孩.bmp";// 输入待重命名的ID号,为0时vars->IdList[0] = 18; //2#elif defined(_LINUX)printf("_LINUX\n");const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";//const char* jlmFileUrl = "/home/wangjielin/Desktop/test.jlm";const char* jlmFileUrl = "/home/wangjielin/Desktop/test_pack2.jlm";unsigned char* newName = "草帽女孩.bmp";// 输入待重命名的ID号vars->IdList[0] = 18; //2#endifstrcpy(vars->licenseFilePath, licensePath);// jlm的文件路径strcpy(vars->jlmFileUrl, jlmFileUrl);strcpy(vars->pathList[0], newName);errSign = JlmPack_Rename(vars);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("重命名成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->license)free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);if (vars->IdList) free(vars->IdList);if (vars->pathList) {for (i = vars->pathListSize - 1; i >= 0; --i) if (vars->pathList[i]) free(vars->pathList[i]);free(vars->pathList);}free(vars);}// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}// 预览目录测试
int main9() { // 9// 设置为""的目的是跟随系统,支持windows和linuxsetlocale(LC_ALL, ""); //en_US.UTF-8JLM_CATALOGINFOR* catalogs = NULL;VARIABLES* vars = NULL;int i, errSign = 0;unsigned char* ucPassword = "123456";vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;// 设置里面的参数vars->RandomBytes_size = RANDOM_BYTE_LIMIT;   // 编码和解码这个值必须相同vars->Passwords_size = strlen(ucPassword) + 1;vars->rule = 0;vars->license_size = 0;vars->IdList_Size = 1;  // 预览仅针对一个ID号vars->jlmFile = (JLM_FILE*)malloc(sizeof(JLM_FILE));if (vars->jlmFile == NULL) goto ERR;// vars->jlmExtra = NULL;vars->jlmExtra = (JLM_EXTRA*)malloc(sizeof(JLM_EXTRA));if (vars->jlmExtra == NULL) goto ERR;// 开辟随机数的缓存空间vars->RandomBytes = (unsigned char*)malloc(vars->RandomBytes_size * sizeof(unsigned char));vars->Passwords = (unsigned char*)malloc(vars->Passwords_size * sizeof(unsigned char));if (vars->RandomBytes == NULL || vars->Passwords == NULL) goto ERR;// 开辟jlm路径的缓存空间vars->jlmFileUrl = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->jlmFileUrl == NULL) goto ERR;// 同上vars->license = (unsigned char*)malloc(JLM_FILE_HASH_BYTE_LIMIT);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// 开辟临时运算缓存,译码过程中开辟相同的缓存大小即可vars->WriteOrReadBuff_Size = vars->OutByteArray_Size = vars->InByteArray_Size = BINARY_FILE_MAX_LIMIT;vars->InByteArray = (unsigned char*)malloc(vars->InByteArray_Size * sizeof(unsigned char));vars->OutByteArray = (unsigned char*)malloc(vars->OutByteArray_Size * sizeof(unsigned char));vars->WriteOrReadBuff = (unsigned char*)malloc(vars->WriteOrReadBuff_Size * sizeof(unsigned char));if (vars->InByteArray == NULL || vars->OutByteArray == NULL || vars->WriteOrReadBuff == NULL) goto ERR;// 开辟日志文件vars->log = (JLM_LOG*)malloc(sizeof(JLM_LOG));if (vars->log == NULL) goto ERR;// ID列表vars->IdList = (int*)malloc(vars->IdList_Size * sizeof(int));if (vars->IdList == NULL)  goto ERR;// 复制密码,去除“\0”strcpy(vars->Passwords, ucPassword);// 区分windows和linux
#ifdef _WINDOWSprintf("_WINDOWS\n");const char* licensePath = "D:\\YESINE.license";//const char* jlmFileUrl = "D:\\test.jlm";const char* jlmFileUrl = "D:\\test_pack2.jlm";// 输入待预览的ID号vars->IdList[0] = 18; //2#elif defined(_LINUX)printf("_LINUX\n");const char* licensePath = "/home/wangjielin/Desktop/YESINE.license";//const char* jlmFileUrl = "/home/wangjielin/Desktop/test.jlm";const char* jlmFileUrl = "/home/wangjielin/Desktop/test_pack2.jlm";// 输入待预览的ID号vars->IdList[0] = 18; //2#endifstrcpy(vars->licenseFilePath, licensePath);// jlm的文件路径strcpy(vars->jlmFileUrl, jlmFileUrl);// 读取目录catalogs = JlmPack_BrowseCatalog(vars, &errSign);printf("errSign = %d\n", errSign);if (errSign == 0) {printf("预览成功!\n");printf("vars->log->type = %d\n", vars->log->type);printf("vars->log->fileName = %s\n", vars->log->fileName);printf("vars->log->consistencyMark = ");for (i = 0; i < PACK_FILE_HASH_BYTE_LIMIT; ++i) {printf("%02X,", vars->log->consistencyMark[i]);}printf("\n");printf("vars->log->datetime = %lld\n", vars->log->datetime);printf("vars->totalBytes = %lld, vars->cumulativeBytes = %lld\n", vars->totalBytes, vars->cumulativeBytes);// 打印测试printf("catalogs->ID = %d\n", catalogs->ID);printf("catalogs->FID = %d\n", catalogs->FID);printf("catalogs->name = %s\n", catalogs->name);printf("catalogs->time = %lld\n", catalogs->time);printf("catalogs->byteslength = %llu\n", catalogs->byteslength);printf("catalogs->CatalogListSize = %d\n", catalogs->CatalogListSize);for (i = 0; i < catalogs->CatalogListSize; ++i) {printf("%d %d %d %s %llu\n", catalogs->CatalogList[i].ID, catalogs->CatalogList[i].type, catalogs->CatalogList[i].FID, catalogs->CatalogList[i].name, catalogs->CatalogList[i].byteslength);}printf("\n");}ERR:if (vars) {if (vars->InByteArray) free(vars->InByteArray);if (vars->OutByteArray) free(vars->OutByteArray);if (vars->WriteOrReadBuff) free(vars->WriteOrReadBuff);if (vars->log) free(vars->log);if (vars->jlmFile) free(vars->jlmFile);if (vars->jlmExtra) free(vars->jlmExtra);if (vars->RandomBytes)  free(vars->RandomBytes);if (vars->Passwords)  free(vars->Passwords);if (vars->jlmFileUrl)  free(vars->jlmFileUrl);if (vars->IdList) free(vars->IdList);if (vars->license)free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);free(vars);}// 注意catalogs必须释放if (catalogs) {if (catalogs->CatalogList) free(catalogs->CatalogList);free(catalogs);}// 结束
#ifdef _WINDOWSsystem("pause");return 0;
#elif defined(_LINUX)return 0;
#endif
}int main() { // 11setlocale(LC_ALL, "");VARIABLES* vars = NULL;int i, errSign = 0;const char* licensePath = "D:\\YESINE.license"; //vars = (VARIABLES*)malloc(sizeof(VARIABLES));if (vars == NULL) goto ERR;vars->license_size = JLM_FILE_HASH_BYTE_LIMIT;vars->license = (unsigned char*)malloc(vars->license_size);if (vars->license == NULL) goto ERR;vars->licenseFilePath = (unsigned char*)malloc(URL_BYTE_LIMIT);if (vars->licenseFilePath == NULL) goto ERR;// YESINE.license路径strcpy(vars->licenseFilePath, licensePath);errSign = JlmPack_GetLicense(vars);ERR:if (vars) {if (vars->license) free(vars->license);if (vars->licenseFilePath) free(vars->licenseFilePath);free(vars);}system("pause");return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/859671.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

一种改进解卷积算法在旋转机械故障诊断中的应用(MATLAB)

轴承振动是随机振动。在不同的时刻&#xff0c;轴承振动值是不尽相同的&#xff0c;不能用一个确定的时间函数来描述。这是由于滚动体除了有绕轴承公转运动以外&#xff0c;还有绕自身轴线的自旋运动&#xff0c;且在轴承运转时&#xff0c;滚动接触表面形貌是不断变化的&#…

计算机中丢失vcruntime140_1.dll如何修复?分享7种常用解决方法

vcruntime140_1.dll缺失原因分析 软件卸载或更新不当在软件卸载或更新过程中&#xff0c;如果未能正确处理依赖关系&#xff0c;可能会导致vcruntime140_1.dll文件被错误地删除或损坏。 据统计&#xff0c;约有30%的DLL文件丢失问题是由于不当的卸载或更新操作引起的。 用户…

git 拉下来的项目,出现“加载失败”的解决方法

现象&#xff1a; 1、对加载失败的项目&#xff0c;尝试重新加载 解决思路&#xff1a;根据上面的提示&#xff0c;打开F盘对应的 .vcxproj文件&#xff0c;查看里面关于opencv454.props的内容 先删了&#xff0c;后面再补 2、当前的工作重点是消除加载失败的情况&#xff0c;…

Day13—大语言模型

定义 大语言模型&#xff08;Large Language Models&#xff09;是一种基于深度学习的自然语言处理&#xff08;NLP&#xff09;模型&#xff0c;用于处理和生成人类语言文本。 一、认识NLP 什么是NLP ​ NLP&#xff08;Natural Language Processing&#xff09;&#xff0…

鸿蒙NEXT实战开发: 依据前端对http请求进行二次简单封装

一、为什么要对http请求进行封装&#xff1f; 在我看来二次封装有一下几点好处 代码封装之后&#xff0c;开发人员只用关注业务层面的东西&#xff0c;不用去过多浪费时间在接口请求数据处理上。封装之后代码更加简洁&#xff0c;通俗易懂&#xff0c;方便后期维护&#xff0…

MUR4060PT-ASEMI逆变焊机MUR4060PT

编辑&#xff1a;ll MUR4060PT-ASEMI逆变焊机MUR4060PT 型号&#xff1a;MUR4060PT 品牌&#xff1a;ASEMI 封装&#xff1a;TO-247 恢复时间&#xff1a;35ns 最大平均正向电流&#xff08;IF&#xff09;&#xff1a;40A 最大循环峰值反向电压&#xff08;VRRM&#x…

Nature重磅:揭开睡眠不足为什么会损害记忆力

我们的记忆力会在睡眠期间得到增强&#xff0c;海马体是大脑的记忆中心&#xff0c;而海马体尖波涟漪&#xff08;sharp-wave ripple&#xff0c;SWR&#xff09;期间觉醒体验的激活和重放被认为是记忆力得到增强的关键。睡眠不足会损害记忆力&#xff0c;然而&#xff0c;我们…

计算机组成原理笔记-第4章 存储器

第4章 存储器 笔记PDF版本已上传至Github个人仓库&#xff1a;CourseNotes&#xff0c;欢迎fork和star&#xff0c;拥抱开源&#xff0c;一起完善。 该笔记是最初是没打算发网上的&#xff0c;所以很多地方都为了自我阅读方便&#xff0c;我理解了的地方就少有解释&#xff1b…

Tomcat简介与安装

目录 一、Tomcat 简介 1、Tomcat好帮手---JDK 2、安装Tomcat & JDK 1、系统环境说明 2 、安装JDK 3、安装Tomcat 二、Tomcat目录介绍 1、tomcat主目录介绍 2、webapps目录介绍 3、Tomcat配置介绍&#xff08;conf&#xff09; 4、Tomcat的管理 5、tomcat 配置管…

24.6.16

星期一&#xff1a; 补cf global round26 C2 cf传送门 思路&#xff1a;有效操作2只有一次&#xff0c;且反转后不会再出现负数&#xff0c;即后面能贡献 2^n-i个方案&#xff0c;再乘上前面 2^(k>0的次数) 代码如下&…

GWB—200JA型引伸计标定器

GWB一200JA型引伸计标定器&#xff0c;是一种纯机械式的高精度位移测微仪器。依据JJG762—2007引伸计检定规程要求&#xff0c;专门用于对各类引伸计的标定&#xff0c;也广泛用于位移传感器的检定及相应百分表、千分表的标定。 l、本仪器由精密微分测头及测量支架组成。该标定…

vue2+webpack 和 vite+vue3 配置获取环境变量(补充)

相关涉及知识点可看小编该文章&#xff1a; nginx: 部署前端项目的详细步骤&#xff08;vue项目build打包nginx部署&#xff09;_前端工程打包部署到nginx-CSDN博客 1.vue2webpack 我们通常会在项目中看到这么两个文件(没有则自己创建&#xff0c;文件名&#xff1a;.env.***) …

C#回车按下时 如果当前焦点的下个控件为Button 则按Button。 如果不是Button则焦点移到下个控件上

需求 扫SN 扫IMEI 扫其它 就自动点打印 帮我写这个C# 函数 “ private void FormF360ColorBox_KeyDown(object sender, KeyEventArgs e)” 回车按下时 如果当前焦点的下个控件为Button 则按Button。 如果不是Button则焦点移到下个控件上。 控件的Index 顺序要设对哦。 你可以…

AI大模型战争:通用与垂直,谁将领跑未来?

文章目录 &#x1f4d1;引言一、通用大模型&#xff1a;广泛适用&#xff0c;实力不容小觑1.1 强大的泛化能力1.2 广泛的适用场景 二、垂直大模型&#xff1a;专注深度&#xff0c;精准解决问题2.1 深度专注&#xff0c;精准度高2.2 快速落地与普及 三、通用与垂直&#xff1a;…

通过焦点行事件对行值抓取改变当行状态值

我们在实际开发过程中&#xff0c;对于每一行的状态值需要有单独的变换&#xff0c;通过对特定值的判断我们可以改变其状态值&#xff0c;通过状态值的不同&#xff0c;允许用户进行不同的操作&#xff0c;本文状态值以审核为例&#xff0c;通过对AuditState列的判断&#xff0…

新建的springboot项目启动报错:找不到或无法加载主类

检查编译问题 在使用Spring Boot时&#xff0c;我们通常使用Maven或Gradle进行项目的构建和编译。如果在编译过程中出现了错误&#xff0c;可能会导致无法加载主类的问题。 在使用Maven时&#xff0c;可以尝试使用 mvn clean install 命令清理并重新构建项目。 如果使用Grad…

qt开发-12_QScrollArea

在 Qt 中&#xff0c;QScrollArea 是用于显示可以滚动内容的控件&#xff0c;通常用于处理视图中内容超出可见区域的情况。它提供了一种在有限的视窗内显示大量内容的解决方案&#xff0c;如显示大图像、长文本、多个小部件等。 常用方法和属性 setWidget(QWidget *widget)&am…

泰勒斯威夫特2022年纽约大学毕业典礼演讲:NYU‘s 2022 Commencement Speaker Taylor Swift

NYU’s 2022 Commencement Speaker Taylor Swift Link: https://www.youtube.com/watch?vOBG50aoUwlI Singer, songwriter, producer, and director Taylor Swift received a Doctor of Fine Arts, honoris causa, at the Commencement for the Class of 2022 and delivered …

RecyclerVIew->加速再减速的RecyclerVIew平滑对齐工具类SnapHelper

XML文件 ItemView的XML文件R.layout.shape_item_view <?xml version"1.0" encoding"utf-8"?> <FrameLayout xmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"100dp"android:layout_heig…

一加12搞机(kernelsu+lsposed)

刷机 温馨提示&#xff1a;如果你不知道root的意义在哪&#xff0c;建议不要解锁和root&#xff0c;到时候救砖或者回锁都挺麻烦。 刷全量包 最新版的系统没有更新推送&#xff0c;所以去一加社区[0]找了个全量包来刷&#xff0c;。安装方式可以看帖子里的内容&#xff0c;说…