Skip to content

Instantly share code, notes, and snippets.

@panfeng
Created October 14, 2014 00:17
Show Gist options
  • Save panfeng/eae379290b732a790eb3 to your computer and use it in GitHub Desktop.
Save panfeng/eae379290b732a790eb3 to your computer and use it in GitHub Desktop.
no need to prison break youo phone, setting=>wi-fi=> select the one your are using, and choose auto=>paste the raw file url to "Auto"
var PROXY_DIRECT = "DIRECT";
var DIRECT = "DIRECT";
var BLACK = "PROXY 8.8.8.8:53";
var WHITE = PROXY_DIRECT;
function s(u, r) {
return shExpMatch(u, r);
}
function d(h, r) {
return dnsDomainIs(h, r);
}
function n(h, r, m) {
return isInNet(h, r, m);
}
function FindProxyForURL(url, host) {
var u = url.toLowerCase();
var h = host.toLowerCase();
if (s(u, "http://configtest.wl.is/msg.html")) {
return "PROXY 5.9.40.99:80";
}
if (s(u, "http://1spgxE.configtest.wl.is/msg.html")) {
return "PROXY 5.9.40.99:80";
}
if (d(h, "wl.is") || d(h, "weblockapp.com")) {
return PROXY_DIRECT;
}
if (
(((d(h, "appsdt.com")) || (d(h, "ad\u005Cu002Dx.co.uk")) || (d(h, "appsflyer.com")) || (d(h, "apsalar.com")) || (d(h, "crashlytics.com")) || (d(h, "crittercism.com")) || (d(h, "testflightapp.com")) || (d(h, "flurry.com")) || (d(h, "georiot.com")) || (d(h, "google\u002Danalytics.com")) || (d(h, "appsdt.com")) || (d(h, "kontagent.net")) || (d(h, "localytics.com")) || (d(h, "mathtag.com")) || (d(h, "mixpanel.com")) || (d(h, "mobileapptracking.com")) || (d(h, "quantserve.com")) || (d(h, "revsci.net")) || (d(h, "scorecardresearch.com")) || (d(h, "sessionm.com")) || (d(h, "urbanairship.com"))) || ((d(h, "adap.tv")) || (d(h, "adblade.com")) || (d(h, "adbn.ru")) || (d(h, "adbomb.ru")) || (d(h, "adbooth.net")) || (d(h, "adcash.com")) || (d(h, "adcast.ru")) || (d(h, "adcolony.com") && !s(u, "configure")) || (d(h, "adcomplete.ru")) || (d(h, "adexprt.com")) || (d(h, "adflow.ru")) || (d(h, "adfog.ru")) || (d(h, "adfonic.net")) || (d(h, "adform.com") || d(h, "adform.net")) || (d(h, "adfox.ru")) || (d(h, "adhands.ru")) || (d(h, "adhese.com")) || (d(h, "adhub.ru")) || (d(h, "adinch.com")) || (d(h, "adinfuse.com")) || (d(h, "adition.com")) || (d(h, "adjuggler.net")) || (d(h, "akncdn.com") || d(h, "adkeeper.com") || d(h, "ackak.com")) || (d(h, "luxup.ru")) || (d(h, "admarvel.com") || s(u, "*admarvel*.amazonaws.com")) || (d(h, "admaster.net")) || (d(h, "atemda.com") || d(h, "admeta.com")) || (d(h, "admob.com")) || (d(h, "adver.mobi") || d(h, "admobi.ru")) || (d(h, "admulti.ru")) || (d(h, "adocean.pl")) || (d(h, "adorika.net")) || (d(h, "adotube.com")) || (d(h, "adpro.com.ua")) || (d(h, "madsone.com")) || (d(h, "adriver.ru")) || (d(h, "adrock.ru") || d(h, "adrock.ua") || d(h, "adrock.com.ua")) || (d(h, "adroll.com")) || (d(h, "adshost2.com")) || (d(h, "adsniper.ru")) || (d(h, "adspirit.de")) || (d(h, "adstark.ru")) || (d(h, "4dsply.com")) || (d(h, "ad\u002Dsys.com")) || (d(h, "adtaily.pl") || d(h, "adtaily.com")) || (d(h, "adtech.de")) || (d(h, "adtechus.com")) || (d(h, "adtilt.com") && !s(u, "*configure*")) || (d(h, "adtoma.com")) || (d(h, "adtotal.pl")) || (d(h, "adtrace.org")) || (d(h, "adnxs.com") || d(h, "adversal.com")) || (d(h, "adview.pl")) || (d(h, "am15.net")) || (d(h, "advolution.de")) || (d(h, "adwhirl.com")) || (d(h, "adzerk.net") || d(h, "adzerk.com")) || (d(h, "altrooz.com")) || (d(h, "amazon\u002Dadsystem.com")) || (d(h, "amobee.com")) || (d(h, "advertising.com") || d(h, "atwola.com")) || (d(h, "appflood.com")) || (d(h, "applifier.com")) || (d(h, "applovin.com")) || (d(h, "apprupt.com")) || (d(h, "atdmt.com")) || (d(h, "bcfads.com")) || (d(h, "bnmla.com")) || (d(h, "brightroll.com") || d(h, "brightroll.de") || d(h, "btrll.com")) || (d(h, "bubblesmedia.ru")) || (d(h, "appads.com")) || (d(h, "buysellads.com")) || (d(h, "carbonads.com") || d(h, "carbonads.net")) || (d(h, "chartboost.com")) || (n(h, "89.207.18.0", "255.255.255.0 ")) || (d(h, "content.ad")) || (d(h, "cpmstar.com")) || (d(h, "doubleclick.net") && !s(u, "*ythome*")) || (s(u, "*.emediate.*/*") || s(u, "*/eas?c*")) || (d(h, "epom.com")) || (d(h, "exoclick.com")) || (d(h, "exponential.com")) || (s(u, "*.flipboard.com/flipmag/adManager.js") || s(u, "*.flipboard.com/*/adcreative/*") || s(u, "*.flipboard.com/*adname*") || s(u, "*.flipboard.com/flare/*")) || (d(h, "ads.flurry.com")) || (d(h, "fwmrm.net")) || (s(u, "*/pagead2.googlesyndication.com/*") || d(h, "googletagservices.com") || d(h, "googleadservices.com") || s(u, "*.google.*/*ads.js*")) || (d(h, "googleadservices.com") && !s(u, "*/aclk?*")) || (d(h, "greystripe.com")) || (d(h, "hot\u002Dmob.com")) || (d(h, "hotwords.com")) || (d(h, "inmobi.com") || d(h, "inmobicdn.net") || s(h, "inmobisdk*.akamaihd.net") || d(h, "appsdt.com")) || (d(h, "inner\u002Dactive.mobi")) || (d(h, "innovid.com")) || (d(h, "integral\u002Dmarketing.com")) || (d(h, "nend.net") || d(h, "adimg.net") || d(h, "adingo.jp") || d(h, "adlantis.jp") || d(h, "ad\u002Dv.jp") || d(h, "ad\u002Dstir.com") || d(h, "amoad.com") || d(h, "app\u002Dc.net") || d(h, "behaviad.net") || d(h, "i2i.jp") || d(h, "i\u002Dmobile.co.jp") || d(h, "ad.maist.jp") || d(h, "microad.jp") || d(h, "medibaad.com") || d(h, "unthem.com")) || (d(h, "a.jumptap.com")) || (d(h, "ligatus.com")) || (d(h, "lijit.com")) || (d(h, "liverail.com")) || (d(h, "madsone.com") || d(h, "mads.com")) || (d(h, "madvertise.de") || d(h, "uimserv.net")) || (d(h, "marketgid.com")) || (d(h, "m2pub.com")) || (d(h, "mdotm.com")) || (d(h, "adland.ru")) || (d(h, "medialytics.com") || d(h, "medialets.com")) || (d(h, "bs.serving\u002Dsys.com") || d(h, "smartclip.net") || d(h, "eyewonder.com")) || (d(h, "mgid.com")) || (d(h, "mydas.mobi")) || (d(h, "mobclix.com")) || (d(h, "mobfox.com")) || (d(h, "mobilefuse.net") || d(h, "mobilefuse.com")) || (d(h, "mobiletheory.com")) || (d(h, "mocean.mobi")) || (d(h, "ads.mojiva.com") || s(u, "*ads*.mojiva.com/*")) || (d(h, "mopub.com")) || (s(u, "*msn.com/adsadclient*")) || (s(u, "*admax.nexage.com/*")) || (d(h, "nuggad.net")) || (d(h, "openx.org") || d(h, "openxenterprise.com") || s(u, "*/openx/www/delivery/*.php*") || s(h, "*/openx/www/api/v*/*.php*") || d(h, "openx.com") || d(h, "openx.net")) || (d(h, "openvideoads.org")) || (d(h, "playhaven.com")) || (d(h, "playnomics.net")) || (d(h, "adk2.co")) || (d(h, "pflexads.com")) || (d(h, "popadscdn.net")) || (d(h, "propellerads.com") || d(h, "propellerpops.com") || d(h, "onclickads.net")) || (d(h, "quantcount.com")) || (d(h, "recreativ.ru")) || (d(h, "revmob.com")) || (d(h, "yieldmanager.com")) || (d(h, "rubiconproject.com")) || (d(h, "an.yandex.ru") || d(h, "lcads.ru") || d(h, "marketgid.com") || d(h, "livesmi.com") || d(h, "recreativ.ru") || d(h, "adtraff.ru") || d(h, "profitwizard.ru") || d(h, "bannerbank.ru") || d(h, "24s.ru") || d(h, "addisp.com") || d(h, "addnow.ru") || d(h, "adizer.ru") || d(h, "adpix.ru") || d(h, "adpro.com.ua") || d(h, "adru.net") || d(h, "adsclick.ru") || d(h, "adsellers.net") || d(h, "advertpay.ru") || d(h, "bannerbank.ru") || d(h, "begun.ru") || d(h, "goodadvert.com.ua") || d(h, "mg.dt00.net") || d(h, "neoban.su") || d(h, "rs.mail.ru") || d(h, "seopult.ru") || d(h, "wmip.ru")) || (d(h, "rnmd.net") && s(u, "*m3u*")) || (d(h, "aimatch.com")) || (d(h, "eacdn.com")) || (d(h, "smaato.com") || d(h, "smaato.net")) || (d(h, "smartadserver.com")) || (d(h, "snapmobile.asia")) || (d(h, "startapp.com") || d(h, "startappexchange.com")) || (d(h, "taboolasyndication.com") || d(h, "taboola.com")) || (d(h, "tapjoyads.com") || d(h, "tapjoy.com")) || (d(h, "tradedoubler.com") && !s(u, "*tradedoubler.com/click*") && !s(u, "*itunesredir*")) || (d(h, "globaltraffico.com") || d(h, "traffichaus.com")) || (d(h, "trafmag.com")) || (d(h, "rarenok.biz")) || (d(h, "transpera.com")) || (d(h, "tribalfusion.com")) || (d(h, "andomedia.com")) || (d(h, "readserver.net") || d(h, "rtbpop.com") || d(h, "1phads.com") || d(h, "admngronline.com") || d(h, "dotandad.com") || d(h, "everestads.net")) || (d(h, "fastclick.net")) || (d(h, "vdopia.com")) || (d(h, "adcel.vrvm.com")) || (d(h, "intellitxt.com")) || (d(h, "videoplaza.tv") || d(h, "videoplaza.com")) || (d(h, "vkmonster.com")) || (d(h, "vserv.mobi")) || (d(h, "vungle.com")) || (d(h, "wigetmedia.com")) || (d(h, "yoc.mobi")) || (d(h, "yumenetworks.com")) || (d(h, "zedo.com")) || (d(h, "a.zestadz.com") || d(h, "assets.zestadz.com")) || (d(h, "zumobi.com"))) || ((d(h, "facebook.com") || d(h, "facebook.net") || d(h, "fb.com") || d(h, "fbcdn.net") || s(u, "*fbcdn*akamaihd.net*")) || (s(u, "*.facebook.net/*/all.js*")) || (s(u, "*facebook.com/plugins/like.php*")) || (s(u, "*/fbcdn*akamaihd.net/hads*") || s(u, "*fbcdn.net/hads*"))) || ((s(h, "ad.*") || s(h, "*.ad.*")) || (s(h, "ads.*") || s(h, "*.ads.*")) || (s(h, "adserv.*") || s(h, "*.adserv.*")) || (s(h, "adserver.*") || s(h, "*.adserver.*")) || (s(u, "*/ad/*") && !d(h, "mzstatic.com") && !d(h, "apple.com")) || (s(u, "*/ads/*")) || (s(u, "*/adserv/*")) || (s(u, "*/adserver/*") && !d(h, "apple.com")) || (s(u, "*/banner/*")) || (s(u, "*/banners/*"))) || ((d(h, "google\u002Danalytics.com")) || (d(h, "parsely.com")) || (d(h, "sitemeter.com")) || (d(h, "statcounter.com"))) || ((d(h, "twitter.com") || d(h, "twimg.com")) || (s(u, "*platform.twitter.com/widgets.js*")) || (s(u, "*.twitter.com/widgets/tweet_button*"))) || ((s(u, "*cookie*js") && !s(u, "*jquery*"))) || ((s(u, "*apis.google.com/u/0/_/+1/fastbutton*")) || (d(h, "plus.google.com"))) || ((s(u, "*/mobiquo/mobiquo.php*") || s(u, "*/mobiquo/smartbanner/*.js*"))) || ((d(h, "disqus.com") || d(h, "disquscdn.com"))) || ((d(h, "gravatar.com"))) || ((d(h, "linkedin.com"))) || ((d(h, "livefyre.com") || d(h, "fyre.co"))) || ((d(h, "myspace.com"))) || ((d(h, "sumome.com"))) || ((s(u, "*.pandora.com*/ads/*") || s(u, "*.pandora.com*getadmetadata*") || s(u, "*.pandora.com*registerad*") || d(h, "stats.pandora.com") || s(u, "*.pandora.com*getlicensing*"))) || ((d(h, "rewardtv.com") || d(h, "ads.hulu.com") || s(u, "*.hulu.com/published/*adstranscode*"))))) {
return BLACK;
}
return PROXY_DIRECT;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment