-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtyrantgenesis.js
92 lines (78 loc) · 2.89 KB
/
tyrantgenesis.js
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
const BASE_URL = "https://git.tyrantg.com/tyrantgenesis/hikerViewRules/raw/master/"
const collection_password = "海阔视界,首页频道合集¥home_rule_url¥"
const rule_password = "海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥"
const baseParse = _ => {
let res = {};
let d = [];
const script = fetch(MY_URL);
const data_json = fetch('hiker://files/TyrantG/data/base.json');
const data = JSON.parse(data_json)
let fst_rule_list = []
let snd_rule_list = []
eval(script);
d.push({
title: '跑路了,崩撤卖溜',
url: 'https://git.tyrantg.com/tyrantgenesis/hikerViewRules',
col_type: 'text_1'
})
d.push({
pic_url: 'http://test-homepage.dev.tyrantg.com/img/llll.gif',
url: 'http://test-homepage.dev.tyrantg.com/img/llll.gif',
col_type: 'pic_1_full'
})
data.forEach(rule => {
fst_rule_list = []
rule.data.forEach(item => {
item.rules.forEach(each => {
fst_rule_list.push(each.rule)
})
})
writeFile("hiker://files/TyrantG/Temporary/"+rule.title+".json", JSON.stringify(fst_rule_list));
d.push({
title: rule.title,
url: "rule://"+base64Encode(collection_password+"hiker://files/TyrantG/Temporary/"+rule.title+".json").replace(/\n/g, ''),
col_type: 'text_center_1'
});
rule.data.forEach(item => {
snd_rule_list = []
item.rules.forEach(each => {
snd_rule_list.push(each.rule)
})
writeFile("hiker://files/TyrantG/Temporary/"+rule.title+"/"+item.title+".json", JSON.stringify(snd_rule_list));
d.push({
title: item.title,
url: "rule://"+base64Encode(collection_password+"hiker://files/TyrantG/Temporary/"+rule.title+"/"+item.title+".json").replace(/\n/g, ''),
col_type: 'text_2'
});
item.rules.forEach(each => {
d.push({
title: each.title,
url: "rule://"+base64Encode(rule_password+JSON.stringify(each.rule)).replace(/\n/g, ''),
col_type: 'flex_button'
})
})
d.push({
col_type: 'line'
});
})
d.push({
col_type: 'line_blank'
});
})
res.data = d;
setHomeResult(res);
}
const homePage = _ => {
let hikerRules = getLastRules(12), rules = []
hikerRules.forEach(item => {
rules.push(item.title)
})
putVar('tyrantgenesis.rules', JSON.stringify(rules))
let d = [];
d.push({
desc: '100% && float',
url: 'file:///storage/emulated/0/Android/data/com.example.hikerview/files/Documents/TyrantG/public/Home.html?time='+(new Date()).getTime(),
col_type:"x5_webview_single"
})
setResult(d);
}