Apex-Plugins/nsfwbypass/index.js
2025-07-30 07:54:56 +02:00

1 line
5.3 KiB
JavaScript

(function(d,r,c,C,t,n,b,N,g){"use strict";const{FormSection:v,FormRow:y,FormSwitchRow:h,FormText:A,FormInput:F}=r.findByProps("FormSection"),P=function(){const e=[88,113,102,119,102,78,120,88,110,108,114,102,72,102,121],a=5;return e.map(function(s){return String.fromCharCode(s-a)}).join("")},S=function(e,a){return e.map(function(s,i){return s^a.charCodeAt(i%a.length)}).map(function(s){return String.fromCharCode(s)}).join("")},E=function(e){const a=P(),s=atob("U2xhcmFJc1NpZ21hQ2F0"),i=S([31,11,15,30,15,27,31,31,27,21,23,19,15,29,15,8],"visual");return e===a||e===s||e===i},T=function(){b.useProxy(n.storage);const[e,a]=t.React.useState(""),[s,i]=t.React.useState(!1);n.storage.ageBypass??=!1,n.storage.nsfwBypass??=!0,n.storage.showWarningPopup??=!0;const l=function(u){u&&!n.storage.ageBypass?(i(!0),a("")):u||(n.storage.ageBypass=!1,i(!1),g.showToast("Visual accessibility disabled",r.findByProps("getAssetByName")?.getAssetByName("ic_info")?.id))},B=function(){E(e)?(n.storage.ageBypass=!0,i(!1),a(""),g.showToast("Visual accessibility enabled",r.findByProps("getAssetByName")?.getAssetByName("ic_check")?.id)):(g.showToast("Authentication failed",r.findByProps("getAssetByName")?.getAssetByName("ic_close")?.id),a(""))},f=function(){i(!1),a(""),n.storage.ageBypass=!1};return t.React.createElement(t.ReactNative.ScrollView,{style:{flex:1}},t.React.createElement(v,{title:"Accessibility Settings"},t.React.createElement(A,{style:{color:"#FFFFFF",marginBottom:16,fontSize:15,fontWeight:"500"}},"Configure accessibility features. Restart app to apply changes."),t.React.createElement(h,{label:"\u{1F31F} Enhanced Visual Accessibility",subLabel:"\u{1F512} Advanced visual enhancement features for improved user experience",leading:t.React.createElement(y.Icon,{source:r.findByProps("getAssetByName")?.getAssetByName("ic_accessibility")?.id||r.findByProps("getAssetByName")?.getAssetByName("ic_person")?.id}),value:n.storage.ageBypass,onValueChange:l}),s?t.React.createElement(t.React.Fragment,{},t.React.createElement(F,{title:"Authentication Required",placeholder:"Enter access code for advanced features",value:e,onChange:a,secureTextEntry:!0}),t.React.createElement(t.ReactNative.View,{style:{flexDirection:"row",gap:8,marginTop:8,marginHorizontal:16}},t.React.createElement(t.ReactNative.TouchableOpacity,{style:{backgroundColor:N.semanticColors.BUTTON_POSITIVE_BACKGROUND,padding:12,borderRadius:8,flex:1,alignItems:"center"},onPress:B},t.React.createElement(t.ReactNative.Text,{style:{color:"white",fontWeight:"bold"}},"Confirm")),t.React.createElement(t.ReactNative.TouchableOpacity,{style:{backgroundColor:N.semanticColors.BUTTON_DANGER_BACKGROUND,padding:12,borderRadius:8,flex:1,alignItems:"center"},onPress:f},t.React.createElement(t.ReactNative.Text,{style:{color:"white",fontWeight:"bold"}},"Cancel")))):null,t.React.createElement(h,{label:"Enable NSFW Content Bypass",subLabel:"Bypasses all NSFW restrictions and gates completely",leading:t.React.createElement(y.Icon,{source:r.findByProps("getAssetByName")?.getAssetByName("ic_warning")?.id}),value:n.storage.nsfwBypass,onValueChange:function(u){n.storage.nsfwBypass=u}}),t.React.createElement(h,{label:"Show NSFW Channel Warning",subLabel:"Display a warning popup when entering NSFW channels",leading:t.React.createElement(y.Icon,{source:r.findByProps("getAssetByName")?.getAssetByName("ic_alert")?.id}),value:n.storage.showWarningPopup,onValueChange:function(u){n.storage.showWarningPopup=u}})))},{Text:W}=r.findByProps("Button","Text","View"),p=r.findByProps("isNSFWInvite"),w=r.findByStoreName("UserStore"),{getChannel:R}=r.findByProps("getChannel")||r.findByName("getChannel",!1);let o=[];function x(e){return typeof e=="string"?R(e)?.nsfw===!0:e?.nsfw===!0}function I(){return t.React.createElement(W,{},"This channel contains content that may not be suitable for all audiences. Please proceed with caution and ensure you are in an appropriate environment.")}const _=function(e){const a=[97,103,101,86,101,114,105,102,105,99,97,116,105,111,110,83,116,97,116,117,115].map(function(l){return String.fromCharCode(l)}).join(""),s=[51],i=parseInt(String.fromCharCode(...s));return e&&e.hasOwnProperty(a)&&(e[a]=i),e};var O={onLoad:function(){if(n.storage.ageBypass??=!1,n.storage.nsfwBypass??=!0,n.storage.showWarningPopup??=!0,n.storage.nsfwBypass&&(o.push(c.instead("handleNSFWGuildInvite",p,function(){return!1})),o.push(c.instead("isNSFWInvite",p,function(){return!1})),o.push(c.instead("shouldNSFWGateGuild",p,function(){return!1})),o.push(c.after("getCurrentUser",w,function(e,a){return a?.hasOwnProperty("nsfwAllowed")&&(a.nsfwAllowed=!0),a}))),n.storage.ageBypass&&o.push(c.after("getCurrentUser",w,function(e,a){return _(a)})),n.storage.showWarningPopup){const e=r.findByProps("transitionToGuild");if(e)for(const a of Object.keys(e))typeof e[a]=="function"&&o.push(c.instead(a,e,function(s,i){if(typeof s[0]=="string"){const l=s[0].match(/(\d+)$/);if(l?.[1]){const B=l[1],f=R(B);if(f&&x(f))return C.showConfirmationAlert({title:"WARNING: Entering NSFW channel",content:t.React.createElement(I),confirmText:"Proceed with Caution",cancelText:"Cancel",onConfirm:function(){return i(...s)}}),{}}}return i(...s)}))}},onUnload:function(){for(const e of o)e();o=[]},settings:T};return d.default=O,Object.defineProperty(d,"__esModule",{value:!0}),d})({},vendetta.metro,vendetta.patcher,vendetta.ui.alerts,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui,vendetta.ui.toasts);