fca-zoebakaaa 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/.eslintrc.js +35 -0
  2. package/CHANGELOG.md +2 -0
  3. package/Controllers/Remote.js +4 -0
  4. package/DOCS.md +1738 -0
  5. package/Extra/ExtraAddons.js +80 -0
  6. package/Extra/ExtraFindUID.js +62 -0
  7. package/Extra/ExtraGetThread.js +118 -0
  8. package/Extra/ExtraTranslate.js +62 -0
  9. package/Extra/ExtraUptimeRobot.js +62 -0
  10. package/Extra/Html/Classic/script.js +233 -0
  11. package/Extra/Html/Classic/style.css +8 -0
  12. package/Extra/PM2/ecosystem.config.js +23 -0
  13. package/Extra/Security/Index.js +174 -0
  14. package/Extra/Security/Step_1.js +15 -0
  15. package/Extra/Security/Step_2.js +23 -0
  16. package/Extra/Security/Step_3.js +23 -0
  17. package/Extra/Src/History.js +117 -0
  18. package/Extra/Src/Last-Run.js +65 -0
  19. package/Extra/Src/Premium.js +88 -0
  20. package/Extra/Src/SecurityCheck.js +7 -0
  21. package/Extra/database/SyntheticDatabase.sqlite +0 -0
  22. package/Extra/database/index.js +360 -0
  23. package/Extra/logger.js +74 -0
  24. package/Func/AcceptAgreement.js +36 -0
  25. package/Func/ClearCache.js +68 -0
  26. package/Func/ReportV1.js +55 -0
  27. package/README.md +112 -0
  28. package/Settings/Database.js +21 -0
  29. package/Settings/Location.js +59 -0
  30. package/broadcast.js +40 -0
  31. package/index.js +1353 -0
  32. package/logger.js +75 -0
  33. package/package.json +56 -0
  34. package/src/Premium.js +39 -0
  35. package/src/addExternalModule.js +23 -0
  36. package/src/addUserToGroup.js +101 -0
  37. package/src/appstate.json +0 -0
  38. package/src/changeAdminStatus.js +95 -0
  39. package/src/changeArchivedStatus.js +47 -0
  40. package/src/changeAvt.js +95 -0
  41. package/src/changeBio.js +66 -0
  42. package/src/changeBlockedStatus.js +42 -0
  43. package/src/changeGroupImage.js +124 -0
  44. package/src/changeNickname.js +54 -0
  45. package/src/changeThreadColor.js +67 -0
  46. package/src/changeThreadEmoji.js +50 -0
  47. package/src/createNewGroup.js +78 -0
  48. package/src/createPoll.js +66 -0
  49. package/src/deleteMessage.js +51 -0
  50. package/src/deleteThread.js +49 -0
  51. package/src/forwardAttachment.js +53 -0
  52. package/src/getAccessToken.js +36 -0
  53. package/src/getCurrentUserID.js +8 -0
  54. package/src/getEmojiUrl.js +29 -0
  55. package/src/getFriendsList.js +81 -0
  56. package/src/getMessage.js +85 -0
  57. package/src/getThreadHistory.js +633 -0
  58. package/src/getThreadInfo.js +248 -0
  59. package/src/getThreadList.js +276 -0
  60. package/src/getThreadPictures.js +71 -0
  61. package/src/getUID.js +61 -0
  62. package/src/getUserID.js +62 -0
  63. package/src/getUserInfo.js +68 -0
  64. package/src/getUserInfoV2.js +32 -0
  65. package/src/getUserInfoV3.js +72 -0
  66. package/src/getUserInfoV4.js +57 -0
  67. package/src/getUserInfoV5.js +68 -0
  68. package/src/handleFriendRequest.js +47 -0
  69. package/src/handleMessageRequest.js +63 -0
  70. package/src/httpGet.js +54 -0
  71. package/src/httpPost.js +53 -0
  72. package/src/httpPostFormData.js +46 -0
  73. package/src/listenMqtt.js +1056 -0
  74. package/src/logout.js +73 -0
  75. package/src/markAsDelivered.js +54 -0
  76. package/src/markAsRead.js +82 -0
  77. package/src/markAsReadAll.js +47 -0
  78. package/src/markAsSeen.js +58 -0
  79. package/src/muteThread.js +51 -0
  80. package/src/removeUserFromGroup.js +72 -0
  81. package/src/resolvePhotoUrl.js +39 -0
  82. package/src/searchForThread.js +48 -0
  83. package/src/sendMessage.js +429 -0
  84. package/src/sendTypingIndicator.js +83 -0
  85. package/src/setMessageReaction.js +114 -0
  86. package/src/setPostReaction.js +103 -0
  87. package/src/setTitle.js +86 -0
  88. package/src/threadColors.js +40 -0
  89. package/src/toolspincoinmaster +89 -0
  90. package/src/unfriend.js +48 -0
  91. package/src/unsendMessage.js +40 -0
  92. package/utils.js +2244 -0
  93. package/zoebaka.code-workspace +8 -0
@@ -0,0 +1,360 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ /* eslint-disable no-empty */
3
+ /* eslint-disable no-self-assign */
4
+ /* eslint-disable no-redeclare */
5
+ /* eslint-disable no-undef */
6
+ import get from 'lodash/get';
7
+ import set from 'lodash/set';
8
+ import fetch from "node-fetch";
9
+ import BetterDB from "better-sqlite3";
10
+ // eslint-disable-next-line no-undef
11
+ var db = new BetterDB(__dirname + "/SyntheticDatabase.sqlite");
12
+
13
+ export function get(key, ops, forceFuction) {
14
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
15
+ if (!key)
16
+ throw new TypeError(
17
+ "No key specified."
18
+ );
19
+ return arbitrate("fetch", { id: key, ops: ops || {} });
20
+ }
21
+ else return fetch(process.env.REPLIT_DB_URL + "/" + key)
22
+ .then((e) => e.text())
23
+ .then((strValue) => {
24
+ if (ops && ops.raw) return strValue;
25
+ if (!strValue) return null;
26
+ try {
27
+ var value = JSON.parse(strValue);
28
+ } catch (_err) {
29
+ throw new SyntaxError(
30
+ `Failed to parse value of ${key}, try passing a raw option to get the raw value`
31
+ );
32
+ }
33
+ if (value === null || value === undefined) {
34
+ return null;
35
+ }
36
+ return value;
37
+ });
38
+ }
39
+ export function set(key, value, forceFuction) {
40
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
41
+ if (!key)
42
+ throw new TypeError(
43
+ "No key specified."
44
+ );
45
+ return arbitrate("set", {
46
+ stringify: false,
47
+ id: key,
48
+ data: value,
49
+ ops: {},
50
+ });
51
+ }
52
+ else return fetch(process.env.REPLIT_DB_URL, {
53
+ method: "POST",
54
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
55
+ body: encodeURIComponent(key) + "=" + encodeURIComponent(JSON.stringify(value)),
56
+ });
57
+ }
58
+ export function has(key, forceFuction) {
59
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
60
+ if (!key)
61
+ throw new TypeError(
62
+ "No key specified."
63
+ );
64
+ return arbitrate("has", { id: key, ops: {} });
65
+ }
66
+ else return fetch(process.env.REPLIT_DB_URL + "/" + key)
67
+ .then((e) => e.text())
68
+ .then((strValue) => {
69
+ if (strValue === "") return false;
70
+ return true;
71
+ });
72
+ }
73
+ export function DELETE(key, forceFuction) {
74
+ // eslint-disable-next-line no-undef
75
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
76
+ if (!key)
77
+ throw new TypeError(
78
+ "No key specified."
79
+ );
80
+ return arbitrate("delete", { id: key, ops: {} });
81
+ }
82
+ else return fetch(process.env.REPLIT_DB_URL + "/" + key, {
83
+ method: "DELETE",
84
+ });
85
+ }
86
+ export function deleteMultiple(forceFuction, ...args) {
87
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
88
+ if (!key)
89
+ throw new TypeError(
90
+ "No key specified."
91
+ );
92
+ try {
93
+ for (let i of args) {
94
+ arbitrate("delete", { id: i, ops: {} });
95
+ }
96
+ return true;
97
+ }
98
+ catch (err) {
99
+ return false;
100
+ }
101
+ }
102
+ else {
103
+ const promises = [];
104
+
105
+ for (const arg of args) {
106
+ promises.push(this.delete(arg));
107
+ }
108
+
109
+ Promise.all(promises);
110
+
111
+ return this;
112
+ }
113
+ }
114
+ export async function empty(forceFuction) {
115
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
116
+ return arbitrate("clear");
117
+ }
118
+ else {
119
+ const promises = [];
120
+ for (const key of await this.list()) {
121
+ promises.push(this.delete(key));
122
+ }
123
+
124
+ Promise.all(promises);
125
+
126
+ return this;
127
+ }
128
+ }
129
+ export async function list(forceFuction) {
130
+ if (process.env["REPL_ID"] == undefined || forceFuction) {
131
+ return arbitrate("all", { ops: {} });
132
+ }
133
+ else {
134
+ return fetch(
135
+ this.key + `?encode=true&prefix=${encodeURIComponent(true)}`
136
+ )
137
+ .then((r) => r.text())
138
+ .then((t) => {
139
+ if (t.length === 0) {
140
+ return [];
141
+ }
142
+ return t.split("\n").map(decodeURIComponent);
143
+ });
144
+ }
145
+ }
146
+
147
+ var methods = {
148
+ fetch: function(db, params, options) {
149
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
150
+ if (!fetched) return null;
151
+ try {
152
+ fetched = JSON.parse(fetched.json)
153
+ } catch (e) {
154
+ fetched = fetched.json;
155
+ }
156
+ if (params.ops.target) fetched = get(fetched, params.ops.target);
157
+ return fetched;
158
+ },
159
+ set: function(db, params, options) {
160
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
161
+ if (!fetched) {
162
+ db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
163
+ fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
164
+ }
165
+ try {
166
+ fetched = JSON.parse(fetched);
167
+ } catch (e) {
168
+ fetched = fetched;
169
+ }
170
+ if (typeof fetched === 'object' && params.ops.target) {
171
+ params.data = JSON.parse(params.data);
172
+ params.data = set(fetched, params.ops.target, params.data);
173
+ }
174
+ else if (params.ops.target) throw new TypeError('Cannot target a non-object.');
175
+ db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
176
+ let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
177
+ if (newData === '{}') return null;
178
+ else {
179
+ try { newData = JSON.parse(newData);
180
+ }
181
+ catch (e) {
182
+ newData = newData;
183
+ }
184
+ return newData;
185
+ }
186
+ },
187
+ add: function addDB(db, params, options) {
188
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
189
+ if (!fetched) {
190
+ db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
191
+ fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
192
+ }
193
+ if (params.ops.target) {
194
+ try {
195
+ fetched = JSON.parse(fetched)
196
+ }
197
+ catch (e) {
198
+ fetched = fetched;
199
+ }
200
+ let oldValue = get(fetched, params.ops.target);
201
+ if (oldValue === undefined) oldValue = 0;
202
+ else if (isNaN(oldValue)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched}\nEXPECTED: number`);
203
+ params.data = set(fetched, params.ops.target, oldValue + JSON.parse(params.data));
204
+ }
205
+ else {
206
+ if (fetched.json === '{}') fetched.json = 0;
207
+ try {
208
+ fetched.json = JSON.parse(fetched)
209
+ } catch (e) {
210
+ fetched.json = fetched.json;
211
+ }
212
+ if (isNaN(fetched.json)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched.json}\nEXPECTED: number`);
213
+ params.data = parseInt(fetched.json, 10) + parseInt(params.data, 10);
214
+ }
215
+ db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
216
+ let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
217
+ if (newData === '{}') return null;
218
+ else {
219
+ try {
220
+ newData = JSON.parse(newData);
221
+ }
222
+ catch (e) {
223
+ newData = newData;
224
+ }
225
+ return newData;
226
+ }
227
+ },
228
+ subtract: function subtractDB(db, params, options) {
229
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
230
+ if (!fetched) {
231
+ db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
232
+ fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
233
+ }
234
+ if (params.ops.target) {
235
+ try { fetched = JSON.parse(fetched); } catch (e) {}
236
+ params.data = JSON.parse(params.data);
237
+ let oldValue = get(fetched, params.ops.target);
238
+ if (oldValue === undefined) oldValue = 0;
239
+ else if (isNaN(oldValue)) throw new Error('Target is not a number.');
240
+ params.data = set(fetched, params.ops.target, oldValue - params.data);
241
+ } else {
242
+ if (fetched.json === '{}') fetched.json = 0;
243
+ else fetched.json = JSON.parse(fetched.json);
244
+ try { fetched.json = JSON.parse(fetched); } catch (e) {}
245
+ if (isNaN(fetched.json)) throw new Error('Target is not a number.');
246
+ params.data = parseInt(fetched.json, 10) - parseInt(params.data, 10);
247
+ }
248
+ params.data = JSON.stringify(params.data);
249
+ db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
250
+ let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
251
+ if (newData === '{}') return null;
252
+ else {
253
+ try { newData = JSON.parse(newData); } catch (e) {}
254
+ return newData;
255
+ }
256
+ },
257
+ push: function pushDB(db, params, options) {
258
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
259
+ if (!fetched) {
260
+ db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
261
+ fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
262
+ }
263
+ if (params.ops.target) {
264
+ fetched = JSON.parse(fetched.json);
265
+ try { fetched = JSON.parse(fetched) } catch (e) {}
266
+ params.data = JSON.parse(params.data);
267
+ if (typeof fetched !== 'object') throw new TypeError('Cannot push into a non-object.');
268
+ let oldArray = get(fetched, params.ops.target);
269
+ if (oldArray === undefined) oldArray = [];
270
+ else if (!Array.isArray(oldArray)) throw new TypeError('Target is not an array.');
271
+ oldArray.push(params.data);
272
+ params.data = set(fetched, params.ops.target, oldArray);
273
+ } else {
274
+ if (fetched.json === '{}') fetched.json = [];
275
+ else fetched.json = JSON.parse(fetched.json);
276
+ try { fetched.json = JSON.parse(fetched.json); } catch (e) {}
277
+ params.data = JSON.parse(params.data);
278
+ if (!Array.isArray(fetched.json)) throw new TypeError('Target is not an array.');
279
+ fetched.json.push(params.data);
280
+ params.data = fetched.json;
281
+ }
282
+ params.data = JSON.stringify(params.data);
283
+ db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
284
+ let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
285
+ if (newData === '{}') return null;
286
+ else {
287
+ newData = JSON.parse(newData)
288
+ try { newData = JSON.parse(newData) } catch (e) {}
289
+ return newData
290
+ }
291
+ },
292
+ delete: function deleteDB(db, params, options) {
293
+ const unset = require('lodash/unset');
294
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
295
+ if (!fetched) return false;
296
+ else fetched = JSON.parse(fetched.json);
297
+ try { fetched = JSON.parse(fetched); } catch (e) {}
298
+ if (typeof fetched === 'object' && params.ops.target) {
299
+ unset(fetched, params.ops.target);
300
+ fetched = JSON.stringify(fetched);
301
+ db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(fetched, params.id);
302
+ return true;
303
+ }
304
+ else if (params.ops.target) throw new TypeError('Target is not an object.');
305
+ else db.prepare(`DELETE FROM ${options.table} WHERE ID = (?)`).run(params.id);
306
+ return true;
307
+ },
308
+ has: function hasDB(db, params, options) {
309
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
310
+ if (!fetched) return false;
311
+ else fetched = JSON.parse(fetched.json);
312
+ try { fetched = JSON.parse(fetched) } catch (e) {}
313
+ if (params.ops.target) fetched = get(fetched, params.ops.target);
314
+ return (typeof fetched != 'undefined');
315
+ },
316
+ all: function allDB(db, params, options) {
317
+ var stmt = db.prepare(`SELECT * FROM ${options.table} WHERE ID IS NOT NULL`);
318
+ let resp = [];
319
+ for (var row of stmt.iterate()) {
320
+ try {
321
+ resp.push({
322
+ ID: row.ID,
323
+ data: JSON.parse(row.json)
324
+ });
325
+ }
326
+ catch (e) {
327
+ return [];
328
+ }
329
+ }
330
+ return resp;
331
+ },
332
+ type: function typeDB(db, params, options) {
333
+ let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
334
+ if (!fetched) return null; // If empty, return null
335
+ fetched = JSON.parse(fetched.json);
336
+ try { fetched = JSON.parse(fetched); } catch (e) {}
337
+ if (params.ops.target) fetched = get(fetched, params.ops.target); // Get prop using dot notation
338
+ return typeof fetched;
339
+ },
340
+ clear: function clearDB(db, params, options) {
341
+ let fetched = db.prepare(`DELETE FROM ${options.table}`).run();
342
+ if(!fetched) return null;
343
+ return fetched.changes;
344
+
345
+ }
346
+ };
347
+
348
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
349
+ function arbitrate(method, params, tableName) {
350
+ let options = {table: "json"};
351
+ db.prepare(`CREATE TABLE IF NOT EXISTS ${options.table} (ID TEXT, json TEXT)`).run();
352
+ if (params.ops.target && params.ops.target[0] === ".") params.ops.target = params.ops.target.slice(1); // Remove prefix if necessary
353
+ if (params.data && params.data === Infinity) throw new TypeError(`You cannot set Infinity into the database @ ID: ${params.id}`);
354
+ if (params.id && typeof params.id == "string" && params.id.includes(".")) {
355
+ let unparsed = params.id.split(".");
356
+ params.id = unparsed.shift();
357
+ params.ops.target = unparsed.join(".");
358
+ }
359
+ return methods[method](db, params, options);
360
+ }
@@ -0,0 +1,74 @@
1
+ /* eslint-disable linebreak-style */
2
+
3
+ import { bold } from 'chalk';
4
+ function randomColor() {
5
+ var color = "";
6
+ for (var i = 0; i < 3; i++) {
7
+ var sub = Math.floor(Math.random() * 256).toString(16);
8
+ color += (sub.length == 1 ? "0" + sub : sub);
9
+ }
10
+ return "#" + color;
11
+ }
12
+ import isHexcolor from 'is-hexcolor';
13
+ var getText = function(/** @type {string[]} */ ...Data) {
14
+ var Main = (Data.splice(0,1)).toString();
15
+ for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
16
+ return Main;
17
+ };
18
+ /**
19
+ * @param {any} obj
20
+ */
21
+ function getType(obj) {
22
+ return Object.prototype.toString.call(obj).slice(8, -1);
23
+ }
24
+
25
+ export function Normal(/** @type {string} */ Str, /** @type {() => any} */ Data, /** @type {() => void} */ Callback) {
26
+ if (isHexcolor(globalThis.Fca.Require.FastConfig.MainColor) != true) {
27
+ // eslint-disable-next-line no-undef
28
+ this.Warning(getText(globalThis.Fca.Require.Language.Index.InvaildMainColor, globalThis.Fca.Require.FastConfig.MainColor), process.exit(0));
29
+ }
30
+
31
+ else
32
+ console.log(bold.hex(randomColor()).bold(`${globalThis.Fca.Require.FastConfig.MainName || '[ FCA-ZOE ]'} > ` + Str));
33
+ if (getType(Data) == 'Function' || getType(Data) == 'AsyncFunction') {
34
+ return Data();
35
+ }
36
+ if (Data) {
37
+ return Data;
38
+ }
39
+ if (getType(Callback) == 'Function' || getType(Callback) == 'AsyncFunction') {
40
+ Callback();
41
+ }
42
+ else return Callback;
43
+ }
44
+ export function Warning(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
45
+ console.log(bold.hex(randomColor()).bold('[ FCA-WARNING ] > ' + str));
46
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
47
+ callback();
48
+ }
49
+ else return callback;
50
+ }
51
+ export function Error(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
52
+ if (!str) {
53
+ console.log(bold.hex(randomColor()).bold('[ FCA-ERROR ] > ' + "Đã xảy ra lỗi, vui lòng liên hệ: facebook.com/dongdev"));
54
+ }
55
+ console.log(bold.hex(randomColor()).bold('[ FCA ] > ' + str));
56
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
57
+ callback();
58
+ }
59
+ else return callback;
60
+ }
61
+ export function Success(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
62
+ console.log(bold.hex(randomColor()).bold(`${globalThis.Fca.Require.FastConfig.MainName || '[ FCA-PMD ]'} > ` + str));
63
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
64
+ callback();
65
+ }
66
+ else return callback;
67
+ }
68
+ export function Info(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
69
+ console.log(bold.hex(randomColor()).bold(`${globalThis.Fca.Require.FastConfig.MainName || '[ FCA-PMD ]'} > ` + str));
70
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
71
+ callback();
72
+ }
73
+ else return callback;
74
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
+ import utils from "../utils";
5
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
+ import log from "npmlog";
7
+
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ export default function (_defaultFuncs, api, ctx) {
10
+ return function (args,callback) {
11
+ var resolveFunc = function () { };
12
+ var rejectFunc = function () { };
13
+ var returnPromise = new Promise(function (resolve, reject) {
14
+ resolveFunc = resolve;
15
+ rejectFunc = reject;
16
+ });
17
+
18
+ if (!callback) {
19
+ callback = function (err, data) {
20
+ if (err) return rejectFunc(err);
21
+ resolveFunc(data);
22
+ };
23
+ }
24
+ // eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef
25
+ var Database = require('zoesensei-database');
26
+ if (Database.get('agreement', {}, true) == true) {
27
+ callback(null, "Accecpt");
28
+ }
29
+ else {
30
+ Database.set('agreement', true,true);
31
+ var Form = "=== Horizon end-user license agreement ===\n\nVietNamese: Khi bạn dùng module/file này, nghĩa là bạn đã đồng ý cho sự tổn hại, mất mát, bị chia sẻ appstate,... của bạn, chúng tôi sẽ có toàn quyền với file bạn\nViệc bạn sử dụng một cách đúng giấy phép,... bạn cứ yên tâm, chúng tôi sẽ không làm tổn hại, mất mát,...,Việc bạn sử dụng sai quy chế của giấy phép, bạn có thể phải trả giá bằng File, AppState,... của bạn!\nNếu bạn không chấp nhận được, bạn có thể xóa file này ngay lập tức !\n[+] Bạn Sẽ Bị Xử Lý Nếu Trong Những Trường Hợp Như Sau: Sài File Leak, Key Leak, Troll,Đăng Cho Nhiều Người,..( và một số trường hợp chưa hiện hữu )\n\nEnglish: When you use this module/file, you have given your consent to the harm, loss, and sharing of the appstate,...We will have full rights with your file\nYou use the correct license,...Rest assured, we will not harm or lose,...,You misuse the statute of the license, you may have to pay the price in FileAppState,... yours!\nIf you can't accept it, you can delete this file immediately !\n[+] You will be dealt with if in the following cases: File Leak, Key Leak,Troll Post to multiple people,.. ( and some cases do not yet exist )\n\n=== GOOD LUCK ☕ ===";
32
+ callback(null, Form);
33
+ }
34
+ return returnPromise;
35
+ }
36
+ }
@@ -0,0 +1,68 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable no-useless-escape */
3
+ /* eslint-disable no-redeclare */
4
+ "use strict";
5
+ import { execSync } from 'child_process';
6
+ import { getType } from "../utils";
7
+ import { Normal, Error } from "../logger";
8
+ var Object = ['png','json','wav','mp3','mp4','jpg','txt','gif','tff','m4a'];
9
+ var Recommend = ['png','wav','mp3','mp4','jpg','m4a'];
10
+ export default function (defaultFuncs, api, ctx) {
11
+ return function (Args,callback) {
12
+ let New1 = [];
13
+ if (!Args.New || getType(Args.New) !== "Array") {
14
+ New1 = Recommend;
15
+ Normal("No Adding Add, Proceed to Use According to Al Designated System !");
16
+ }
17
+ else {
18
+ for (let i = 0; i < Args.New.length; i++) {
19
+ if (Object.indexOf(Args.New[i]) === -1) {
20
+ Normal('Không tìm thấy file ' + Args.New[i] + ' trong danh sách định dạng');
21
+ return;
22
+ }
23
+ New1.push(Args.New[i]);
24
+ }
25
+ }
26
+ var resolveFunc = function () { };
27
+ var rejectFunc = function () { };
28
+ var returnPromise = new Promise(function (resolve, reject) {
29
+ resolveFunc = resolve;
30
+ rejectFunc = reject;
31
+ });
32
+
33
+ if (!callback) {
34
+ callback = function (err, data) {
35
+ if (err) return rejectFunc(err);
36
+ resolveFunc(data);
37
+ };
38
+ }
39
+ // eslint-disable-next-line no-undef
40
+ switch (process.platform) {
41
+ case 'linux': {
42
+ for (let i = 0; i < New1.length; i++) {
43
+ Normal('Đang Clear Loại File ' + New1[i]);
44
+ var STR = String(`find ./modules -type f -iname \'*.${New1[i]}\' -exec rm {} \\;`)
45
+ execSync(STR);
46
+ }
47
+ Normal('Thành Công Clear ' + New1.length + ' Loại File !');
48
+ callback(null, 'Thành Công Clear ' + New1.length + ' Loại File !');
49
+ }
50
+ break;
51
+ case "win32": {
52
+ var cmd = "del /q /s /f /a ";
53
+ for (let i = 0; i < New1.length; i++) {
54
+ Normal('Đang Clear Loại File ' + New1[i]);
55
+ var STR = String(cmd + '.\\modules\\*.' + New1[i] + '\"')
56
+ execSync(STR, { stdio: 'inherit' });
57
+ }
58
+ Normal('Thành Công Clear ' + New1.length + ' Loại File !');
59
+ callback(null, 'Thành Công Clear ' + New1.length + ' Loại File !');
60
+ }
61
+ // eslint-disable-next-line no-fallthrough
62
+ default: {
63
+ return Error('Not Supported');
64
+ }
65
+ }
66
+ return returnPromise;
67
+ }
68
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ import { get, getType, getFrom, parseAndCheckLogin } from "../utils";
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ import log from "npmlog";
6
+
7
+ export default function (defaultFuncs, api, ctx) {
8
+ return function (args,callback) {
9
+ if (!args.Link && !args.RealName && !args.Content && !args.Gmail) throw new Error("Link,RealName,Content,Gmail are required");
10
+ if (!args.Link) throw new Error("Điền args.Link vào, api.Premium.ReportV1(Link,RealName,Content,Gmail,Time,callback)");
11
+ if (!args.RealName) throw new Error("Điền RealName vào, api.Premium.ReportV1(Link,RealName,Content,Time,Gmail,callback)");
12
+ if (!args.Gmail) throw new Error("Điền Gmail vào, api.Premium.ReportV1(Link,RealName,Content,Gmail,Time,callback)");
13
+ var resolveFunc = function () { };
14
+ var rejectFunc = function () { };
15
+ var returnPromise = new Promise(function (resolve, reject) {
16
+ resolveFunc = resolve;
17
+ rejectFunc = reject;
18
+ });
19
+
20
+ if (!callback) {
21
+ callback = function (err, data) {
22
+ if (err) return rejectFunc(err);
23
+ resolveFunc(data);
24
+ };
25
+ }
26
+ let RealForm;
27
+ get('https://www.facebook.com/help/contact/209046679279097?locale2=en_US', ctx.jar, null, ctx.globalOptions)
28
+ .then(function(data) {
29
+ RealForm = {
30
+ crt_url: args.Link,
31
+ crt_name: args.RealName,
32
+ cf_age: "9 years",
33
+ Field255260417881843: args.Content ? getType(args.Content)=="String"? args.Content : "This timeline is impersonating me and my friends. It harass people on Facebook. I think this is a time line of baby, parents are not allowed. Please let Facebook account deactivated for Facebook is increasingly safer. Thank you!" : "This timeline is impersonating me and my friends. It harass people on Facebook. I think this is a time line of baby, parents are not allowed. Please let Facebook account deactivated for Facebook is increasingly safer. Thank you!",
34
+ Field166040066844792: args.Gmail,
35
+ source: '',
36
+ support_form_id: 209046679279097,
37
+ support_form_hidden_fields: JSON.stringify({}),
38
+ support_form_fact_false_fields: [],
39
+ lsd: getFrom(data.body, "[\"LSD\",[],{\"token\":\"", "\"}")
40
+ };
41
+ }).then(function() {
42
+ defaultFuncs.postFormData('https://www.facebook.com/ajax/help/contact/submit/page', ctx.jar, RealForm, {})
43
+ .then(parseAndCheckLogin(ctx, defaultFuncs))
44
+ .then(async function(dt) {
45
+ if (dt.__ar == 1) {
46
+ callback(null, "Thành Công");
47
+ }
48
+ else {
49
+ callback(null, "Thất Bại");
50
+ }
51
+ });
52
+ })
53
+ return returnPromise;
54
+ }
55
+ }