This repository has been archived by the owner on Oct 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathindex.html
executable file
·204 lines (203 loc) · 9.59 KB
/
index.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html>
<head>
<title>JSDec - Liulihaocai</title>
<meta charset="utf-8"/>
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon"/>
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<script src="https://cdn.jsdelivr.net/gh/liulihaocai/EasyCopy/copy.min.js"></script>
<script src="https://cdn.bootcss.com/FileSaver.js/1.3.8/FileSaver.min.js"></script>
<script src="./js/beautify.js"></script>
<script src="./js/uglifyjs.js"></script>
<script src="./js/dec.js"></script>
<script src="./js/functions.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
<link href="./css/font.css" rel="stylesheet">
</head>
<body>
<div id="app">
<v-app id="inspire" class="saof">
<v-navigation-drawer
v-model="drawer"
app
>
<v-list-item-group v-model="item" color="primary">
<v-list nav dense v-for="item in listitems">
<template v-if="item.fg">
<v-list-item v-on:click="item.onc">
<v-list-item-icon>
<v-icon v-text="item.icon"></v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="item.text"></v-list-item-title>
</v-list-item-content>
</template>
<template v-else>
<v-subheader>{{ item.fgt }}</v-subheader>
<v-divider></v-divider>
</template>
</v-list-item>
</v-list>
</v-list-item-group>
</v-navigation-drawer>
<v-app-bar
app
color="primary"
dark
>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>JSDec</v-toolbar-title><v-spacer></v-spacer>
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<v-btn color="#FFFFFF" dark v-bind="attrs" v-on="on" text><v-icon left>mdi-translate</v-icon>{{ lang.nowlang }}</v-btn>
</template>
<v-list>
<v-list-item
v-for="(item, index) in Langs"
:key="index"
@click="item.onc"
>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-app-bar>
<v-main>
<template>
<div style="height: 3%;"></div>
<v-card max-width="95%" class="mx-auto">
<v-alert dense v-if="lang.al.error" border="left" type="error" close-icon="mdi-close" dismissible>{{ lang.al.t }}</v-alert>
<v-alert dense v-if="lang.al.info" border="left" type="info" close-icon="mdi-close" dismissible>{{ lang.al.t }}</v-alert>
<v-alert dense v-if="lang.al.success" border="left" type="success" close-icon="mdi-close" dismissible>{{ lang.al.t }}</v-alert>
<v-alert dense v-if="lang.al.warning" border="left" type="warning" close-icon="mdi-close" dismissible>{{ lang.al.t }}</v-alert>
</v-card>
<v-card class="mx-auto" max-width="95%" height="300px" outlined>
<textarea placeholder="Put the encoded JavaScript in" id="needenc" class="codef" style="width: 100%;cursor: pointer;height: 300px;border: solid 0px;outline:none;resize: none;"></textarea>
</v-card>
<v-container>
<v-select
v-model="nowenc"
label="Plz choose a type of progcess"
:items="lang.enc"
>
<template
slot="item"
slot-scope="data"
>
<v-list-tile-content>
<v-list-tile-title v-html="data.item"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-select>
<v-btn class="ma-2" color="primary" v-on:click="sdec">{{ lang.startdec }}</v-btn><v-btn class="ma-2" color="primary" v-on:click="ujs">{{ lang.upload }}</v-btn><v-btn class="ma-2" color="primary" v-on:click="cres">{{ lang.copyres }}</v-btn><v-btn class="ma-2" color="primary" onclick="document.getElementById('encres').value='';document.getElementById('needenc').value=''">{{ lang.clearres }}</v-btn><v-btn class="ma-2" color="primary" v-on:click="dres">{{ lang.downres }}</v-btn>
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<v-btn dark v-bind="attrs" v-on="on" color="primary">{{ lang.prores }}<v-icon>mdi-menu-down</v-icon></v-btn>
</template>
<v-list>
<v-list-item
v-for="(item, index) in progcesses"
:key="index"
@click="item.onc"
>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-container>
<v-card
class="mx-auto"
max-width="95%"
height="300px"
outlined
>
<textarea placeholder="Decode Result" id="encres" class="codef" style="width: 100%;cursor: pointer;height: 300px;border: solid 0px;outline:none;resize: none;"></textarea>
</v-card>
<div style="height:50px;"></div>
</template>
</v-main>
<v-footer
color="primary"
app
>
<span class="white--text">JSDec by liulihaocai</span>
<v-spacer></v-spacer>
<span class="white--text">© {{ fullyear }}</span>
</v-footer>
</v-app>
</div>
<div id="rcp"></div>
<input type="file" name="file" id="fileId" style="display: none;" />
<script>
var vue= new Vue({
el: '#app',
vuetify: new Vuetify({theme:{themes:{light:{primary:"#F8A912",},},},}),
data:{
lang:thislang,
drawer: false,
fullyear: new Date().getFullYear(),
item:0,
sdec:function(){
try{if(document.getElementById("needenc").value.replace(/ /g,"")==""){st('Failed!\n'+thislang.inputsth)}
else if(vue.nowenc==vue.lang.enc[0]){stimer();st(autoscan(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[1]){stimer();st(js_beautify(document.getElementById("needenc").value,{unescape_strings:true}))}
else if(vue.nowenc==vue.lang.enc[2]){stimer();st(UglifyJS.minify(document.getElementById("needenc").value).code)}
else if(vue.nowenc==vue.lang.enc[3]){stimer();st(uneval(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[4]){stimer();st(aadecode(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[5]){stimer();st(jjdecode(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[6]){stimer();st(decjsf(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[7]){stimer();st(decsojson4(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[8]){stimer();st(decsojsonp(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[9]){stimer();st(obdec_default(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[10]){stimer();st(dec_list(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[11]){stimer();st(dec_sojsonv5_default(document.getElementById("needenc").value))}
else if(vue.nowenc==vue.lang.enc[12]){stimer();st(dec_jsjiamiv6_default(document.getElementById("needenc").value))}
}catch(e){st('Failed!\n'+e)}
},
cres:function(){
rcp.copy(document.getElementById("encres").value)
},
ujs:function(){
document.getElementById("fileId").click();
},
dres:function(){
var blob = new Blob([document.getElementById("encres").value], {type: "text/plain;charset=utf-8"});saveAs(blob, "JSDec_"+rand_str(6)+".js")
},
nowenc:thislang.enc[0],
listitems:[
{fg:false,fgt:thislang.tools},
{fg:true,icon:"mdi-home",text:thislang.jsdecode,onc:function(){location.href="./index.html"}},
{fg:true,icon:"mdi-book",text:thislang.help,onc:function(){window.open("./help")}},
{fg:false,fgt:thislang.about},
{fg:true,icon:"mdi-history",text:thislang.updlog,onc:function(){location.href="./upd.html"}},
// {fg:true,icon:"mdi-heart-flash",text:"赞助作者",onc:function(){location.href="./donate.html"}},
{fg:true,icon:"mdi-github",text:thislang.gh,onc:function(){window.open("https://github.com/liulihaocai/JSDec")}},
],
Langs:Wlangs,
progcesses:[
{title:thislang.p.beautify,onc:function(){stimer();st(js_beautify(document.getElementById("encres").value,{unescape_strings:true}))}},
{title:thislang.p.uglify1,onc:function(){stimer();st(UglifyJS.minify(document.getElementById("encres").value,{compress:false}).code)}},
{title:thislang.p.uglify2,onc:function(){stimer();st(UglifyJS.minify(document.getElementById("encres").value,{compress:{keep_fnames:true},mangle:{keep_fnames:true},keep_fnames:true,output:{beautify:true,ascii_only:true}}).code)}},
]
}
})
var rcp=EasyCopy.create("rcp")
document.getElementById("fileId").addEventListener('change',
function() {
var objFile = document.getElementById("fileId");
var files = document.getElementById('fileId').files;
if (files.length != 0) {
var reader = new FileReader();
reader.readAsText(files[0], "UTF-8");
reader.onload = function(evt) {
document.getElementById("needenc").value=evt.target.result;
}
}
})
</script>
</body>
</html>