diff --git a/doc/README.md b/doc/README.md deleted file mode 100644 index 41524ad44cd847dda816d320803d096b194bf5cb..0000000000000000000000000000000000000000 --- a/doc/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# DEPRECATED -Please do not use this directory for document any more. - -## Where should you go - -We have repository for monitoring the Web Wechat source code at here: - - -Please check the latest version of `webwxApp.js` at here: - - -And if you want to reference any code in `webwxApp.js`, please do not forget to use a specific commit hash, like this: - - -Thanks! - -Huan diff --git a/doc/stats.js b/doc/stats.js deleted file mode 100755 index d2a2417d548a2edd7ae3609818d8f60828208914..0000000000000000000000000000000000000000 --- a/doc/stats.js +++ /dev/null @@ -1,275 +0,0 @@ -function AQ_SECAPI_ESCAPE(Url, map) { - var tmpArr = new Array; - for (var m = 0; m < Url.length; m++) { - if (Url.charAt(m) == '&') { - var keyLen = [3, 4, 5, 9]; - var matchFlag = 0; - for (var n in keyLen) { - var l = keyLen[n]; - if (m + l <= Url.length) { - var subLow = Url.substr(m, l).toLowerCase(); - if (map[subLow]) { - tmpArr.push(map[subLow]); - m = m + l - 1; - matchFlag = 1; - break; - } - } - } - if (matchFlag == 0) { - tmpArr.push(Url.charAt(m)); - } - } else { - tmpArr.push(Url.charAt(m)); - } - } - return tmpArr.join(""); -} -function AQ_SECAPI_CheckXss() { - var map = new Object(); - var escapeChars = "'\"<>`script:daex/hml;bs64,"; - for (var i = 0; i < escapeChars.length; i++) { - var cha = escapeChars.charAt(i); - var dec = cha.charCodeAt(); - var dec7 = dec; - var hex = dec.toString(16); - for (var j = 0; j < (7 - dec.toString().length); j++) { - dec7 = "0" + dec7; - } - map["&#" + dec + ";"] = cha; - map["&#" + dec7] = cha; - map["&#x" + hex] = cha; - } - map["<"] = "<"; - map[">"] = ">"; - map["""] = "\""; - var Url = location.href; - var Refer = document.referrer; - Url = decodeURIComponent(AQ_SECAPI_ESCAPE(Url, map)); - Refer = decodeURIComponent(AQ_SECAPI_ESCAPE(Refer, map)); - var XssPattern = new RegExp("['\"<>`]|script:|data:text/html;base64,"); - if (XssPattern.test(Url) || XssPattern.test(Refer)) { - var version = '1.5' - , cgi = 'http://zyjc.sec.qq.com/dom' - , img = new Image(); - img.src = cgi + "?v=" + version + "&u=" + encodeURIComponent(Url) + "&r=" + encodeURIComponent(Refer); - Url = Url.replace(/['\"<>`]|script:/gi, 'M'); - Url = Url.replace(/data:text\/html;base64,/gi, 'data:text/plain;base64,'); - location.href = encodeURI(Url); - } -} -AQ_SECAPI_CheckXss(); -(function(_wnd, _doc, _ln) { - function checkNonTxDomain(level, bid, pagetype) { - var checkInfo = { - bid: bid, - childUrl: "", - parentUrl: "" - }, childCheckFlag, parentCheckFlag; - try { - checkInfo.childUrl = _ln.href; - } catch (ign) {} - try { - checkInfo.parentUrl = parent.location.href; - } catch (ign) {} - if (Math.random() > level) { - return; - } - if (pagetype == 1) { - try { - parentCheckFlag = (parent != _wnd) ? generateNonTxDomainFromDom(parent.document, 'datapp', checkInfo) : false; - } catch (ign) {} - } else { - try { - childCheckFlag = generateNonTxDomainFromDom(_doc, 'datapt', checkInfo); - parentCheckFlag = (parent != _wnd) ? generateNonTxDomainFromDom(parent.document, 'datapp', checkInfo) : false; - } catch (ign) {} - try { - if (parent != _wnd) { - generateZyjIframed(checkInfo); - } - } catch (ign) {} - } - } - function generateZyjIframed(checkInfo) { - var data = []; - data.push("beframed::url"); - packZyjUrlData(data, 'beframed', checkInfo); - } - function packZyjUrlData(data, dataMark, checkInfo) { - var version = '1.4' - , cgi = 'http://zyjc.sec.qq.com/cr' - , img = new Image(); - data.push("childUrl::" + encodeURIComponent(checkInfo.childUrl)); - data.push("parentUrl::" + encodeURIComponent(checkInfo.parentUrl)); - img.src = cgi + "?id=" + checkInfo.bid + "&d=" + dataMark + "=v" + version + "|" + data.join('|'); - return true; - } - function generateNonTxDomainFromDom(dom, parentMark, checkInfo) { - var scriptData = extractNonTxScriptWorm(dom); - var iframeData = extractNonTxIframe(dom); - var frameData = extractNonTxFrame(dom); - var embedData = extractNonTxEmbed(dom); - var imgData = extractNonTxIMG(dom); - var hacks = scriptData.concat(iframeData, frameData, imgData, embedData); - if (hacks.length <= 0) { - return false; - } - hacks = distinctZyjArray(hacks); - packZyjUrlData(hacks, parentMark, checkInfo); - } - function extractNonTxScriptWorm(dom) { - var scripts = dom.getElementsByTagName("script"), scriptData = [], tempScript, urlList, url, nonTxList, mapFunc, resultList; - for (var i = 0; i < scripts.length; i++) { - tempScript = scripts[i]; - if (url = tempScript.src) { - scriptData.push(url); - } - } - nonTxList = grepZyjList(scriptData, isAntiTxDomain); - mapFunc = addTagToZyjUrlCallback('script'); - resultList = mapZyjList(nonTxList, mapFunc); - return resultList; - } - function extractNonTxScript(dom) { - var scripts = dom.getElementsByTagName("script"), scriptData = [], tempScript, urlList, url, nonTxList, mapFunc, resultList; - for (var i = 0; i < scripts.length; i++) { - tempScript = scripts[i]; - urlList = extractZyjUrlFromHtml(tempScript.innerHTML); - scriptData = scriptData.concat(urlList); - if (url = tempScript.src) { - scriptData.push(url); - } - } - nonTxList = grepZyjList(scriptData, isAntiTxDomain); - mapFunc = addTagToZyjUrlCallback('script_worm'); - resultList = mapZyjList(nonTxList, mapFunc); - return resultList; - } - function extractZyjUrlFromHtml(html) { - var regUrl = /\bhttps?:\/\/[^\"\'\s]+/ig - , urlList = []; - while (url = regUrl.exec(html)) { - urlList.push(url); - } - return urlList; - } - function grepZyjList(testList, testFunction) { - var grepList = []; - for (var idx = 0; idx < testList.length; ++idx) { - var temp = testList[idx]; - if (testFunction(temp)) { - grepList.push(temp); - } - } - return grepList; - } - function isAntiTxDomain(sUrl) { - var sDomain = extractZyjDomain(sUrl), regErrDom, regTxCom, regTxCn, regTxNet, regTxOther; - if (!sDomain) { - return false; - } - regErrDom = /^xui.ptlogin2?\.?$/i; - regTxCom = /(\.|^)(qq|paipai|soso|wenwen|tenpay|macromedia|gtimg|qstatic|qqmail|paipaiimg|qqgames|pengyou|foxmail|qzoneapp|qzone|qplus|imqq|tqapp|tencent|3366|21mmo|taotao|imrworldwide|idqqimg|17roco|expo2010china|fangqq|tencentmind|tencity|yingkebicheng|zhangzhongxing|expovol|otaworld|gzyunxun|heyyo|himoral|himorale|myrtx|qqwinner|redian|sjkx|rtxonline|nbaso|paipai\.500wan|qqjapan|qq\.salewell|sogou|weiyun|flzhan)\.com$/i; - regTxCn = /(\.|^)(qq\.com|gtimg|gtimg\.com|qlogo|foxmail\.com|gtimg\.com|url|qpic|tencent\.com|expo2010|expo|himorale\.com|nbaso\.com|qqtest\.com|qq\.ucar|rtx\.com|soso\.com|tcimage)\.cn$/i; - regTxNet = /(\.|^)(5999|gongyi)\.net$/i; - regTxOther = /(\.|^)(himorale\.com\.hk|tencent\.com\.hk|qq\.chinacache\.net|qq\.com\.fastcdn\.com|qq\.com\.lxdns\.com|qq\.fastcdn\.com|soso\.com\.lxdns\.com|motu\.pagechoice\.net|ope\.tanx\.com|dap\.gentags\.net)$/i; - if (regErrDom.test(sDomain) || regTxCom.test(sDomain) || regTxCn.test(sDomain) || regTxNet.test(sDomain) || regTxOther.test(sDomain)) { - return false; - } - return true; - } - function extractZyjDomain(sUrl) { - var regDomain = /^https?:\/\/([\w\-]+\.[\w\-.]+)/i - , m = regDomain.exec(sUrl); - if (!m) { - return; - } - return m[1]; - } - function addTagToZyjUrlCallback(tag) { - return function(url) { - return tag + "::" + encodeURIComponent(url); - } - ; - } - function mapZyjList(testList, testFunction) { - var mapList = [], temp, mapTemp; - for (var idx = 0; idx < testList.length; ++idx) { - temp = testList[idx]; - mapTemp = testFunction(temp); - mapList.push(mapTemp); - } - return mapList; - } - function extractNonTxIframe(dom) { - var tagName = 'IFRAME' - , rawFunc = function(x) { - return x.src - } - , mapFunc = addTagToZyjUrlCallback('iframe'); - return extractNonTxTagData(dom, tagName, rawFunc, isAntiTxDomain, mapFunc); - } - function extractNonTxEmbed(dom) { - var tagName = 'EMBED' - , rawFunc = function(x) { - return x.src - } - , mapFunc = addTagToZyjUrlCallback('embed'); - return extractNonTxTagData(dom, tagName, rawFunc, isAntiTxDomain, mapFunc); - } - function extractNonTxTagData(dom, tag, rawFunc, grepFunc, mapFunc) { - var tags = dom.getElementsByTagName(tag); - var tagRaw = mapZyjList(tags, rawFunc); - var tagData = grepZyjList(tagRaw, grepFunc); - var tagResult = mapZyjList(tagData, mapFunc); - return tagResult; - } - function extractNonTxFrame(dom) { - var tagName = 'FRAME' - , rawFunc = function(x) { - return x.src - } - , mapFunc = addTagToZyjUrlCallback('frame'); - return extractNonTxTagData(dom, tagName, rawFunc, isAntiTxDomain, mapFunc); - } - function extractNonTxForm(dom) { - var tagName = 'FORM' - , rawFunc = function(x) { - return x.action - } - , mapFunc = addTagToZyjUrlCallback('form'); - return extractNonTxTagData(dom, tagName, rawFunc, isAntiTxDomain, mapFunc); - } - function extractNonTxIMG(dom) { - var tagName = 'IMG' - , rawFunc = function(x) { - return x.src - } - , mapFunc = addTagToZyjUrlCallback('img'); - return extractNonTxTagData(dom, tagName, rawFunc, isAntiTxDomain, mapFunc); - } - function distinctZyjArray(list) { - var sortList = list.slice(0) - , derivedArray = []; - sortList.sort(); - derivedArray.push(sortList[0]); - for (var i = 1; i < sortList.length; i += 1) { - if (sortList[i] != sortList[i - 1]) { - derivedArray.push(sortList[i]); - } - } - return derivedArray; - } - _wnd.checkNonTxDomain = checkNonTxDomain; -})(window, document, location); -try { - setTimeout(function() { - checkNonTxDomain(0.1, 100, 1); - }, 0); -} catch (ign) {} -try { - setTimeout(function() { - checkNonTxDomain(0.1, 100, 0); - }, 3000); -} catch (ign) {} diff --git a/doc/webwxapp.js b/doc/webwxapp.js deleted file mode 100644 index 2975aa940f209015167bc5229cf34079df212b32..0000000000000000000000000000000000000000 --- a/doc/webwxapp.js +++ /dev/null @@ -1,8584 +0,0 @@ -!function() { - var e, t = function() {} - , o = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], n = o.length; - 0 == /mmdebug/.test(location.search) && location.href.indexOf("dev.web.weixin") < 0 && (window.console = {}); - for (var r = window.console = window.console || {}; n--; ) - e = o[n], - r[e] || (r[e] = t) -}(), -angular.module("Controllers", []), -!function() { - "use strict"; - location.href.indexOf("dev.web") < 0 ? angular.module("exceptionOverride", []).factory("$exceptionHandler", [function() { - return function(e) { - throw window._errorHandler && window._errorHandler(e), - console.log(e), - e - } - } - ]) : angular.module("exceptionOverride", []), - angular.module("Controllers").controller("appController", ["$rootScope", "$scope", "$timeout", "$log", "$state", "$window", "ngDialog", "mmpop", "appFactory", "loginFactory", "contactFactory", "accountFactory", "chatFactory", "confFactory", "contextMenuFactory", "notificationFactory", "utilFactory", "reportService", "actionTrack", "surviveCheckService", "subscribeMsgService", "stateManageService", function( - e // $rootScope - , t // $scope - , o // $timeout - , n // $log - , r // $state - , a // $window - , i // ngDialog - , c // mmpop - , s // appFactory - , l // loginFactory - , u // contactFactory - , f // accountFactory - , d // chatFactory - , g // confFactory - , m // contextMenuFactory - , p // notificationFactory - , h // utilFactory - , M // reportService - , y // actionTrack - , C // surviveCheckService - , v // subscribeMsgService - , w // stateManageService - ) { - function S() { - return u.pickContacts(["friend", "chatroom"], { - chatroom: { - keyword: t.keyword, - isNewArray: !0 - }, - friend: { - keyword: t.keyword, - isNewArray: !0, - isWithoutBrand: !0, - showFriendHeader: !0 - } - }, !0).result - } - function b() { - var e = k; - e && setTimeout(function() { - var t = (e[0].clientHeight - e.find(".ngdialog-content").height()) / 2; - e.css("paddingTop", t) - }, 20) - } - function T() { - t.isLoaded = !0, - t.isUnLogin = !1, - M.report(M.ReportType.timing, { - timing: { - initStart: Date.now() - } - }), - s.init().then(function(n) { - if (h.log("initData", n), - n.BaseResponse && "0" != n.BaseResponse.Ret) - return console.log("BaseResponse.Ret", n.BaseResponse.Ret), - void (l.timeoutDetect(n.BaseResponse.Ret) || i.openConfirm({ - className: "default ", - templateUrl: "comfirmTips.html", - controller: ["$scope", function(e) { - e.title = MM.context("02d9819"), - e.content = MM.context("0d2fc2c"), - M.report(M.ReportType.initError, { - text: "程序初始化失败,点击确认刷新页面", - code: n.BaseResponse.Ret, - cookie: document.cookie - }), - e.callback = function() { - document.location.reload(!0) - } - } - ] - })); - f.setUserInfo(n.User), - f.setSkey(n.SKey), - f.setSyncKey(n.SyncKey), - u.addContact(n.User), - u.addContacts(n.ContactList), - d.initChatList(n.ChatSet), - d.notifyMobile(f.getUserName(), g.StatusNotifyCode_INITED), - v.init(n.MPSubscribeMsgList), - e.$broadcast("root:pageInit:success"), - h.setCheckUrl(f), - h.log("getUserInfo", f.getUserInfo()), - t.$broadcast("updateUser"), - M.report(M.ReportType.timing, { - timing: { - initEnd: Date.now() - } - }); - var r = n.ClickReportInterval || 3e5; - setTimeout(function a() { - y.report(), - setTimeout(a, r) - }, r), - o(function() { - function e(o) { - u.initContact(o).then(function(o) { - u.addContacts(o.MemberList), - M.report(M.ReportType.timing, { - timing: { - initContactEnd: Date.now() - }, - needSend: !0 - }), - 16 >= t && o.Seq && 0 != o.Seq && (t++, - e(o.Seq)) - }) - } - M.report(M.ReportType.timing, { - timing: { - initContactStart: Date.now() - } - }); - var t = 1; - e(0) - }, 0), - t.account = u.getContact(f.getUserName()), - E() - }) - } - function E() { - t.debug && (F && o.cancel(F), - C.start(4e4), - F = o(function() { - s.syncCheck().then(function(e) { - return C.start(5e3), - e - }, function(e) { - return C.start(2e3), - e - }).then(N, P) - }, g.TIMEOUT_SYNC_CHECK)) - } - function N(e) { - h.log("syncCheckHasChange", e); - try { - f.setSyncKey(e.SyncKey), - f.updateUserInfo(e.Profile, function() {}), - angular.forEach(e.DelContactList, function(t) { - d.deleteChatList(t.UserName), - d.deleteChatMessage(t.UserName), - u.deleteContact(t), - d.getCurrentUserName() == t.UserName && d.setCurrentUserName(""), - console.log("DelContactList", e.DelContactList) - }), - angular.forEach(e.ModContactList, function(t) { - u.addContact(t), - console.log("ModContactList", e.ModContactList) - }), - angular.forEach(e.AddMsgList, function(e) { - d.messageProcess(e) - }) - } catch (t) { - t.other = { - reason: "throw err when syncChackHasChange" - }, - window._errorHandler && window._errorHandler(t) - } finally { - E() - } - } - function P() { - E() - } - window._appTiming = {}, - r.go("chat"), - e.CONF = g, - t.isUnLogin = !window.MMCgi.isLogin, - t.debug = !0, - t.isShowReader = /qq\.com/gi.test(location.href), - window.MMCgi.isLogin && (T(), - h.browser.chrome && !MMDEV && (window.onbeforeunload = function(e) { - return e = e || window.event, - e && (e.returnValue = "关闭浏览器聊天内容将会丢失。"), - "关闭浏览器聊天内容将会丢失。" - } - )), - t.$on("newLoginPage", function(e, t) { - console.log("newLoginPage", t), - f.setSkey(t.SKey), - f.setSid(t.Sid), - f.setUin(t.Uin), - f.setPassticket(t.Passticket), - T() - }); - var A, I; - t.search = function() { - A && o.cancel(A), - A = o(function() { - return t.keyword ? (I && I.close(), - void (I = c.open({ - templateUrl: "searchList.html", - controller: ["$rootScope", "$scope", "$state", function(e, t, o) { - t.$watch(function() { - return u.contactChangeFlag - }, function() { - t.allContacts.length = 0, - t.allContacts.push.apply(t.allContacts, S()) - }), - t.clickUserCallback = function(n) { - n.UserName && (o.go("chat", { - userName: n.UserName - }), - t.closeThisMmPop(), - e.$broadcast("root:searchList:cleanKeyWord")) - } - } - ], - scope: { - keyword: t.keyword, - allContacts: S(), - heightCalc: function(e) { - return "header" === e.type ? 31 : 60 - } - }, - className: "recommendation", - autoFoucs: !1, - container: angular.element(document.querySelector("#search_bar")) - }))) : void (I && I.close()) - }, 200) - } - , - t.searchKeydown = function(t) { - switch (t.keyCode) { - case g.KEYCODE_ARROW_UP: - I && I.isOpen() && e.$broadcast("root:searchList:keyArrowUp"), - t.preventDefault(), - t.stopPropagation(); - break; - case g.KEYCODE_ARROW_DOWN: - I && I.isOpen() && e.$broadcast("root:searchList:keyArrowDown"), - t.preventDefault(), - t.stopPropagation(); - break; - case g.KEYCODE_ENTER: - I && I.isOpen() && e.$broadcast("root:searchList:keyEnter"), - t.preventDefault(), - t.stopPropagation() - } - } - , - t.$on("root:searchList:cleanKeyWord", function() { - t.keyword = "" - }); - var k; - t.$on("ngDialog.opened", function(e, t) { - w.change("dialog:open", !0), - k = t, - b() - }), - t.$on("ngDialog.closed", function() { - w.change("dialog:open", !1), - k = null - }), - $(window).on("resize", function() { - b() - }), - t.appClick = function(e) { - t.$broadcast("app:contextMenu:hide", e) - } - , - t.showContextMenu = function(e) { - t.$broadcast("app:contextMenu:show", e) - } - , - t.toggleSystemMenu = function() { - c.toggleOpen({ - templateUrl: "systemMenu.html", - top: 60, - left: 85, - container: angular.element(document.querySelector(".panel")), - controller: "systemMenuController", - singletonId: "mmpop_system_menu", - className: "system_menu" - }) - } - , - t.showProfile = function(e) { - if (t.account) { - var o = t.account - , n = e.pageY + 25 - , a = e.pageX + 6; - c.open({ - templateUrl: "profile_mini.html", - className: "profile_mini_wrap scale-fade", - top: n, - left: a, - blurClose: !0, - singletonId: "mmpop_profile", - controller: ["$scope", function(e) { - e.contact = o, - e.addUserContent = "", - e.isShowSendBox = !1, - e.chat = function(t) { - r.go("chat", { - userName: t - }), - e.closeThisMmPop() - } - } - ] - }) - } - } - , - t.dblclickChat = function() { - t.$broadcast("app:chat:dblclick") - } - , - t.requestPermission = function() { - p.requestPermission(function() { - h.log("请求权限了...") - }) - } - , - C.callback(E); - var F - } - ]) -}(), -!function() { - "use strict"; - angular.module("Controllers").controller("loginController", ["$scope", "loginFactory", "utilFactory", "reportService", function( - e // $scope - , t // loginFactory - , o // utilFactory - , n // reportService - ) { - $(".lang .lang-item").click(function(e) { - $("script").remove(), - location.href = e.target.href, - e.preventDefault() - }), - window.MMCgi.isLogin || t.getUUID().then(function(r) { - function a(i) { - switch (i.code) { - case 200: - t.newLoginPage(i.redirect_uri).then(function(t) { - var r = t.match(/(.*)<\/ret>/) - , a = t.match(/