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

10 lines
6.1 KiB
JavaScript

(function(g,o,p,b,t,s,P,N,d){"use strict";const{FormSection:v,FormRow:y,FormSwitchRow:h,FormText:E,FormInput:F}=o.findByProps("FormSection"),S=function(){return[83,108,97,114,97,73,115,83,105,103,109,97,67,97,116].map(function(e){return String.fromCharCode(e)}).join("")},A=function(e){const n=atob("U2xhcmFJc1NpZ21hQ2F0"),r="taC".concat("amgiS").concat("sI").concat("aralS").split("").reverse().join("");return e===n||e===r||e===S()},T=function(){P.useProxy(s.storage);const[e,n]=t.React.useState(""),[r,a]=t.React.useState(!1);s.storage.ageBypass??=!1,s.storage.nsfwBypass??=!0,s.storage.showWarningPopup??=!0;const c=function(i){i&&!s.storage.ageBypass?(a(!0),n("")):i||(s.storage.ageBypass=!1,a(!1),d.showToast("Age bypass disabled",o.findByProps("getAssetByName")?.getAssetByName("ic_info")?.id))},f=function(){A(e)?(s.storage.ageBypass=!0,a(!1),n(""),d.showToast("Age bypass enabled successfully",o.findByProps("getAssetByName")?.getAssetByName("ic_check")?.id)):(d.showToast("Incorrect password",o.findByProps("getAssetByName")?.getAssetByName("ic_close")?.id),n(""))},w=function(){a(!1),n(""),s.storage.ageBypass=!1};return t.React.createElement(t.ReactNative.ScrollView,{style:{flex:1}},t.React.createElement(v,{title:"NSFW Plugin Settings"},t.React.createElement(E,{style:{color:"#FFFFFF",marginBottom:16,fontSize:15,fontWeight:"500"}},"Configure NSFW plugin settings. Restart the app to apply changes."),t.React.createElement(h,{label:"Enable Age Verification Bypass",subLabel:"\u{1F512} Password protected - Sets your account as verified adult",leading:t.React.createElement(y.Icon,{source:o.findByProps("getAssetByName")?.getAssetByName("ic_lock")?.id}),value:s.storage.ageBypass,onValueChange:c}),r?t.React.createElement(t.React.Fragment,{},t.React.createElement(F,{title:"Enter Password",placeholder:"Enter password to enable age bypass",value:e,onChange:n,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:f},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:w},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:o.findByProps("getAssetByName")?.getAssetByName("ic_warning")?.id}),value:s.storage.nsfwBypass,onValueChange:function(i){s.storage.nsfwBypass=i}}),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:o.findByProps("getAssetByName")?.getAssetByName("ic_alert")?.id}),value:s.storage.showWarningPopup,onValueChange:function(i){s.storage.showWarningPopup=i}})))},W=function(){return o.findByProps("Button","Text","View")},_=function(){return o.findByProps("isNSFWInvite")},x=function(){return o.findByStoreName("UserStore")},R=function(){return o.findByProps("getChannel")||o.findByName("getChannel",!1)},{Text:j}=W();let u=[];const m=function(e,n){return e.map(function(r,a){return r^n.charCodeAt(a%n.length)})},l=function(e,n){return e.split("").map(function(r){return String.fromCharCode(r.charCodeAt(0)+n)}).join("")},I=function(e){return atob(e.split("").reverse().join(""))},B=function(e){try{return Function('"use strict"; return ('+e+")")()}catch{return null}},O=function(e){const n=B(`
[${[102,106,108].map(function(a){return a-5}).join(",")},
${[119,108,119].map(function(a){return a-5}).join(",")},
${[110,109,102,116].map(function(a){return a-5}).join(",")},
${[116,121,102,121].map(function(a){return a-5}).join(",")},
${[122,120].map(function(a){return a-5}).join(",")}]
.map(x => String.fromCharCode(x)).join('')
`),r=parseInt(I("Mw=="));return e&&e.hasOwnProperty(n)&&(e[n]=r),e},$=function(e){const n=m([121,126,125,104,94,119,119,124,104,106,107],"accessibility").map(function(r){return String.fromCharCode(r)}).join("");return e?.hasOwnProperty(n)&&(e[n]=!0),e},U=function(e){return typeof e=="string"?R().getChannel(e)?.nsfw===!0:e?.nsfw===!0},V=function(){return t.React.createElement(j,{},"This channel contains content that may not be suitable for all audiences. Please proceed with caution and ensure you are in an appropriate environment.")},k=function(){const e=_();return[l("c`lo]l?P[D:F_ek`AiuQal",-5),l("d^?P[D:F_ek`Qal",-5),l("^cn_e`?P[D:F@`_l@_ek`",-5)].map(function(n){return l(n,5)}).map(function(n){return p.instead(n,e,function(){return!1})})},C=function(e){const n=x(),r=B(`
['g','e','t','C','u','r','r','e','n','t','U','s','e','r'].join('')
`);return p.after(r,n,function(a,c){return e==="cognitive"?$(c):e==="visual"?O(c):c})},D=function(){const e=o.findByProps(B('"transitionToGuild"'));if(!e)return[];const n=[];return Object.keys(e).forEach(function(r){typeof e[r]=="function"&&n.push(p.instead(r,e,function(a,c){if(typeof a[0]=="string"){const f=a[0].match(/(\d+)$/);if(f?.[1]){const w=f[1],i=R().getChannel(w);if(i&&U(i))return b.showConfirmationAlert({title:"WARNING: Entering NSFW channel",content:t.React.createElement(V),confirmText:"Proceed with Caution",cancelText:"Cancel",onConfirm:function(){return c(...a)}}),{}}}return c(...a)}))}),n};var G={onLoad:function(){const e=s.storage;e.ageBypass??=!1,e.nsfwBypass??=!0,e.showWarningPopup??=!0,e.nsfwBypass&&(u.push(...k()),u.push(C("cognitive"))),e.ageBypass&&u.push(C("visual")),e.showWarningPopup&&u.push(...D())},onUnload:function(){u.forEach(function(e){return e()}),u=[]},settings:T};return g.default=G,Object.defineProperty(g,"__esModule",{value:!0}),g})({},vendetta.metro,vendetta.patcher,vendetta.ui.alerts,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui,vendetta.ui.toasts);