2 wangyougu010 wangyougu010 于 2016.03.13 03:22 提问

java中执行js代码,返回结果,求助各位。谢谢

使用了org.mozilla包,但是总报缺少分号;跟各位求个完整实现。

 function getCookie() {
            var dynamicurl = "";
        var wzwschallenge = "RANDOMSTR13359";
        var wzwschallengex = "STRRANDOM13359";
        var template = 8;
        var encoderchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

        function KTKY2RBD9NHPBCIHV9ZMEQQDARSLVFDU(str) {
            var out, i, len;
            var c1, c2, c3;
            len = str.length;
            i = 0;
            out = "";
            while (i < len) {
                c1 = str.charCodeAt(i++) & 0xff;
                if (i == len) {
                    out += encoderchars.charAt(c1 >> 2);
                    out += encoderchars.charAt((c1 & 0x3) << 4);
                    out += "==";
                    break;
                }
                c2 = str.charCodeAt(i++);
                if (i == len) {
                    out += encoderchars.charAt(c1 >> 2);
                    out += encoderchars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xf0) >> 4));
                    out += encoderchars.charAt((c2 & 0xf) << 2);
                    out += "=";
                    break;
                }
                c3 = str.charCodeAt(i++);
                out += encoderchars.charAt(c1 >> 2);
                out += encoderchars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xf0) >> 4));
                out += encoderchars.charAt(((c2 & 0xf) << 2) | ((c3 & 0xc0) >> 6));
                out += encoderchars.charAt(c3 & 0x3f);
            }
            return out;
        }
        function findDimensions() {
            var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
            var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
            if (w * h <= 120000) {
                return true;
            }
            var x = window.screenX;
            var y = window.screenY;
            if (x + w <= 0 || y + h <= 0 || x >= window.screen.width || y >= window.screen.height) {
                return true;
            }
            return false;
        }
        function QWERTASDFGXYSF() {
            var tmp = wzwschallenge + wzwschallengex;
            var hash = 0;
            var i = 0;
            for (i = 0; i < tmp.length; i++) {
                hash += tmp.charCodeAt(i);
            }
            hash *= 23;
            hash += 111111;
            return "WZWS_CONFIRM_PREFIX_LABEL8" + hash;
        }
            if (findDimensions()) {} else {
                var cookieString = "";
                cookieString = "wzwstemplate=" + KTKY2RBD9NHPBCIHV9ZMEQQDARSLVFDU(template.toString()) + "; path=/";
                document.cookie = cookieString;
                var confirm = QWERTASDFGXYSF();
                cookieString = "wzwschallenge=" + KTKY2RBD9NHPBCIHV9ZMEQQDARSLVFDU(confirm.toString()) + "; path=/";
                document.cookie = cookieString;
                return cookieString;
            }
        }
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!