Skip to content

Commit 9040e34

Browse files
committed
azzyutil fix and antied
1 parent 470ec09 commit 9040e34

14 files changed

Lines changed: 254 additions & 107 deletions

File tree

angel/antied/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name":"Antied v1.4.0",
2+
"name":"Antied v1.4.1",
33
"description":"Keeps deleted messages and logs edited messages, until you restart/reloads the app",
44
"main": "index.jsx",
55
"authors": [

angel/antied/patches/actionsheet.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ export default (deletedMessageArray) => before("openLazy", ActionSheet, ([compon
2626
// if(storage.debug) console.log(deletedMessageArray);
2727
if(storage.debug) console.log(`[ANTIED ActionSheet]`, message)
2828

29-
const buttons = findInReactTree(comp, c => c?.find?.(child => child?.props?.label == i18n?.Messages?.MESSAGE_ACTION_REPLY))
29+
function someFunc(a) {
30+
// return a?.props?.label == i18n?.Messages?.MESSAGE_ACTION_REPLY
31+
return a?.props?.label?.toLowerCase?.() == 'reply'
32+
}
33+
34+
const buttons = findInReactTree(comp, c => c?.find?.(someFunc))
3035
if (!buttons) return comp;
3136

3237
const position = Math.max(
33-
buttons.findIndex((x) => x?.props?.label == i18n?.Messages?.MESSAGE_ACTION_REPLY),
38+
buttons.findIndex(someFunc),
3439
buttons.length - 1
3540
);
3641

angel/azzyutils/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ makeDefaults(storage, {
4444
gutterAlpha: "33",
4545
useReplyAlert: false,
4646
useCustomColor: false,
47-
ignoreSelf: false
47+
ignoreSelf: false,
48+
altAlpha: false,
4849
},
4950
eml: {
5051
logEdit: false,
@@ -56,6 +57,7 @@ makeDefaults(storage, {
5657
},
5758
customUsernameColor: {
5859
hex: "#FFFFFF",
60+
hex2: "#AAAAAA",
5961
enableReply: false,
6062
},
6163
customRoleIcon: {
@@ -65,8 +67,8 @@ makeDefaults(storage, {
6567
showOthers: false,
6668
},
6769
customClan: {
68-
icon: "",
69-
tag: ""
70+
clanBadgeUrl: "https://cdn.discordapp.com/clan-badges/603970300668805120/e5926f1f8cf6592d56d27bac37f01a9b.png?size=32",
71+
clanTag: "AGWX"
7072
}
7173
},
7274
debug: false
@@ -115,8 +117,8 @@ export default {
115117
},
116118
onUnload: () => {
117119
isEnabled = false
118-
unpatch();
119-
unLoadDatas();
120+
unpatch?.();
121+
unLoadDatas?.();
120122
},
121123
settings: settingPage
122124
}

angel/azzyutils/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name":"Azzy Utils v1.2.1",
3-
"description":"This is may utility plwugins, dawnt stael it",
2+
"name":"Azzy Utils v1.3.0",
3+
"description":"description text here",
44
"main": "index.js",
55
"authors": [
66
{

angel/azzyutils/pages/utils/ct.jsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { storage } from "@vendetta/plugin"
2+
import { numToHex, openSheet } from "../../../../lib/utility"
3+
import { clipboard, ReactNative } from "@vendetta/metro/common"
4+
import { findByName } from "@vendetta/metro";
5+
import { getAssetIDByName } from "@vendetta/ui/assets";
6+
import { showToast } from "@vendetta/ui/toasts";
7+
import { Forms, General } from "@vendetta/ui/components";
8+
9+
const defaultImageURL = 'https://cdn.discordapp.com/clan-badges/603970300668805120/e5926f1f8cf6592d56d27bac37f01a9b.png?size=32'
10+
11+
const { ScrollView, View, Text, TouchableOpacity, TextInput, Pressable, Image, Animated, Component } = General;
12+
const { FormLabel, FormIcon, FormArrow, FormRow, FormSwitch, FormSwitchRow, FormSection, FormDivider, FormInput, FormRadioRow } = Forms;
13+
14+
const textInput = [
15+
{
16+
id: "clanTag",
17+
label: "Tag Name",
18+
keyType: "default",
19+
placeholder: "AGWX",
20+
def: "AGWX"
21+
},
22+
{
23+
id: "clanBadgeUrl",
24+
label: "Badge Url",
25+
keyType: "default",
26+
placeholder: defaultImageURL,
27+
def: defaultImageURL
28+
}
29+
]
30+
31+
32+
export default function CustomRoleIconPage() {
33+
34+
const SUCRI = storage?.utils?.customClan
35+
36+
const copyDefaultURL = () => {
37+
clipboard.setString(defaultImageURL)
38+
showToast("Copied placeholder URL", getAssetIDByName("toast_copy_link"))
39+
}
40+
41+
return (<>
42+
<FormRow
43+
label="Icon Preview"
44+
trailing={
45+
<TouchableOpacity onPress={copyDefaultURL}>
46+
<Image
47+
source={{ uri: SUCRI?.clanBadgeUrl || defaultImageURL }}
48+
style={{
49+
width: 128,
50+
height: 128,
51+
borderRadius: 10,
52+
}}
53+
/>
54+
</TouchableOpacity>
55+
}
56+
/>
57+
<FormDivider />
58+
{
59+
textInput?.map((obj, index) => {
60+
return (<>
61+
<FormInput
62+
title={obj.label}
63+
keyboardType={obj?.keyType}
64+
placeholder={obj?.placeholder}
65+
value={SUCRI[obj?.id] ?? obj?.def}
66+
onChange={(val) => (SUCRI[obj?.id] = val.toString())}
67+
/>
68+
{index !== textInput?.length - 1 && <FormDivider />}
69+
</>)
70+
})
71+
}
72+
</>)
73+
}

angel/azzyutils/pages/utils/cuc.jsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ export default function CustomUsernameColorPage() {
3535
}
3636
);
3737

38+
const whenPressed2 = () => openSheet(
39+
CustomColorPickerActionSheet, {
40+
color: (ReactNative.processColor(SUCUC?.hex2) || 0),
41+
onSelect: (color) => {
42+
const hex = numToHex(color)
43+
SUCUC.hex2 = hex
44+
// showToast(storage.colors.hex)
45+
}
46+
}
47+
);
48+
3849
return (<>
3950
<FormRow
4051
label="Color"
@@ -55,6 +66,25 @@ export default function CustomUsernameColorPage() {
5566
}
5667
/>
5768
<FormDivider />
69+
<FormRow
70+
label="Color #2"
71+
subLabel="Click to Update"
72+
onPress={whenPressed2}
73+
trailing={
74+
<TouchableOpacity onPress={whenPressed2}>
75+
<Image
76+
source={{ uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mJsrQAAAgwBAJ9P6qYAAAAASUVORK5CYII=' }}
77+
style={{
78+
width: 128,
79+
height: 128,
80+
borderRadius: 10,
81+
backgroundColor: SUCUC?.hex2 || "#FFFFFF"
82+
}}
83+
/>
84+
</TouchableOpacity>
85+
}
86+
/>
87+
<FormDivider />
5888
{
5989
switches?.map((obj, index) => {
6090
return (<>

angel/azzyutils/patches/actionSheet.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { before, after } from "@vendetta/patcher";
22
import { findByProps } from "@vendetta/metro";
3+
import { storage } from "@vendetta/plugin";
34

45

56
import quickCopyID from "../utils/quickId";
@@ -10,8 +11,10 @@ const ActionSheet = findByProps("openLazy", "hideActionSheet");
1011

1112
export default () => before("openLazy", ActionSheet, ([component, args, actionMessage]) => {
1213

13-
if(isEnabled) {
14-
// console.log(component, args, actionMessage)
14+
if(isEnabled) {
15+
// if(storage?.debug) {
16+
// console.log("============ [ActionSheet openLazy] ===========\n\n", component, args, actionMessage)
17+
// }
1518
quickCopyID(component, args, actionMessage, ActionSheet) // Quick ID
1619
noShare(component, args, actionMessage, ActionSheet) // No Share
1720
}

angel/azzyutils/patches/update_rows.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import { ReactNative, moment } from "@vendetta/metro/common";
21
import { after, before } from "@vendetta/patcher";
32
import { storage } from "@vendetta/plugin";
43
import { isEnabled } from "..";
54
import { updateRowCustomMentionPatch } from "../utils/replyAlert";
65
import { updateRowTextMod } from "../utils/textMod";
76
import { patchCustomUsernameColor } from "../utils/cuc";
87
import { patchCustomRoleIcon } from "../utils/cri";
8+
import { patchCustomClanBadge } from "../utils/ct";
99

10-
const { DCDChatManager } = ReactNative.NativeModules;
10+
import { findByProps } from "@vendetta/metro";
1111

12-
export const patchUpdateRowBefore = () => before("updateRows", DCDChatManager, (r) => {
12+
// const { DCDChatManager } = ReactNative.NativeModules; // ancient shit
13+
14+
const rowsController = findByProps("updateRows", "getConstants")
15+
16+
export const patchUpdateRowBefore = () => before("updateRows", rowsController, (r) => {
1317
if(isEnabled) {
1418
let rows = JSON.parse(r[1]);
1519
if(storage?.debug) console.log("[AZZYUTILS update_rows.js] ========== updateRows rows ==========");
@@ -19,6 +23,7 @@ export const patchUpdateRowBefore = () => before("updateRows", DCDChatManager, (
1923
updateRowCustomMentionPatch(row) // Custom Mention
2024
if(storage?.toggle?.customUsernameColor) patchCustomUsernameColor(row); // Custom Username Color
2125
if(storage?.toggle?.customRoleIcon) patchCustomRoleIcon(row); // Custom Role Icon
26+
if(storage?.toggle?.customClan) patchCustomClanBadge(row);
2227
// updateRowTextMod(row) // Text Color Mod
2328

2429
})
@@ -29,7 +34,7 @@ export const patchUpdateRowBefore = () => before("updateRows", DCDChatManager, (
2934
}
3035
})
3136

32-
export const patchUpdateRowAfter = () => after("updateRows", DCDChatManager, (r) => {
37+
export const patchUpdateRowAfter = () => after("updateRows", rowsController, (r) => {
3338
if(isEnabled) {
3439
let rows = JSON.parse(r[1]);
3540

angel/azzyutils/settings.jsx

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import { storage } from "@vendetta/plugin"
22
import { useProxy } from "@vendetta/storage"
33
import { findByName } from "@vendetta/metro";
44

5-
import VersionChange from "../../lib/components/versionChange";
6-
import updates from "./update";
7-
85
import { CustomMentionsSetting, ReplyAlertSetting } from "./pages/utils/replyAlertSetting";
96
import NoShareSetting from "./pages/utils/NoShareSetting";
107
import CAT from "./pages/utils/cat";
118
import QuickIdSetting from "./pages/utils/quickIdSetting";
129
import CustomUsernameColorPage from "./pages/utils/cuc";
1310
import CustomRoleIconPage from "./pages/utils/cri";
11+
import CustomClanBadge from "./pages/utils/ct";
1412
import { Forms, General } from "@vendetta/ui/components";
1513

1614
// const HelpMessage = findByName("HelpMessage");
@@ -39,6 +37,7 @@ export default () => {
3937
createList("noshare", "No Share", "Toggle No Share", null, NoShareSetting),
4038
createList("customUsernameColor", "CUC", "Toggle Custom Username Color", null, CustomUsernameColorPage),
4139
createList("customRoleIcon", "CRI", "Toggle Custom Role Icon", null, CustomRoleIconPage),
40+
createList("customClan", "CCB", "Toggle Custom Clan Badge", null, CustomClanBadge),
4241
createList("ralert", "Reply Alert", "Toggle Settings", null, ReplyAlertSetting),
4342
createList("customMention", "Custom Mentions", "Toggle Custom Mentions Settings", null, CustomMentionsSetting),
4443
createList("removeDecor", "I HATE AVATAR DECORATIONS", "Toggle Remove Avatar Decoration", null, null),
@@ -48,9 +47,11 @@ export default () => {
4847
<ScrollView>
4948
<View style={{
5049
borderRadius: 10,
51-
backgroundColor: "rgba(0, 12, 46, 0.15)"
50+
backgroundColor: "rgba(0, 12, 46, 0.15)",
51+
marginBottom: 50,
52+
marginTop: 20
5253
}}>
53-
{/*<HelpMessage messageType={0}>"This Plugin development is moved to new Repository"</HelpMessage>*/}
54+
{/*{<HelpMessage messageType={0}>"To use a feature, please enable them and their respective setting open."</HelpMessage>}*/}
5455
<FormRow
5556
label="Debug"
5657
subLabel="enable console logging"
@@ -99,28 +100,6 @@ export default () => {
99100
}
100101
</View>
101102
<FormDivider />
102-
{
103-
updates && (
104-
<View style={{
105-
paddingBottom: 36
106-
}}>
107-
<FormSection title="Updates">
108-
<View style={{
109-
margin: 5,
110-
padding: 5,
111-
borderRadius: 10,
112-
backgroundColor: "rgba(59, 30, 55, 0.15)"
113-
}}>
114-
{
115-
updates.map((data, index) => {
116-
return <VersionChange change={data} index={index} totalIndex={updates.length}/>
117-
})
118-
}
119-
</View>
120-
</FormSection>
121-
</View>
122-
)
123-
}
124103
</ScrollView>
125104
</>)
126105
}

0 commit comments

Comments
 (0)