Apex-Plugins/nsfwbypass/index.js
2025-07-29 21:07:46 +02:00

1 line
4.9 KiB
JavaScript

(function(d,s,c,b,e,a,S,w,g){"use strict";const{FormSection:C,FormRow:y,FormSwitchRow:p,FormText:P,FormInput:F}=s.findByProps("FormSection"),v=function(){return[83,108,97,114,97,73,115,83,105,103,109,97,67,97,116].map(function(t){return String.fromCharCode(t)}).join("")},E=function(t){const n=atob("U2xhcmFJc1NpZ21hQ2F0"),o="taC".concat("amgiS").concat("sI").concat("aralS").split("").reverse().join("");return t===n||t===o||t===v()},A=function(){S.useProxy(a.storage);const[t,n]=e.React.useState(""),[o,i]=e.React.useState(!1);a.storage.ageBypass??=!1,a.storage.nsfwBypass??=!0,a.storage.showWarningPopup??=!0;const u=function(l){l&&!a.storage.ageBypass?(i(!0),n("")):l||(a.storage.ageBypass=!1,i(!1),g.showToast("Age bypass disabled",s.findByProps("getAssetByName")?.getAssetByName("ic_info")?.id))},B=function(){E(t)?(a.storage.ageBypass=!0,i(!1),n(""),g.showToast("Age bypass enabled successfully",s.findByProps("getAssetByName")?.getAssetByName("ic_check")?.id)):(g.showToast("Incorrect password",s.findByProps("getAssetByName")?.getAssetByName("ic_close")?.id),n(""))},f=function(){i(!1),n(""),a.storage.ageBypass=!1};return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1}},e.React.createElement(C,{title:"NSFW Plugin Settings"},e.React.createElement(P,{style:{color:"#FFFFFF",marginBottom:16,fontSize:15,fontWeight:"500"}},"Configure NSFW plugin settings. Restart the app to apply changes."),e.React.createElement(p,{label:"Enable Age Verification Bypass",subLabel:"\u{1F512} Password protected - Sets your account as verified adult",leading:e.React.createElement(y.Icon,{source:s.findByProps("getAssetByName")?.getAssetByName("ic_lock")?.id}),value:a.storage.ageBypass,onValueChange:u}),o?e.React.createElement(e.React.Fragment,{},e.React.createElement(F,{title:"Enter Password",placeholder:"Enter password to enable age bypass",value:t,onChange:n,secureTextEntry:!0}),e.React.createElement(e.ReactNative.View,{style:{flexDirection:"row",gap:8,marginTop:8,marginHorizontal:16}},e.React.createElement(e.ReactNative.TouchableOpacity,{style:{backgroundColor:w.semanticColors.BUTTON_POSITIVE_BACKGROUND,padding:12,borderRadius:8,flex:1,alignItems:"center"},onPress:B},e.React.createElement(e.ReactNative.Text,{style:{color:"white",fontWeight:"bold"}},"Confirm")),e.React.createElement(e.ReactNative.TouchableOpacity,{style:{backgroundColor:w.semanticColors.BUTTON_DANGER_BACKGROUND,padding:12,borderRadius:8,flex:1,alignItems:"center"},onPress:f},e.React.createElement(e.ReactNative.Text,{style:{color:"white",fontWeight:"bold"}},"Cancel")))):null,e.React.createElement(p,{label:"Enable NSFW Content Bypass",subLabel:"Bypasses all NSFW restrictions and gates completely",leading:e.React.createElement(y.Icon,{source:s.findByProps("getAssetByName")?.getAssetByName("ic_warning")?.id}),value:a.storage.nsfwBypass,onValueChange:function(l){a.storage.nsfwBypass=l}}),e.React.createElement(p,{label:"Show NSFW Channel Warning",subLabel:"Display a warning popup when entering NSFW channels",leading:e.React.createElement(y.Icon,{source:s.findByProps("getAssetByName")?.getAssetByName("ic_alert")?.id}),value:a.storage.showWarningPopup,onValueChange:function(l){a.storage.showWarningPopup=l}})))},{Text:W}=s.findByProps("Button","Text","View"),h=s.findByProps("isNSFWInvite"),N=s.findByStoreName("UserStore"),{getChannel:R}=s.findByProps("getChannel")||s.findByName("getChannel",!1);let r=[];function T(t){return typeof t=="string"?R(t)?.nsfw===!0:t?.nsfw===!0}function x(){return e.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.")}var I={onLoad:function(){if(a.storage.ageBypass??=!1,a.storage.nsfwBypass??=!0,a.storage.showWarningPopup??=!0,a.storage.nsfwBypass&&(r.push(c.instead("handleNSFWGuildInvite",h,function(){return!1})),r.push(c.instead("isNSFWInvite",h,function(){return!1})),r.push(c.instead("shouldNSFWGateGuild",h,function(){return!1})),r.push(c.after("getCurrentUser",N,function(t,n){return n?.hasOwnProperty("nsfwAllowed")&&(n.nsfwAllowed=!0),n}))),a.storage.ageBypass&&r.push(c.after("getCurrentUser",N,function(t,n){return n?.hasOwnProperty("ageVerificationStatus")&&(n.ageVerificationStatus=3),n})),a.storage.showWarningPopup){const t=s.findByProps("transitionToGuild");if(t)for(const n of Object.keys(t))typeof t[n]=="function"&&r.push(c.instead(n,t,function(o,i){if(typeof o[0]=="string"){const u=o[0].match(/(\d+)$/);if(u?.[1]){const B=u[1],f=R(B);if(f&&T(f))return b.showConfirmationAlert({title:"WARNING: Entering NSFW channel",content:e.React.createElement(x),confirmText:"Proceed with Caution",cancelText:"Cancel",onConfirm:function(){return i(...o)}}),{}}}return i(...o)}))}},onUnload:function(){for(const t of r)t();r=[]},settings:A};return d.default=I,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);