function Key_Generate() if FHKey_OutputPath == nil or FHKey_OutputPath == '' then if gg.alert2('路径错误','输出路径['..FHKey_OutputPath..']错误','修改配置') == 1 then FHKey_Configurations() return else return end end if FHKey_Quantity == nil or FHKey_Quantity == '' then if gg.alert2('生成数量错误','生成数量为空','修改配置') == 1 then FHKey_Configurations() return else return end end if FHKey_Length == nil or FHKey_Length == '' then if gg.alert2('生成长度错误','生成长度为空','修改配置') == 1 then FHKey_Configurations() return else return end end if FHKey_Prefix == nil or FHKey_Prefix == '' and FHKey_Prefix_checkbox then if gg.alert2('生成前缀错误','生成前缀为空','修改配置') == 1 then FHKey_Configurations() return else return end end if FHKey_Suffix == nil or FHKey_Suffix == '' and FHKey_Suffix_checkbox then if gg.alert2('生成后缀错误','生成后缀为空','修改配置') == 1 then FHKey_Configurations() return else return end end if FHKey_Prefix_checkbox == false then FHKey_Prefix = '' end if FHKey_Suffix_checkbox == false then FHKey_Suffix = '' end if FHKey_while_StringLength == nil then FHKey_while_StringLength = 45 end if FHKey_Mode == 0 then FHKey_seed = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','n','w','x','y','z','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'} FHKey_while_StringLength = 45 end if FHKey_Mode == 1 then FHKey_seed = {'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'} FHKey_while_StringLength = 16 end if FHKey_Mode == 2 then FHKey_seed = {'-','0','1','2','3','4','5','6','7','8','9','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M','-'} FHKey_while_StringLength = 40 end if FHKey_Mode == 3 then FHKey_seed = {'-','0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','n','w','x','y','z','-'} FHKey_while_StringLength = 40 end if FHKey_Mode == 4 then FHKey_seed = {'-','0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','n','w','x','y','z','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M','-'} FHKey_while_StringLength = 75 end if FHKey_Mode == 5 then FHKey_seed = {'-','0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','n','w','x','y','z','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M','!','?','&','$','%','�','[',']','=','-','+','÷',':','*','(',')','#','¥','_','§','€','^','.','£','×','@','Ä','۟','ۦ'} FHKey_while_StringLength = 90 end FHKey_tb,FHKey_runs,FHKey_value = {},0,'' local loadingBox = getLoadingBox('生成密钥中...\n生成数量:['..FHKey_Quantity..']') loadingBox['显示']() while true do if FHKey_runs == FHKey_Quantity then break end for i = 1,FHKey_Length do table.insert(FHKey_tb,FHKey_seed[math.random(0,FHKey_while_StringLength)]) end FHKey_sid = table.concat(FHKey_tb) FHKey_value2 = FHKey_value..''..FHKey_Prefix..''..FHKey_sid..''..FHKey_Suffix..''..'\n' FHKey_runs = FHKey_runs + 1 FHKey_value = FHKey_value2..'' --gg.toast('正在生成'..FHKey_value2) FHKey_sid,FHKey_tb = '',{} end loadingBox['关闭']() while true do alert = gg.alert2('生成完毕',FHKey_value,'退出','导出卡密','复制卡密') if not alert then gg.toast('请选择') end if alert == 1 then gg.toast('已选择取消 则不导出') return end if alert == 2 then gg.toast('已选择导出') FHKey_FileName = os.date('KeyExport_[%Y/%m/%d-%H:%M:%S] Mode:['..FHKey_Mode..']') Temp_ExportPath = FHKey_OutputPath..'/'..FHKey_FileName..'.txt' if file.write(Temp_ExportPath,FHKey_value) then gg.alert2('导出成功','导出路径:'..Temp_ExportPath) else gg.alert2('导出失败','未知错误','好') end end if alert == 3 then gg.toast('已复制内容') gg.copyText(FHKey_value) end end end function FHKey_Configurations() UI = { '文件输出路径', '生成数量', '卡密长度', '是否开启卡密前缀', '卡密前缀', '是否开启卡密后缀', '卡密后缀', '生成卡密字符串模式 选择对于数字确认模式\n0-fh传统模式 8Fw8pC0bzE\n1-MD5模式 e10adc3949\n2-大写排序模式 ABC-DEF-GHI\n3-小写排序模式 abc-def-ghi\n4-混淆排序模式 aBC-deF-Ghi\n5-FHMD4混淆模式[0;5]' } Config = gg.prompt(UI, {FHKey_OutputPath,FHKey_Quantity,FHKey_Length,FHKey_Prefix_checkbox,FHKey_Prefix,FHKey_Suffix_checkbox,FHKey_Suffix,FHKey_Mode}, {'path','number','number','checkbox','number','checkbox','number','number'}) if not Config then gg.toast('取消') return end if Config then local loadingBox = getLoadingBox('应用配置中...') loadingBox['显示']() FHKey_OutputPath,FHKey_Quantity,FHKey_Length,FHKey_Prefix_checkbox,FHKey_Prefix,FHKey_Suffix_checkbox,FHKey_Suffix,FHKey_Mode = Config[1],Config[2],Config[3],Config[4],Config[5],Config[6],Config[7],Config[8] temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/' if FHKey_OutputPath == nil then else file.write(temp_path..'FHKey_OutputPath.json',FHKey_OutputPath) end if FHKey_Quantity == nil then else file.write(temp_path..'FHKey_Quantity.json',FHKey_Quantity) end if FHKey_Length == nil then else file.write(temp_path..'FHKey_Length.json',FHKey_Length) end if FHKey_Suffix == nil then else file.write(temp_path..'FHKey_Suffix.json',FHKey_Suffix) end if FHKey_Prefix == nil then else file.write(temp_path..'FHKey_Prefix.json',FHKey_Prefix) end if FHKey_Suffix_checkbox == nil then else file.write(temp_path..'FHKey_Suffix_checkbox.json',FHKey_Suffix_checkbox) end if FHKey_Prefix_checkbox == nil then else file.write(temp_path..'FHKey_Prefix_checkbox.json',FHKey_Prefix_checkbox) end if FHKey_Mode == nil then else file.write(temp_path..'FHKey_Mode.json',FHKey_Mode) end loadingBox['关闭']() end gg.setVisible(true) end function switch() FHKey_OutputPath,FHKey_Quantity,FHKey_Length,FHKey_Prefix_checkbox,FHKey_Prefix,FHKey_Suffix_checkbox,FHKey_Suffix,FHKey_Mode = '/storage/emulated/0/',1,10,true,'浮鸿_',false,'无',0 temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_OutputPath.json' if file.exists(temp_path) then FHKey_OutputPath = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Quantity.json' if file.exists(temp_path) then FHKey_Quantity = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Length.json' if file.exists(temp_path) then FHKey_Length = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Prefix.json' if file.exists(temp_path) then FHKey_Prefix = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Suffix.json' if file.exists(temp_path) then FHKey_Suffix = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Mode.json' if file.exists(temp_path) then FHKey_Mode = file.read(temp_path) end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Prefix_checkbox.json' if file.exists(temp_path) then if_FHKey_Prefix_checkbox = file.read(temp_path) if if_FHKey_Prefix_checkbox == 'true' then FHKey_Prefix_checkbox = true end if if_FHKey_Prefix_checkbox == 'false' then FHKey_Prefix_checkbox = false end end temp_path = '/storage/emulated/0/FuHong/configurations/.FHKey/FHKey_Suffix_checkbox.json' if file.exists(temp_path) then if_FHKey_Suffix_checkbox = file.read(temp_path) if if_FHKey_Suffix_checkbox == 'true' then FHKey_Suffix_checkbox = true end if if_FHKey_Suffix_checkbox == 'false' then FHKey_Suffix_checkbox = false end end if FHKey_OutputPath == nil or FHKey_OutputPath == 'nil' then FHKey_OutputPath = '/storage/emulated/0/' end if FHKey_Quantity == nil or FHKey_Quantity == 'nil' then FHKey_Quantity = '1' end if FHKey_Length == nil or FHKey_Length == 'nil' then FHKey_Length = '10' end if FHKey_Prefix == nil or FHKey_Prefix == 'nil' then FHKey_Prefix = '无' end if FHKey_Suffix == nil or FHKey_Suffix == 'nil' then FHKey_Suffix = '无' end if FHKey_Mode == nil or FHKey_Mode == 'nil' then FHKey_Mode = '0' end UI = { '[ - ]开始生成🔛', '[ - ]设置配置🛠️', '[ - ]退出工具🚾' } alert = gg.choice(UI,nil,'生成配置:\n导出路径:['..FHKey_OutputPath..'] 生成数量:['..FHKey_Quantity..']\n生成长度:['..FHKey_Length..'] 卡密前缀:['..FHKey_Prefix..'] 卡密后缀:['..FHKey_Suffix..'] 使用模式:['..FHKey_Mode..']') if alert == 1 then Key_Generate() return end if alert == 2 then FHKey_Configurations() return end if alert == 3 then print('\nFHKey_Tool Exit\n源码零售价:10RMB') FuHongTool_Break = true end end gg.setVisible(true) while true do if FuHongTool_Break then FuHongTool_Break = false break end if gg.isVisible(true) then gg.setVisible(false) switch() end end