@dzek69 gdy na stronie co podałeś wyżej wklejam ten kod co poniżej to generuje mi link kod ale gdy chcę użyć tej biblioteki to wywala błąd
(function() {
var userAgent = navigator.userAgent.toLowerCase();
var allow = false;
function getAndroidVersion() {
var userAgent = navigator.userAgent;
var match = userAgent.match(/Android\s([0-9\.]*)/);
return match ? match[1] : false;
}
function isAndroidNativeBrowser() {
var userAgent = navigator.userAgent;
return ((userAgent.indexOf('Mozilla/5.0') > -1
&& userAgent.indexOf('Android ') > -1
&& userAgent.indexOf('Version/') > -1
&& userAgent.indexOf('AppleWebKit') > -1));
};
if (userAgent.indexOf('android') !== -1) {
//if (getAndroidVersion() > '4.1.2' && !isAndroidNativeBrowser()) {
allow = true;
//}
} else if (userAgent.indexOf('iphone') !== -1
|| userAgent.indexOf('ipod') !== -1
|| userAgent.indexOf('ipad') !== -1) {
allow = true;
}
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('i(n){m(\'5\',\'1://h.3.2/f/g/e.a\',\'1://b.3.2/c/7/6-9.d\',k)}j{l 0=u.t(\'5\');0.o.s=\'r\';0.4("8","8");0.4("p",\'1://b.3.2/c/7/6-9.d\');0.4("q",\'1://h.3.2/f/g/e.a\')}',31,31,'video|http|pl|cda|setAttribute|mediaplayer720157|6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|oryginalne|controls|101|mp4|img|vid|jpg|lq6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|i9v5kJ2LTmkvo8PxrUqwFQ|1467414758|le023|if|else|true|var|addPlayer|allow|style|poster|src|block|display|getElementById|document'.split('|'),0,{}))
})();
A tutaj użycie bibloteki :
String encode = "function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c])}}return p}('m(l){o(\\'6\\',\\'1://i.2.3/h-g/e/d.8\\',\\'1://a.2.3/b/c/5-9.f\\',k)}j{n 0=v.u(\\'6\\');0.p.t=\\'s\\';0.4(\"7\",\"7\");0.4(\"q\",\\'1://a.2.3/b/c/5-9.f\\');0.4(\"r\",\\'1://i.2.3/h-g/e/d.8\\')}',32,32,'video|http|cda|pl|setAttribute|6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|mediaplayer720157|controls|mp4|101|img|vid|oryginalne|lq6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|1467332121|jpg|okTg|5By6ukgeoGwJanZML|le023|else|true|allow|if|var|addPlayer|style|poster|src|block|display|getElementById|document'.split('|'),0,{})";
JsEvaluator jsEvaluator = new JsEvaluator(this);
jsEvaluator.evaluate(encode, new JsCallback() {
@Override
public void onResult(String s) {
Log.d(TAG, "item = " + s);
}
});
lub
String encode_test = "(function() {\n" +
"\t\tvar userAgent = navigator.userAgent.toLowerCase();\n" +
"\t\tvar allow = false;\n" +
"\t\tfunction getAndroidVersion() {\n" +
"\t\t\tvar userAgent = navigator.userAgent;\n" +
"\t\t\tvar match = userAgent.match(/Android\\s([0-9\\.]*)/);\n" +
"\t\t\treturn match ? match[1] : false;\n" +
"\t\t}\n" +
"\t\tfunction isAndroidNativeBrowser() {\n" +
"\t\t\tvar userAgent = navigator.userAgent;\n" +
"\t\t\treturn ((userAgent.indexOf('Mozilla/5.0') > -1 \n" +
"\t\t\t\t\t\t&& userAgent.indexOf('Android ') > -1 \n" +
"\t\t\t\t\t\t&& userAgent.indexOf('Version/') > -1\n" +
"\t\t\t\t\t\t&& userAgent.indexOf('AppleWebKit') > -1));\n" +
"\t\t};\n" +
"\t\tif (userAgent.indexOf('android') !== -1) {\n" +
"\t\t\t//if (getAndroidVersion() > '4.1.2' && !isAndroidNativeBrowser()) {\n" +
"\t\t\t\tallow = true;\n" +
"\t\t\t//}\n" +
"\t\t} else if (userAgent.indexOf('iphone') !== -1\n" +
"\t\t\t\t\t|| userAgent.indexOf('ipod') !== -1\n" +
"\t\t\t\t\t|| userAgent.indexOf('ipad') !== -1) {\n" +
"\t\t\tallow = true;\n" +
"\t\t}\n" +
"\n" +
"\t\t \t\t eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c])}}return p}('i(n){m(\\'5\\',\\'1://h.3.2/f/g/e.a\\',\\'1://b.3.2/c/7/6-9.d\\',k)}j{l 0=u.t(\\'5\\');0.o.s=\\'r\\';0.4(\"8\",\"8\");0.4(\"p\",\\'1://b.3.2/c/7/6-9.d\\');0.4(\"q\",\\'1://h.3.2/f/g/e.a\\')}',31,31,'video|http|pl|cda|setAttribute|mediaplayer720157|6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|oryginalne|controls|101|mp4|img|vid|jpg|lq6ee0563d4635f2c377cca5697f4788e03d4f349673c873a71b1cf574a942c2b5|i9v5kJ2LTmkvo8PxrUqwFQ|1467414758|le023|if|else|true|var|addPlayer|allow|style|poster|src|block|display|getElementById|document'.split('|'),0,{}))\n" +
"\t})();";
JsEvaluator jsEvaluator = new JsEvaluator(this);
jsEvaluator.evaluate(encode_test, new JsCallback() {
@Override
public void onResult(String s) {
Log.d(TAG, "item = " + s);
}
});