9 lines
14 KiB
JavaScript
9 lines
14 KiB
JavaScript
(function(R,n,o,f,S,d){"use strict";const{ScrollView:P,View:T}=n.ReactNative;function v({children:e}){return n.React.createElement(P,{style:{flex:1}},e,n.React.createElement(T,{style:{height:24}}))}const{View:m,Text:E}=n.ReactNative;function w({children:e,style:r}){return n.React.createElement(m,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},r]},n.React.createElement(E,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{TouchableOpacity:O,Text:A}=n.ReactNative;function p({label:e,onPress:r,disabled:t,style:u}){return n.React.createElement(O,{disabled:t,onPress:r,style:[{backgroundColor:"#5865F2",borderRadius:8,padding:10,alignItems:"center",opacity:t?.5:1},u]},n.React.createElement(A,{style:{color:"white",fontWeight:"600"}},e))}const k=[{label:'findByProps("computePermissions", "canEveryoneRole")',run:function(){return o.findByProps("computePermissions","canEveryoneRole")}},{label:'findByProps("getBotLabel")',run:function(){return o.findByProps("getBotLabel")}},{label:'findByName("DisplayName", false)',run:function(){return o.findByName("DisplayName",!1)}},{label:'findByName("HeaderName", false)',run:function(){return o.findByName("HeaderName",!1)}},{label:'findByName("getTagProperties", false)',run:function(){return o.findByName("getTagProperties",!1)}},{label:'findByTypeNameAll("UserRow")',run:function(){return o.findByTypeNameAll("UserRow")}},{label:'findByStoreName("ThemeStore")',run:function(){return o.findByStoreName("ThemeStore")}},{label:'findByStoreName("GuildMemberStore")',run:function(){return o.findByStoreName("GuildMemberStore")}},{label:'findByStoreName("GuildStore")',run:function(){return o.findByStoreName("GuildStore")}},{label:'findByStoreName("ChannelStore")',run:function(){return o.findByStoreName("ChannelStore")}},{label:'findByStoreName("UserStore")',run:function(){return o.findByStoreName("UserStore")}},{label:'findByStoreName("RelationshipStore")',run:function(){return o.findByStoreName("RelationshipStore")}},{label:'findByName("RowManager", false)',run:function(){return o.findByName("RowManager",!1)}},{label:'findByProps("TYPING_WRAPPER_HEIGHT")',run:function(){return o.findByProps("TYPING_WRAPPER_HEIGHT")}},{label:'findByName("VoiceUserConnected", false)',run:function(){return o.findByName("VoiceUserConnected",!1)}},{label:"find(resolveSemanticColor via default.internal)",run:function(){return o.find(function(e){return e?.default?.internal?.resolveSemanticColor})}},{label:"find(resolveSemanticColor via meta)",run:function(){return o.find(function(e){return e?.meta?.resolveSemanticColor})}},{label:"find(UserProfile)",run:function(){return o.find(function(e){return e?.type?.name==="UserProfile"})}},{label:'findByName("UserProfileSection", false)',run:function(){return o.findByName("UserProfileSection",!1)}},{label:'findByProps("sendMessage", "sendBotMessage")',run:function(){return o.findByProps("sendMessage","sendBotMessage")}},{label:'findByProps("openLazy", "hideActionSheet")',run:function(){return o.findByProps("openLazy","hideActionSheet")}},{label:'findByProps("push", "pushLazy", "pop")',run:function(){return o.findByProps("push","pushLazy","pop")}},{label:'findByProps("getRenderCloseButton")',run:function(){return o.findByProps("getRenderCloseButton")}},{label:'findByProps("getHeaderCloseButton")',run:function(){return o.findByProps("getHeaderCloseButton")}},{label:'findByName("Navigator")',run:function(){return o.findByName("Navigator")}},{label:'findByName("ThemedRolePill", false)',run:function(){return o.findByName("ThemedRolePill",!1)}},{label:'findByProps("saveProfileChanges")',run:function(){return o.findByProps("saveProfileChanges")}},{label:'findByProps("useAvatarColors")',run:function(){return o.findByProps("useAvatarColors")}},{label:'findByProps("useThemeContext")',run:function(){return o.findByProps("useThemeContext")}},{label:'findByProps("getProfileTheme")',run:function(){return o.findByProps("getProfileTheme")}},{label:'findByProps("ThemeContextProvider")',run:function(){return o.findByProps("ThemeContextProvider")}},{label:"semanticColors.HEADER_SECONDARY",run:function(){return d.semanticColors?.HEADER_SECONDARY}},{label:"semanticColors.BACKGROUND_ACCENT",run:function(){return d.semanticColors?.BACKGROUND_ACCENT}},{label:"semanticColors.BACKGROUND_PRIMARY",run:function(){return d.semanticColors?.BACKGROUND_PRIMARY}},{label:"semanticColors.BACKGROUND_FLOATING",run:function(){return d.semanticColors?.BACKGROUND_FLOATING}},{label:"semanticColors.BUTTON_OUTLINE_BRAND_BORDER_ACTIVE",run:function(){return d.semanticColors?.BUTTON_OUTLINE_BRAND_BORDER_ACTIVE}},{label:"semanticColors.TEXT_NORMAL",run:function(){return d.semanticColors?.TEXT_NORMAL}}];function _(e){if(e==null)return"NOT FOUND";if(typeof e=="object"){const r=Object.keys(e);return`found (${r.length} key${r.length===1?"":"s"})`}return`found (${typeof e})`}function D(){return k.map(function({label:e,run:r}){try{const t=r();return{label:e,found:t!=null,detail:_(t)}}catch(t){return{label:e,found:!1,detail:`threw: ${t}`}}})}function U(e){const r=e.filter(function(t){return!t.found});return[`Key Inspector report - ${new Date().toISOString()}`,`${e.length} checked, ${r.length} missing`,"",...e.map(function(t){return`[${t.found?"OK":"MISSING"}] ${t.label} -> ${t.detail}`}),"",`semanticColors keys (${Object.keys(d.semanticColors??{}).length}):`,...Object.keys(d.semanticColors??{}).sort(),"",`rawColors keys (${Object.keys(d.rawColors??{}).length}):`,...Object.keys(d.rawColors??{}).sort()].join(`
|
|
`)}const I=new Set(["vendetta.metro.modules"]);function F(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?`array(${e.length})`:typeof e}function j(e=3){const r=new WeakSet,t=[];function u(i,a,l){if(i==null||typeof i!="object"&&typeof i!="function")return;if(I.has(a)){t.push(`${a} -> (skipped - Discord's full module registry, use the search tools for this)`);return}if(typeof i=="object"){if(r.has(i)){t.push(`${a} -> [already listed elsewhere, circular]`);return}r.add(i)}let s;try{s=Object.keys(i).sort()}catch(g){t.push(`${a} -> [couldn't read keys: ${g}]`);return}const c=s.slice(0,60);for(const g of c){const B=`${a}.${g}`;let N;try{N=i[g]}catch(q){t.push(`${B} -> [threw on access: ${q}]`);continue}const C=F(N);t.push(`${B} (${C})`),C==="object"&&l<e&&u(N,B,l+1)}s.length>60&&t.push(`${a} -> (+${s.length-60} more keys not shown at this level)`)}try{u(globalThis.vendetta,"vendetta",0)}catch(i){t.push(`Error walking the vendetta object: ${i}`)}return t.length?t.join(`
|
|
`):"vendetta object not found or empty"}function M(e){const r=window?.modules;if(r)for(const t in r){const u=r[t];if(!u?.isInitialized)continue;const i=u.publicModule?.exports;if(i)try{if(e(i))return i;if(i.default!=null&&e(i.default))return i.default}catch{}}}function G(e){return M(function(r){return r?.name===e||r?.displayName===e||r?.type?.name===e||r?.type?.displayName===e})}const H={0:"FunctionComponent",1:"ClassComponent",3:"HostRoot",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"};function L(e){return H[e]??`tag ${e}`}function x(){const e=[`YouBar+ diagnostics - ${new Date().toISOString()}`,""],r=G("YouBarNotificationsButton");e.push(`1. rawFindByTypeName("YouBarNotificationsButton") -> ${r?"FOUND":"NOT FOUND"}`),r&&(e.push(` typeof target = ${typeof r}`),e.push(` has .type (inner render fn) = ${typeof r?.type=="function"}`),e.push(` has .compare = ${"compare"in(r??{})}`),e.push(` $$typeof = ${String(r?.$$typeof??"none")}`)),e.push("");const t=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__;e.push(`2. window.__REACT_DEVTOOLS_GLOBAL_HOOK__ -> ${t?"present":"MISSING"}`),t&&(e.push(` typeof getFiberRoots = ${typeof t.getFiberRoots}`),e.push(` renderers = ${t.renderers?`Map(${t.renderers.size??"?"})`:"MISSING"}`)),e.push("");let u=null;if(t?.getFiberRoots&&t?.renderers?.keys&&r){let a=0;for(const l of t.renderers.keys()){a++;let s;try{s=t.getFiberRoots(l)}catch(c){e.push(`3. renderer ${l}: getFiberRoots threw: ${c}`);continue}if(e.push(`3. renderer ${l}: ${s?s.size:0} fiber root(s)`),s)for(const c of s)u||(u=V(c.current,r))}a===0&&e.push("3. hook.renderers is empty - React never registered with it")}else e.push("3. skipped (no hook, no renderers, or component not found in step 1)");if(e.push(` target fiber found by tree walk -> ${u?"YES":"NO"}`),e.push(""),u){e.push("4. Ancestor chain from target fiber up to root:");let a=u,l=0,s=!1;for(;a&&l<60;){const c=typeof a.stateNode?.forceUpdate=="function";c&&(s=!0),e.push(` [${l}] ${L(a.tag)}${c?" <- has forceUpdate()":""}`),a=a.return,l++}e.push(` class-component ancestor with forceUpdate found -> ${s?"YES":"NO"}`)}else e.push("4. skipped (no fiber found in step 3)");e.push("");const i=o.findByProps("getRootNavigationRef");if(e.push(`5. findByProps("getRootNavigationRef") -> ${i?"FOUND":"NOT FOUND"}`),i)try{const a=i.getRootNavigationRef?.();if(e.push(` getRootNavigationRef() -> ${a?"returned a ref":"null/undefined"}`),a){e.push(` typeof isReady = ${typeof a.isReady}`),e.push(` isReady() = ${function(){try{return a.isReady?.()}catch(s){return`threw: ${s}`}}()}`),e.push(` typeof getCurrentRoute = ${typeof a.getCurrentRoute}`);const l=function(){try{return a.getCurrentRoute?.()}catch{return}}();e.push(` getCurrentRoute() -> ${l?JSON.stringify({name:l.name,params:l.params}):"none"}`),e.push(` typeof navigate = ${typeof a.navigate}`),e.push(` typeof setParams = ${typeof a.setParams}`)}}catch(a){e.push(` threw: ${a}`)}return e.join(`
|
|
`)}function V(e,r){const t=e?[e]:[];let u=0;for(;t.length;){if(++u>2e5)return null;const i=t.pop();if(i){if(i.type===r||i.elementType===r)return i;i.child&&t.push(i.child),i.sibling&&t.push(i.sibling)}}return null}const{View:y,Text:b}=n.ReactNative,{FormSection:h,FormInput:$}=S.Forms;function z(){const[e,r]=n.React.useState(null);return n.React.createElement(h,{title:"Full diagnostic scan"},n.React.createElement(y,{style:{paddingHorizontal:16,paddingVertical:8}},n.React.createElement(p,{label:"Run scan & copy full report",onPress:function(){const t=D(),u=t.filter(function(i){return!i.found}).length;n.clipboard.setString(U(t)),r(`${t.length} checked, ${u} missing - full report copied`),f.showToast(`${u} missing out of ${t.length} - report copied`,void 0)}}),e&&n.React.createElement(b,{style:{marginTop:8,fontSize:12.5,opacity:.7}},e)))}function Y(){return n.React.createElement(h,{title:"YouBar+ diagnostics"},n.React.createElement(y,{style:{paddingHorizontal:16,paddingVertical:8}},n.React.createElement(p,{label:"Run YouBar+ diagnostics & copy report",onPress:function(){const e=x();n.clipboard.setString(e),f.showToast("Diagnostics copied - paste into chat",void 0)}}),n.React.createElement(b,{style:{marginTop:8,fontSize:12.5,opacity:.7}},"Checks whether YouBarNotificationsButton can be found live, whether the React DevTools fiber-root registry forceRerender depends on is actually populated, and whether a class-component ancestor or the navigation ref fallback exists at all - run this right after toggling YouBar+ on/off to see exactly which step is failing.")))}function K(){return n.React.createElement(h,{title:"Full Vendetta API tree"},n.React.createElement(y,{style:{paddingHorizontal:16,paddingVertical:8}},n.React.createElement(p,{label:"Copy the entire plugin API tree",onPress:function(){const e=j(3),r=e.split(`
|
|
`).length;n.clipboard.setString(e),f.showToast(`Copied ${r} lines - every key path under window.vendetta`,void 0)}}),n.React.createElement(b,{style:{marginTop:8,fontSize:12.5,opacity:.7}},"Every key path under the stable plugin API (window.vendetta), 3 levels deep - this is everything Revenge itself exposes to plugins, not Discord's raw internals (those are searchable individually below, since dumping all of them would be enormous).")))}function W(){const[e,r]=n.React.useState(""),[t,u]=n.React.useState(""),i=function(){const l=e.split(",").map(function(s){return s.trim()}).filter(Boolean);if(l.length)try{const s=o.findByProps(...l);if(!s){n.clipboard.setString(`findByProps(${l.join(", ")}) -> not found`),f.showToast("No module found - copied that result",void 0);return}const c=Object.keys(s).sort();n.clipboard.setString(`findByProps(${l.join(", ")}) -> found, keys:
|
|
${c.join(`
|
|
`)}`),f.showToast(`Found it - copied ${c.length} key(s)`,void 0)}catch(s){n.clipboard.setString(`Error searching for ${l.join(", ")}: ${s}`),f.showToast("Search failed - copied the error instead",void 0)}},a=function(){const l=t.trim();if(l)try{const s=o.findByName(l,!1);if(!s){n.clipboard.setString(`findByName("${l}") -> not found`),f.showToast("No component found - copied that result",void 0);return}const c=Object.keys(s).sort();n.clipboard.setString(`findByName("${l}") -> found, keys:
|
|
${c.join(`
|
|
`)}`),f.showToast(`Found it - copied ${c.length} key(s)`,void 0)}catch(s){n.clipboard.setString(`Error searching for "${l}": ${s}`),f.showToast("Search failed - copied the error instead",void 0)}};return n.React.createElement(h,{title:"One-off search"},n.React.createElement(y,{style:{paddingHorizontal:16,paddingVertical:8}},n.React.createElement($,{title:"findByProps - comma-separated prop names",placeholder:"e.g. sendMessage, sendBotMessage",value:e,onChange:r}),n.React.createElement(p,{label:"Search & copy result",style:{marginTop:8,marginBottom:16},onPress:i}),n.React.createElement($,{title:"findByName - component name",placeholder:"e.g. ThemedRolePill",value:t,onChange:u}),n.React.createElement(p,{label:"Search & copy result",style:{marginTop:8},onPress:a})))}function X(){return n.React.createElement(v,null,n.React.createElement(z,null),n.React.createElement(Y,null),n.React.createElement(K,null),n.React.createElement(W,null),n.React.createElement(w,null,"The full scan checks every internal lookup this repo's plugins depend on (plus a few for plugins currently being fixed) in one pass, and includes the complete list of semanticColors/rawColors keys at the end. Paste the report back into chat when reporting a bug - it tells us exactly what's missing on your Discord version."))}var J={settings:X};return R.default=J,Object.defineProperty(R,"__esModule",{value:!0}),R})({},vendetta.metro.common,vendetta.metro,vendetta.ui.toasts,vendetta.ui.components,vendetta.ui);
|