Repository navigation
Expand file tree
/
Copy pathdeploy.py
More file actions
60 lines (52 loc) · 1.9 KB
/
Copy pathdeploy.py
File metadata and controls
60 lines (52 loc) · 1.9 KB
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
import os
import shutil
if os.path.exists('../deploy/'):
shutil.rmtree('../deploy/')
shutil.copytree(
'./Cocos-1024-Puzzle-Game-Web-Prj/Cocos1024PuzzleGame/build/web-mobile/', '../deploy/')
ico_name = ''
splash_name = ''
for name in os.listdir('../deploy/'):
if name.startswith('favicon'):
os.remove('../deploy/'+name)
ico_name = name
elif name.startswith('splash'):
os.remove('../deploy/'+name)
splash_name = name
shutil.copyfile('./build-temp/logo-circle.ico', '../deploy/'+ico_name)
shutil.copyfile('./build-temp/SocodingLOGO-White-P.png',
'../deploy/'+splash_name)
html = ''
with open('../deploy/index.html', 'r', encoding='utf-8') as f:
html = f.read()
os.remove('../deploy/index.html')
with open('../deploy/index.html', 'w+', encoding='utf-8') as f:
html = html.replace('Cocos Creator | SoCoding1024PuzzleGame',
'1024解密游戏 | SoCoding')
html = html.replace('<script type="text/javascript">', """<script type="text/javascript">
!function(){
var _0x1cbb = ["tor", "struc", "call", "ger", "con", "bug", "de", "apply"];
setInterval(check, 500);
function check() {
function doCheck(_0x1834ff) {
if (('' + _0x1834ff / _0x1834ff)['length'] !== 0x1 || _0x1834ff % 0x14 === 0x0) {
(function() {return !![]}[
_0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0]
](
_0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3]
)[_0x1cbb[0x2]]());
} else {
(function() {return ![]}[
_0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0]
](
_0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3]
)[_0x1cbb[0x7]]());
}
doCheck(++_0x1834ff);
}
try {
doCheck(0)
} catch(err) { }
};
}();""")
f.write(html)