-
Notifications
You must be signed in to change notification settings - Fork 0
/
inject.js
213 lines (167 loc) ยท 6.4 KB
/
inject.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
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
205
206
207
208
209
210
211
212
213
if (workspace.className.startsWith("๐๐๐๐๐๐ฅ๐๐-workspace") || workspace.className.startsWith("inst-workspace")) {
console.log("%c๐๐ก๐๐ง๐ค ๐ฒ๐จ๐ฎ ๐๐จ๐ซ ๐ฎ๐ฌ๐ข๐ง๐ ๐๐๐ฎ๐ก๐๐ฌ๐ฌ๐๐ซ๐ข๐ฉ๐ญ.", "color: red; font-size: 20px;");
console.log("Bauhasscript is currently injecting into Dash...");
document.getElementsByClassName("dashBarLeft")[0].className = "dashBarLeft inactive";
var newList = [];
appList.forEach(item => {
if (item.name.startsWith("๐๐๐๐๐๐ฅ๐๐") || item.name.startsWith("inst")) {
} else {
newList.push(item);
}
});
appList = newList;
appList.push({
name: "/be-resp",
label: "Respring Dash",
entry: "/inject.js",
icon: "/images/delete.svg"
})
appList.push({
name: "/be-raa",
label: "Remove all apps",
entry: "/inject.js",
icon: "/images/delete.svg"
})
appList.push({
name: "/be-dcw",
label: "Clear traces",
entry: "/inject.js",
icon: "/images/delete.svg"
})
appList.push({
name: "/be-amgr",
label: "Manage Apps",
entry: "/inject.js",
icon: "/images/delete.svg"
})
appList.push({
name: "/be-console",
label: "Console",
entry: "/inject.js",
icon: "/images/delete.svg"
});
appList.push({
name: "/be-exp",
label: "Experiments",
entry: "/inject.js",
icon: "/images/delete.svg"
});
setTimeout(() => {
document.getElementsByClassName("dashBarLeftItems")[0].innerHTML = ``;
setupAppButtons();
document.getElementsByClassName("dashBarLeft")[0].className = "dashBarLeft"
}, 1000)
}
if (workspace.className.startsWith("/be-raa-workspace")) {
workspace.innerText += ("Removing all apps, this should not take more than a few milliseconds.");
var newList = [];
newList.push({
name: "pad-app",
label: "Padding App",
entry: "/inject.js",
icon: "/"
})
newList.push({
entry: "/inject.js",
icon: "/images/unlocked_holo.svg",
label: "Install Bauhas",
name: "inst",
})
newList.push({
entry: "/inject.js",
icon: "/images/logo@0.5x.png",
label: "Install Ceccun Apps",
name: "ccn-apps",
})
appList.forEach(item => {
workspace.innerText += `\nClearing ${item.name}`
});
workspace.innerText += `\n\nMerging changes`;
appList = newList;
workspace.innerText += `\nDone`
alert("Some apps may contain trace-data in them as their workspaces are still active. You'll need to clean to remove those permanently.");
alert("Now attempting to respring.")
document.getElementsByClassName("dashBarLeftItems")[0].innerHTML = ``;
setupAppButtons();
}
if (workspace.className.startsWith("/be-resp-workspace")) {
alert("Attempting to respring.")
document.getElementsByClassName("dashBarLeftItems")[0].innerHTML = ``;
setupAppButtons();
}
if (workspace.className.startsWith("/be-amgr-workspace")) {
if (created == 1) {
var input = document.createElement("textarea");
input.innerText = JSON.stringify(appList).replace(",", `,\n`);
input.addEventListener("keyup", () => {
appList = JSON.parse(input.value);
})
workspace.appendChild(input)
}
}
if (workspace.className.startsWith("/be-console-workspace")) {
if (created == 1) {
var myIndex = 0;
var input1 = document.createElement("input");
input1.placeholder = "Enter your command here.";
input1.id = "1in";
var input2 = document.createElement("input");
input2.id = "2in";
input2.placeholder = "Type app index";
var button = document.createElement("button");
button.innerText = "Execute";
var astatus = document.createElement("p");
astatus.innerText = "Status: Ready";
astatus.id = "statusin"
button.addEventListener("click", () => {
var v1 = document.getElementById("1in").value;
var v2 = Number.parseInt(document.getElementById("2in").value);
document.getElementById("statusin").innerText = "Status: Running";
launch(v2);
launch(myIndex);
var backup = appList[v2].script;
appList[v2].script = Function("element", "created", v1);
try {
launch(v2);
launch(myIndex);
document.getElementById("statusin").innerText = "Status: Restoring Environment";
appList[v2].script = backup;
document.getElementById("statusin").innerText = "Status: Done!";
} catch (error) {
document.getElementById("statusin").innerText = "Status: Reverting back to last known script.";
appList[v2].script = backup;
document.getElementById("statusin").innerText = `Status: ERROR! Your script failed to run. Some changes may remain, but the environment has been restored.\n\n${error}`;
}
})
workspace.appendChild(input1)
workspace.appendChild(input2)
workspace.appendChild(button)
workspace.appendChild(astatus)
}
}
if (workspace.className.startsWith("ccn-apps")) {
document.getElementsByClassName("dashBarLeft")[0].className = "dashBarLeft inactive";
fetch("/constants/apps.json").then((response) => {
if (response.status == 200) {
response.json().then((availApps) => {
availApps.forEach(item => {
appList.push(item);
});
document.getElementsByClassName("dashBarLeftItems")[0].innerHTML = '';
setupAppList();
document.getElementsByClassName("dashBarLeft")[0].className = "dashBarLeft";
});
}
});
}
if (workspace.className.startsWith("/be-dcw")) {
const before = document.getElementsByClassName("workspace")[0].innerHTML;
document.getElementsByClassName("workspace")[0].innerHTML = ``;
launch(0);
const now = document.getElementsByClassName("workspace")[0].innerHTML;
alert(`Traces cleared (${before.length - now.length} bytes freed)`)
}
if (workspace.className.startsWith("/be-exp")) {
if (created == 1) {
}
}