Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@缘分@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi57yY5YiGIiwiYXV0aG9yIjoi57yY5YiGIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjIwMjQwOTI3LCJjb2xfdHlwZSI6Imljb25fcm91bmRfc21hbGxfNCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5jb25zdCBRSU5HX1RJVExFID0gZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpLFxuICAgIG5ld1dpbmRvdyA9IHJlYWRGaWxlKCduZXdXaW5kb3cnKSxcbiAgICB0eXBlU2hvdyA9IGdldE15VmFyKCd0eXBlU2hvdycsICdAJyksXG4gICAgdHlwZXMgPSB7ICdhbGwnOiAn6IGa5ZCIJywgJ3ZpZGVvJzogJ+inhumikfCfjosnLCAnbXVzaWMnOiAn6Z+z6aKR8J+NgicsICdsaXZlJzogJ+ebtOaSrfCfjYEnLCAnY2FydG9vbic6ICfmvKvnlLvwn4y+JywgJ3JlYWQnOiAn6ZiF6K+78J+MuicsICdwaWN0dXJlJzogJ+WbvumbhvCfjLsnLCAnbmV3cyc6ICfotYTorq/wn4y/JywgJ3Rvb2wnOiAn5bel5YW38J+OhCcsICdvdGhlcic6ICflhbblroPwn42AJyB9XG5sZXQgZWwgPSBbe1xuICAgICAgICB0aXRsZTogJyAnICsgUUlOR19USVRMRS5ib2xkKCkgKyAnICZuYnNwICZuYnNwICcgKyAn4pqZIOi9u+WQiOmbhuiuvue9riDimpkgJm5ic3AgJy5zbW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ib7lsI/nqIvluo/lhbPplK7or40nKS5pbnB1dCgoKSA9PiB7XG4gICAgICAgIHB1dE15VmFyKCd0eXBlU2hvdycsICdAJyArIGlucHV0KVxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcbiAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgIH0pLFxuICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcbn0gOiB7XG4gICAgdGl0bGU6ICfigJzigJzigJ3igJ3lhajpg6jwn4y4ICcgKyAocnVsZXMubGVuZ3RoKS50b1N0cmluZygpLnNtYWxsKCksXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgcHV0TXlWYXIoJ3R5cGVTaG93JywgJ0AnKVxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcbiAgICAgICAgcmV0dXJuICd0b2FzdDovL+WGjeasoeeCueWHu+OAkOWFqOmDqOOAkeWPr+afpeaJvuWwj+eoi+W6jydcbiAgICB9KSxcbiAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXG59KVxuZm9yIChsZXQgayBpbiB0eXBlcylcbiAgICBpZiAoayBpbiBydWxlc1R5cGUpXG4gICAgICAgIGVsLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgKGsgPT0gdHlwZVNob3cgPyB0eXBlc1trXS5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiB0eXBlc1trXSkgKyAnICcgKyAocnVsZXNUeXBlW2tdLmxlbmd0aCkudG9TdHJpbmcoKS5zbWFsbCgpLFxuICAgICAgICAgICAgdXJsOiBrID09IHR5cGVTaG93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaykgPT4ge1xuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0eXBlU2hvdycsIGspXG4gICAgICAgICAgICAgICAg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aXRsZTogdi50aXRsZSxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9mcmFtZUxvYWQnLFxuICAgICAgICAgICAgaW1nOiB2Lmljb24gfHwgJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcbiAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgdXJsOiBkb21haW4gKyAnLyNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMjIyMnICsgZnlwYWdlICtcbiAgICAgICAgICAgICAgICAgICAgJy5qczpsZXQgeyBydW5Db2RlLCBpbmRleFVybCB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL2Z1bmNUb29sc++8n++8n3J1bGU9JyArIFFJTkdfVElUTEUgKyAnXCIsICdcbiAgICAgICAgICAgICAgICAgICAgICsgSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVUbXApKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFFJTkdfVElUTEU6IFFJTkdfVElUTEVcbiAgICAgICAgICAgICAgICAgICAgfSkgKyAnKe+8m++8m2luZGV4VXJsKGlucHV0KTsnICsgcGFyYW1IYW5kbGUodXJsUGFyYW0sIHYudWEpLFxuICAgICAgICAgICAgICAgIFJVTEU6IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeSh7IHRpdGxlOiB2LnRpdGxlIH0pKSxcbiAgICAgICAgICAgICAgICBpc0luZGV4OiB0cnVlXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICBpZiAobmV3V2luZG93KSBPYmplY3QuYXNzaWduKGQuZXh0cmEsIHtcbiAgICAgICAgbmV3V2luZG93OiB0cnVlLFxuICAgICAgICB3aW5kb3dJZDogUUlOR19USVRMRSArICdfJyArIGQudGl0bGVcbiAgICB9KVxuICAgIGVsLnB1c2goZClcbn0pXG5zZXRS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cpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBmb2xkZWQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pXFxuICAgICAgICBsZXQgYXJyID0gZm9sZGVkID8gW3RoaXMuYXJyWzBdXSA6IHRoaXMuYXJyXFxuICAgICAgICBhcnIuZm9yRWFjaCgodikgPT4ge1xcbiAgICAgICAgICAgIGxldCB7IGlkLCBjbGFzc19uYW1lLCBjbGFzc191cmwgfSA9IHYsXFxuICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogc2VsZWN0ZWQgPT0gbm93ID8gJ+KAnOKAnOKAneKAnScgKyBuYW1lLmZvbnRjb2xvcih0aGlzLmNvbG9yKS5ib2xkKCkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzZWxlY3RlZCA9PSBub3cgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc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aXRlRmlsZShpbnB1dCwgSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSW50ZXJ2YWw6IHVwZGF0ZUludGVydmFsLFxcbiAgICAgICAgICAgICAgICAgICAgbmV3V2luZG93OiBuZXdXaW5kb3csXFxuICAgICAgICAgICAgICAgICAgICB0YWJGb2xkOiB0YWJGb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgZGlzYWJsZUN1c3RvbTogZGlzYWJsZUN1c3RvbSxcXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbURhdGE6IGN1c3RvbURhdGEsXFxuICAgICAgICAgICAgICAgICAgICBydWxlczogcnVsZXNcXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LlpIfku73vvIzms6jmhI/oi6Xku5PlupPkuLrlrZDpobXpnaLliJnkuI3lpIfku70nXFxuICAgICAgICAgICAgfSwgdXJsLCB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tKVxcbiAgICAgICAgZWxzZSByZXR1cm4gJCgnaGlrZXI6Ly9maWxlcy90bXAvJyArIFFJTkdfVElUTEUgKyAnX2JhY2t1cC5qc29uJywgJ+i+k+WFpeWkh+S7vei3r+W+hCcpLmlucHV0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICBsZXQgeyB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tLCBjdXN0b21EYXRhLCBydWxlcyB9ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSlcXG4gICAgICAgICAgICBzYXZlRmlsZSgndXBkYXRlSW50ZXJ2YWwnLCB1cGRhdGVJbnRlcnZhbClcXG4gICAgICAgICAgICBzYXZlRmlsZSgnbmV3V2luZG93JywgbmV3V2luZG93KVxcbiAgICAgICAgICAgIHNhdmVGaWxlKCd0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cXG4gICAgbGV0IGQgPSB7IHRpdGxlOiB2LnRpdGxlLCBpbWc6IGRhdGFbaV0uaWNvbiB9XFxuICAgIHN3aXRjaCAoZWRpdE1vZGUpIHtcXG4gICAgICAgIGNhc2UgJ+WQr+eUqC/npoHnlKgnOlxcbiAgICAgICAgICAgIGQudGl0bGUgPSAodi52aXNpYmxlID8gJ/Cfn6IgICcgOiAn8J+UtCAgJykgKyBkLnRpdGxlXFxuICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBydWxlc1tpXS52aXNpYmxlID0gIXJ1bGVzW2ldLnZpc2libGVcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgIC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AgICAgICAgICAgIHJlcyA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYywgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZUluZGV4ID0gcmVzLnVybC5pbmRleE9mKCcuanM6JylcXG4gICAgICAgICAgICAgICAgaWYgKHJlSW5kZXggPj0gMCkgcmVzLnVybCA9IHJlcy51cmwuc2xpY2UoMCwgcmVJbmRleCkgKyAnLmpzOicgKyBoaWphY2tMYXp5UnVsZSArICc7JyArIHJlcy51cmwuc2xpY2UocmVJbmRleCArIDQpXFxuICAgICAgICAgICAgfSBlbHNlICBpZiAoZGV0YWlsRmluZFJ1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBnZW5FeFVybCh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oZ2VuTXlSdWxlKCksIHsgZGV0YWlsX2ZpbmRfcnVsZTogZGV0YWlsRmluZFJ1bGUgfSkpKSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChNWV9SVUxFLmRldGFpbF9maW5kX3J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