Skip to content

Commit d12bc83

Browse files
committed
ANTIED 1.4.3a
commit "a"; added 2 file removed 1 file recode dev tools added credits main; Added key onto build.mjs to handle ORIG NAME
1 parent 3ed6861 commit d12bc83

File tree

12 files changed

+278
-169
lines changed

12 files changed

+278
-169
lines changed

angel/antied/Settings.jsx

Lines changed: 28 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
import { constants, React, ReactNative, stylesheet } from "@vendetta/metro/common";
1+
import { constants, React, ReactNative, stylesheet, NavigationNative } from "@vendetta/metro/common";
22
import { findByName } from '@vendetta/metro';
33
import { useProxy } from "@vendetta/storage";
44
import { storage } from "@vendetta/plugin";
55
import { semanticColors } from "@vendetta/ui";
66
import { Forms, General } from "@vendetta/ui/components";
77
import { getAssetIDByName } from "@vendetta/ui/assets"
88

9+
import ColorPickComponent from './components/colorpick';
10+
import CustomizationComponent from './components/customize';
11+
import IgnoreListComponent from './components/ignorelist';
12+
import NerdComponent from './components/nerd';
913
import PatchesComponent from './components/patches';
1014
import TextComponent from './components/texts';
1115
import TimestampComponent from './components/timestamp';
12-
import ColorPickComponent from './components/colorpick';
13-
import IgnoreListComponent from './components/ignorelist';
14-
import CustomizationComponent from './components/customize';
16+
import CreditsPage from './components/credits';
1517

16-
import updates from "./update";
1718
import bugs from "./knowbug";
1819
import VersionChange from "../../lib/components/versionChange";
1920

@@ -101,6 +102,15 @@ export default function SettingPage() {
101102
const [animation] = React.useState(new Animated.Value(0));
102103
const [isKnownBugOpen, setKnownBugOpen] = React.useState(false)
103104

105+
const navigation = NavigationNative.useNavigation();
106+
107+
const openCreditPage = () => {
108+
navigation.push("VendettaCustomPage", {
109+
title: `Credits & Support`,
110+
render: () => React.createElement(CreditsPage, { styles: styles })
111+
})
112+
}
113+
104114
React.useEffect(() => {
105115
Animated.loop(
106116
Animated.timing(
@@ -138,9 +148,10 @@ export default function SettingPage() {
138148
createChild("timestamp", "Timestamp", "Timestamp Styles", null, TimestampComponent, styles),
139149
createChild("colorpick", "Colors", "Customize Colors", null, ColorPickComponent, styles),
140150
createChild("ingorelist", "Ignore List", "Show IngoreList", null, IgnoreListComponent, null),
151+
createChild("nerd", "Nerd Stuff", "Open Sesami", null, NerdComponent, null, styles),
141152
]
142153

143-
const currentOS = ReactNative?.Platform?.OS || null;
154+
// const currentOS = ReactNative?.Platform?.OS || null;
144155

145156
const entireUIList = (<>
146157
<View style={[ styles.lnBorder, bgStyle, styles.darkMask ]}>
@@ -177,61 +188,13 @@ export default function SettingPage() {
177188
</>)
178189
})
179190
}
180-
<FormDivider />
181-
<FormSection title="Nerd Stuff">
182-
<FormRow
183-
label="Debug"
184-
subLabel="Enable console logging"
185-
style={[styles.padBot]}
186-
trailing={
187-
<FormSwitch
188-
value={storage.debug}
189-
onValueChange={(value) => {
190-
storage.debug = value
191-
}}
192-
/>
193-
}
194-
/>
195-
<FormDivider />
196-
<FormRow
197-
label="Debug updateRows"
198-
subLabel="Enable updateRows console logging"
199-
style={[styles.padBot]}
200-
trailing={
201-
<FormSwitch
202-
value={storage.debugUpdateRows}
203-
onValueChange={(value) => {
204-
storage.debugUpdateRows = value
205-
}}
206-
/>
207-
}
208-
/>
209-
</FormSection>
210-
<FormDivider />
211-
{
212-
updates && (
213-
<FormSection title="Updates">
214-
<View style={{
215-
margin: 5,
216-
padding: 5,
217-
borderRadius: 10,
218-
backgroundColor: "rgba(59, 30, 55, 0.15)"
219-
}}>
220-
{
221-
updates.map((data, index) => {
222-
return <VersionChange change={data} index={index} totalIndex={updates.length}/>
223-
})
224-
}
225-
</View>
226-
</FormSection>
227-
)
228-
}
229-
<FormDivider />
191+
230192
{
231193
bugs && (
232194
<FormSection title="Known Bugs">
233195
<FormRow
234196
label="Click to show those Lady Bug"
197+
style={{padding: 2 }}
235198
onPress={() => {
236199
setKnownBugOpen(!isKnownBugOpen)
237200
}}
@@ -267,30 +230,23 @@ export default function SettingPage() {
267230

268231
return (<>
269232
<ScrollView>
270-
{
271-
/*
272-
(currentOS == "android") ?
273-
(<>
274-
<LinearGradient
275-
start={{x: 0.8, y: 0}}
276-
end={{x: 0, y: 0.8}}
277-
colors={[ "#b8ff34", "#4bff61", "#44f6ff", "#4dafff", "#413dff", "#d63efd" ]}
278-
style={[ styles.lnBorder, styles.shadowTemplate, styles.lnShadow, styles.padBot ]}
279-
>
280-
{entireUIList}
281-
</LinearGradient>
282-
</>) :
283-
(entireUIList)
284-
*/
285-
}
286233
<LinearGradient
287234
start={{x: 0.8, y: 0}}
288235
end={{x: 0, y: 0.8}}
289236
colors={[ "#b8ff34", "#4bff61", "#44f6ff", "#4dafff", "#413dff", "#d63efd" ]}
290237
style={[ styles.lnBorder, styles.shadowTemplate, styles.lnShadow, styles.padBot ]}
291238
>
239+
<FormRow
240+
label="CREDITS"
241+
subLabel="See the people behind the plugin and ways to support its development."
242+
onPress={openCreditPage}
243+
style={[ styles.lnBorder, bgStyle, styles.darkMask ]}
244+
trailing={<FormRow.Icon source={getAssetIDByName("ic_arrow_right")} />}
245+
/>
246+
292247
{entireUIList}
293248
</LinearGradient>
249+
<View style={{ height: 60 }} />
294250
</ScrollView>
295251
</>)
296252
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { storage } from "@vendetta/plugin"
2+
import { useProxy } from "@vendetta/storage"
3+
import { React, url } from "@vendetta/metro/common";
4+
import { Forms, General } from "@vendetta/ui/components";
5+
import { getAssetIDByName } from "@vendetta/ui/assets"
6+
import { findByStoreName } from "@vendetta/metro";
7+
8+
const UserStore = findByStoreName("UserStore");
9+
10+
const { ScrollView, View, Text, TouchableOpacity, TextInput, Pressable, Image, Animated } = General;
11+
const { FormLabel, FormArrow, FormRow, FormSection, FormDivider, FormInput } = Forms;
12+
13+
const me = { name: 'Angel', role: 'Author & Maintainer', uuid: "692632336961110087" };
14+
15+
const qa = [
16+
{ name: 'Rairof', role: 'Quality Assurance', uuid: "923212189123346483" },
17+
{ name: 'Moodle', role: 'Quality Assurance', uuid: "807170846497570848" },
18+
{ name: 'Catinette', role: 'Quality Assurance', uuid: "1302022854740807730" },
19+
{ name: 'Win8.1VMUser', role: "Quality Assurance", uuid: "793935599702507542" }
20+
// { name: 'Dave', role: 'Quality Assurance' }
21+
];
22+
const links = [
23+
{
24+
label: 'Source Code',
25+
url: 'https://github.com/angelix1/MP',
26+
},
27+
{
28+
label: 'Tip via PayPal',
29+
url: 'https://paypal.me/alixymizuki',
30+
},
31+
{
32+
label: 'Buy me a Ko-fi',
33+
url: 'https://ko-fi.com/angel_wolf',
34+
},
35+
];
36+
37+
38+
export default function CreditsPage() {
39+
useProxy(storage)
40+
41+
const open = (uri) => url.openURL(uri).catch(() => {});
42+
43+
const getUser = id => UserStore?.getUser(id) || Object.values(UserStore?.getUsers()).find(u => u.id === id) || null;
44+
45+
const getUserPng = id => {
46+
const u = getUser(id);
47+
return u?.getAvatarURL?.()?.replace('webp', 'png') || null
48+
};
49+
50+
const box = u => (<Image source={{ uri: u }} style={{ width: 40, height: 40, borderRadius: 20 }} />);
51+
52+
return (<>
53+
<ScrollView>
54+
{/* ---- Dev ---- */}
55+
<FormSection title="Developers">
56+
<FormRow
57+
label={me.name}
58+
subLabel={me.role}
59+
leading={box(getUserPng(me?.uuid))}
60+
/>
61+
</FormSection>
62+
63+
{/* ---- QA ---- */}
64+
<FormSection title="Testers">
65+
{qa.map((p, i) => {
66+
67+
const avatarUri = getUserPng(p?.uuid)
68+
69+
return (<FormRow
70+
key={i}
71+
label={p.name}
72+
subLabel={p.role}
73+
leading={avatarUri ? box(avatarUri) : null}
74+
/>)
75+
})}
76+
</FormSection>
77+
<FormDivider />
78+
79+
{/* ---- Links ---- */}
80+
<FormSection title="Support & Source">
81+
<View style={{ margin: 50 }}>
82+
{links.map((l, i) => {
83+
84+
let finalIcon = l.icon ? (
85+
l.icon?.startsWith("https") ?
86+
(<Image source={{ uri: l.icon }} style={{ width: 120, height: 40 }} />) :
87+
(<FormRow.Icon source={getAssetIDByName(l.icon)}/>)
88+
) : null;
89+
90+
91+
return (
92+
<FormRow
93+
key={i}
94+
label={l.label}
95+
leading={finalIcon}
96+
trailing={<FormArrow />}
97+
onPress={() => open(l.url)}
98+
/>
99+
)
100+
})}
101+
</View>
102+
</FormSection>
103+
<FormDivider />
104+
105+
{/* extra bottom pad so last row isn’t hidden by inset */}
106+
<View style={{ height: 40 }} />
107+
</ScrollView>
108+
</>)
109+
}
110+

angel/antied/components/nerd.jsx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { useProxy } from "@vendetta/storage"
2+
import { storage } from "@vendetta/plugin"
3+
import { SelectRow } from "../lib/SelectRow"
4+
import { Forms } from "@vendetta/ui/components"
5+
import { plugin } from "@vendetta";
6+
import { findByName } from "@vendetta/metro";
7+
import { showToast } from "@vendetta/ui/toasts";
8+
9+
const HelpMessage = findByName("HelpMessage");
10+
11+
const { FormRow, FormDivider, FormInput, FormSwitch } = Forms
12+
13+
14+
export default function NerdComponent({ stx }) {
15+
useProxy(storage)
16+
17+
const [plugUri, setPlugUri] = React.useState(plugin.id)
18+
19+
return (<>
20+
<HelpMessage messageType={0}>Changing the plugin URL may redirect future updates to the new source, or prevent updates entirely.</HelpMessage>
21+
<FormInput
22+
title="Change Plugin URL"
23+
keyboardType="default"
24+
placeholder="https://angelix1.github.io/MP/angel/antied"
25+
value={plugUri}
26+
onChange={(val) => {
27+
plugin.id = val?.toString()
28+
setPlugUri(val?.toString())
29+
}}
30+
/>
31+
<FormDivider />
32+
<FormRow
33+
label="Restore original URL"
34+
subLabel="Click to switch to the production build URL (will exit debug version)"
35+
onPress={() => {
36+
plugin.id = "https://angelix1.github.io/MP/angel/antied";
37+
showToast("Plugin URL source restored to original URL.")
38+
}}
39+
/>
40+
<FormDivider />
41+
<FormRow
42+
label="Restore original plugin name"
43+
subLabel="Click to reset to the default name"
44+
onPress={() => {
45+
plugin.manifest.name = plugin.manifest.originalName;
46+
showToast("Plugin Name restored to original name.")
47+
}}
48+
/>
49+
<FormDivider />
50+
<FormRow
51+
label="Debug"
52+
subLabel="Enable general console logging"
53+
style={{ paddingBottom: 20 }}
54+
trailing={
55+
<FormSwitch
56+
value={storage.debug}
57+
onValueChange={(value) => {
58+
storage.debug = value
59+
}}
60+
/>
61+
}
62+
/>
63+
<FormDivider />
64+
<FormRow
65+
label="Debug updateRows"
66+
subLabel="Enable updateRows console logging"
67+
style={{ paddingBottom: 20 }}
68+
trailing={
69+
<FormSwitch
70+
value={storage.debugUpdateRows}
71+
onValueChange={(value) => {
72+
storage.debugUpdateRows = value
73+
}}
74+
/>
75+
}
76+
/>
77+
</>)
78+
}

angel/antied/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ let unpatch = null;
8282
// these value are hardocoded simply i dont trust users would actively keep it low. for their own sake tbf
8383
// old code doesnt have cache limit crash things, yet you expect me makes it customizeable?
8484
let intervalPurge;
85-
const KEEP_NEWEST = 5; // how many we want to keep (newest entry on the list)
86-
const DELETE_EACH_CYCLE = 95; // how many we purge for each cycle
85+
const KEEP_NEWEST = 10; // how many we want to keep (newest entry on the list)
86+
const DELETE_EACH_CYCLE = 140; // how many we purge for each cycle
8787

8888
// timers
8989
let intReg, intTs;
@@ -128,7 +128,9 @@ export default {
128128
}, 15 * 60 * 1000); // 15 min check to purge caches
129129

130130
// apply custom name if override enabled
131-
plugin.manifest.name = storage?.switches?.useCustomPluginName ? storage?.inputs?.customPluginName : plugin.manifest.name;
131+
plugin.manifest.name = storage?.switches?.useCustomPluginName ?
132+
storage?.inputs?.customPluginName :
133+
plugin?.manifest?.name;
132134

133135
},
134136
onUnload: () => {

angel/antied/knowbug.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const knownBugs = [
22
{
3-
bugType: "EDIT",
4-
bugDescription: "Removing Edit Logs with link in it caused a crash"
3+
bugType: "SELF_EDIT_MESSAGE",
4+
bugDescription: "When starting to edit a message, old history gets included. Use BetterBetterChatGestrure Plugin to force edit message using function Antied Watch."
55
},
66
{
7-
bugType: "EDIT",
8-
bugDescription: "in Rare Occasion, edits Patcher can logs multiple edits of same text or Double Fire Func"
7+
bugType: "MESSAGE_DELETION_BOT_DISMISS",
8+
bugDescription: "in Rare Occasion, Delete Patcher can fail to dismiss ephemeral messages, often happens in bot messages."
99
},
1010
]
1111

angel/antied/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"name":"Cute Moodle should get lot of hugs v1.4.3",
3-
"description":"Keeps deleted messages and logs edited messages, until you restart/reloads the app",
2+
"name":"Cute Moodle should get lot of hugs v1.4.3a",
3+
"originalName": "Cute Moodle should get lot of hugs v1.4.3a",
4+
"description":"Keeps a temporary record of deleted messages and any edits until you reload the app.",
45
"main": "index.jsx",
56
"authors": [
67
{

0 commit comments

Comments
 (0)