WebViewJsUtil.smali 58.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
.class public Lcom/bytedance/applog/util/WebViewJsUtil;
.super Ljava/lang/Object;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bytedance/applog/util/WebViewJsUtil$g;,
        Lcom/bytedance/applog/util/WebViewJsUtil$h;
    }
.end annotation


# static fields
.field public static final BUNDLE_WEB_INFO:Ljava/lang/String; = "web_info"

.field public static final JS_CODE_COLLECT:Ljava/lang/String; = "!function(){\"use strict\";function t(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if(e&&(\"object\"==typeof e||\"function\"==typeof e))return e;return function(t){if(void 0===t)throw new ReferenceError(\"this hasn\'t been initialised - super() hasn\'t been called\");return t}(t)}function u(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=i(t);if(e){var a=i(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return o(this,n)}}function c(t,e,n){return(c=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(!r)return;var a=Object.getOwnPropertyDescriptor(r,e);if(a.get)return a.get.call(n);return a.value})(t,e,n||t)}function s(t){if([\"LI\",\"TR\",\"DL\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaIdx\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-idx\"))return!0;return!1}function l(t){if(!t)return!1;if([\"A\",\"BUTTON\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaContainer\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-container\"))return!0;return!1}function h(t){for(var e=t;e&&!l(e);){if(\"HTML\"===e.nodeName||\"BODY\"===e.nodeName)return t;e=e.parentElement}return e||t}function f(t){for(var e=[];null!==t.parentElement;)e.push(t),t=t.parentElement;var n=[],r=[];return e.forEach((function(t){var e=function(t){if(null===t)return{str:\"\",index:0};var e=0,n=t.parentElement;if(n)for(var r=0;r<n.children.length&&n.children[r]!==t;r++)n.children[r].nodeName===t.nodeName&&e++;return{str:[t.nodeName.toLowerCase(),s(t)?\"[]\":\"\"].join(\"\"),index:e}}(t),i=e.str,a=e.index;n.unshift(i),r.unshift(a)})),{element_path:\"/\".concat(n.join(\"/\")),positions:r}}function d(t){var e={element_path:\"\",positions:[],texts:[]},n=f(t),r=n.element_path,i=n.positions,a=function(t){var e=h(t),n=[];return!function t(e){var r=function(t){var e=\"\";return 3===t.nodeType?e=t.textContent.trim():t.dataset&&t.dataset.hasOwnProperty(\"teaTitle\")||t.hasAttribute(\"data-tea-title\")?e=t.getAttribute(\"data-tea-title\"):t.hasAttribute(\"title\")?e=t.getAttribute(\"title\"):\"INPUT\"===t.nodeName&&[\"button\",\"submit\"].includes(t.getAttribute(\"type\"))?e=t.getAttribute(\"value\"):\"IMG\"===t.nodeName&&t.getAttribute(\"alt\")&&(e=t.getAttribute(\"alt\")),e.slice(0,200)}(e);if(r&&-1===n.indexOf(r)&&n.push(r),e.childNodes.length>0)for(var i=e.childNodes,a=0;a<i.length;a++)8!==i[a].nodeType&&t(i[a])}(e),n}(t);e.element_path=r,e.positions=i.map((function(t){return\"\".concat(t)})),e.texts=a;var o=h(t);if(\"A\"===o.tagName&&(e.href=o.getAttribute(\"href\")),\"IMG\"===t.tagName){var u=t.getAttribute(\"src\");u&&0===u.trim().indexOf(\"data:\")&&(u=\"\"),e.src=u}return e.page_title=document.title,e.element_id=t.id,e.element_type=t.tagName,e}var p=function(){function e(n,r){var i=this;t(this,e),this.handler=function(t){var e=(t=i.getEvent(t)).target;if(!i.checkShouldTrackElement(e)||i.checkShouldIgnore(e))return;var n=i.getPositionData(e),r=i.getEventData(t,n),a=i.getElementData(e),o=i.getAllData(r,a,{element_width:Math.floor(n.element_width),element_height:Math.floor(n.element_height)});i.report(o)},this.info=n,this.autoTrack=r,this.listen()}return n(e,[{key:\"listen\",value:function(){this.autoTrack.root.addEventListener(this.info.eventType,this.handler,!0)}},{key:\"_checkShouldTrackElement\",value:function(t){return function(t){var e=window.innerHeight,n=window.innerWidth;if(1!==t.nodeType)return!1;if(function(t){for(var e=t.parentElement,n=!1;e;)\"svg\"===e.tagName.toLowerCase()?(e=null,n=!0):e=e.parentElement;return n}(t))return!1;if([\"HTML\",\"BODY\"].includes(t.tagName.toUpperCase()))return!1;var r=t;if(\"none\"===r.style.display)return!1;if(l(r))return!0;if(!function(t){if(t.children.length>0){var e=t.children;if([].slice.call(e).some((function(t){return t.children.length>0})))return!1;return!0}return!0}(r))return!1;if(r.clientHeight*r.clientWidth>.5*e*n)return!1;return!0}(t)}},{key:\"checkShouldTrackElement\",value:function(t){return!0}},{key:\"checkShouldIgnore\",value:function(t){return function(t){for(var e=t;e&&e.parentNode;){if(e.hasAttribute(\"data-tea-ignore\"))return!0;if(\"HTML\"===e.nodeName||\"body\"===e.nodeName)return!1;e=e.parentNode}return!1}(t)}},{key:\"getEvent\",value:function(t){return t}},{key:\"getEventData\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clientX,r=t.clientY,i=e.left,a=e.top;return{touch_x:Math.floor(n-i),touch_y:Math.floor(r-a)}}},{key:\"getElementData\",value:function(t){return d(t)}},{key:\"getPositionData\",value:function(t){if(!t)return;var e=t.getBoundingClientRect(),n=e.width,r=e.height;return{left:e.left,top:e.top,element_width:n,element_height:r}}},{key:\"getAllData\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.assign(Object.assign(Object.assign(Object.assign({},t),e),n),{is_html:1,page_key:window.location.href})}},{key:\"report\",value:function(t){this.autoTrack.report(this.info.eventName,t)}},{key:\"destroy\",value:function(){this.autoTrack.root.removeEventListener(this.info.eventName,this.handler,!0),this.autoTrack=null}}]),e}(),v=function(e){r(o,e);var a=u(o);function o(e){var n;t(this,o),(n=a.call(this,{eventName:\"bav2b_page\"},e)).handler=function(t){if(n.checkHref())return;n._handler()},n._handler=function(){n.setHref();var t=n.getAllData();n.report(t)},n._listen();try{\"loading\"===document.readyState?document.addEventListener(\"DOMContentLoaded\",n._handler):setTimeout(n._handler)}catch(t){}return n}return n(o,[{key:\"listen\",value:function(){}},{key:\"_listen\",value:function(){var t=this;this._oldPushState=history.pushState,this._oldReplaceState=history.replaceState,history.pushState=function(){try{for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t._oldPushState).call.apply(e,[history].concat(r))}finally{t._handler()}},history.replaceState=function(){try{for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t._oldReplaceState).call.apply(e,[history].concat(r))}finally{t._handler()}},window.addEventListener(\"hashchange\",this.handler,!0),window.addEventListener(\"popstate\",this.handler,!0)}},{key:\"setHref\",value:function(t){this._currentHref=t||window.location.href}},{key:\"checkHref\",value:function(){return this._currentHref===window.location.href}},{key:\"getAllData\",value:function(){return Object.assign(Object.assign({},c(i(o.prototype),\"getAllData\",this).call(this)),{is_bav:1,page_key:this._currentHref,refer_page_key:document.referrer,page_title:document.title,page_path:this._currentHref,referrer_page_path:document.referrer})}},{key:\"destroy\",value:function(){window.removeEventListener(\"popstate\",this.handler,!0),window.removeEventListener(\"hashchange\",this.handler,!0),history.pushState=this._oldPushState,history.replaceState=this._oldReplaceState,this._oldPushState=null,this._oldReplaceState=null,this.autoTrack=null}}]),o}(p),g=function(e){r(o,e);var a=u(o);function o(e){return t(this,o),a.call(this,{eventType:\"click\",eventName:\"bav2b_click\"},e)}return n(o,[{key:\"checkShouldTrackElement\",value:function(t){return c(i(o.prototype),\"_checkShouldTrackElement\",this).call(this,t)}}]),o}(p),y=function(e){r(o,e);var a=u(o);function o(e){var n;return t(this,o),(n=a.call(this,{eventName:\"bav2b_click\"},e)).startHandler=function(t){var e=n.autoTrack.root,r=!1,i=function(){r=!0};e.addEventListener(\"touchmove\",i,!0),e.addEventListener(\"touchend\",(function t(a){r||n.handler(a),e.removeEventListener(\"touchmove\",i,!0),e.removeEventListener(\"touchend\",t,!0)}),!0)},n._listen(),n}return n(o,[{key:\"listen\",value:function(){}},{key:\"_listen\",value:function(){this.autoTrack.root.addEventListener(\"touchstart\",this.startHandler,!0)}},{key:\"getEvent\",value:function(t){return t.changedTouches[0]}},{key:\"checkShouldTrackElement\",value:function(t){if(!c(i(o.prototype),\"_checkShouldTrackElement\",this).call(this,t))return!1;if(\"input\"===t.nodeName.toLowerCase()&&[\"text\",\"password\",\"email\",\"tel\",\"number\",\"url\"].includes(t.type))return!1;return!0}},{key:\"destroy\",value:function(){this.autoTrack.root.removeEventListener(\"touchstart\",this.startHandler,!0),this.autoTrack=null}}]),o}(p),m=function(){function e(){t(this,e),this.version=\"1.2.1\",this.options={page:!1,touch:!1,click:!1},this.root=document,this.eventInstances=[],this.started=!1}return n(e,[{key:\"init\",value:function(t,e){this.options=Object.assign(Object.assign({},this.options),t),this.reportAdapter=e}},{key:\"start\",value:function(){if(this.started)return;this.started=!0;var t=this.options,e=t.page,n=t.click,r=t.touch;e&&this.eventInstances.push(new v(this)),n&&this.eventInstances.push(new g(this)),r&&this.eventInstances.push(new y(this))}},{key:\"stop\",value:function(){this.started=!1,this.eventInstances.forEach((function(t){return t.destroy()})),this.root=null}},{key:\"report\",value:function(){this.reportAdapter&&this.reportAdapter.apply(this,arguments)}}],[{key:\"getInstance\",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();m.instance=null;var w,k,_;if(console.log(\"Winter Is Coming!\"),!window.TEAWebviewAutoTrack){var b=null,E=function(t){b||(b=window.TEANativeReport&&\"function\"==typeof window.TEANativeReport.postMessage?function(t){window.TEANativeReport.postMessage(t)}:window.TEANativeReport&&\"function\"==typeof window.TEANativeReport?function(t){window.TEANativeReport(t)}:window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.TEANativeReport&&\"function\"==typeof window.webkit.messageHandlers.TEANativeReport.postMessage?function(t){window.webkit.messageHandlers.TEANativeReport.postMessage(t)}:function(t){}),b(t)},T=(w={page:!0,touch:!0,click:!1},k=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],a=[{event:r,is_bav:1,local_time_ms:+new Date,params:i}];console.log(a[0]),E(JSON.stringify(a))},(_=m.getInstance()).init(w,k),_);T.start(),window.TEAWebviewAutoTrack=T}}();"

.field public static final JS_CODE_MARQUEE:Ljava/lang/String; = "!function(){\"use strict\";function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if(\"string\"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if([\"LI\",\"TR\",\"DL\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaIdx\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-idx\"))return!0;return!1}function r(t){if(!t)return!1;if([\"A\",\"BUTTON\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaContainer\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-container\"))return!0;return!1}function i(t){for(var e=t;e&&!r(e);){if(\"HTML\"===e.nodeName||\"BODY\"===e.nodeName)return t;e=e.parentElement}return e||t}function o(t){for(var e=[];null!==t.parentElement;)e.push(t),t=t.parentElement;var r=[],i=[];return e.forEach((function(t){var e=function(t){if(null===t)return{str:\"\",index:0};var e=0,r=t.parentElement;if(r)for(var i=0;i<r.children.length&&r.children[i]!==t;i++)r.children[i].nodeName===t.nodeName&&e++;return{str:[t.nodeName.toLowerCase(),n(t)?\"[]\":\"\"].join(\"\"),index:e}}(t),o=e.str,a=e.index;r.unshift(o),i.unshift(a)})),{element_path:\"/\".concat(r.join(\"/\")),positions:i}}function a(t){var e={element_path:\"\",positions:[],texts:[]},n=o(t),r=n.element_path,a=n.positions,u=function(t){var e=i(t),n=[];return!function t(e){var r=function(t){var e=\"\";return 3===t.nodeType?e=t.textContent.trim():t.dataset&&t.dataset.hasOwnProperty(\"teaTitle\")||t.hasAttribute(\"data-tea-title\")?e=t.getAttribute(\"data-tea-title\"):t.hasAttribute(\"title\")?e=t.getAttribute(\"title\"):\"INPUT\"===t.nodeName&&[\"button\",\"submit\"].includes(t.getAttribute(\"type\"))?e=t.getAttribute(\"value\"):\"IMG\"===t.nodeName&&t.getAttribute(\"alt\")&&(e=t.getAttribute(\"alt\")),e.slice(0,200)}(e);if(r&&-1===n.indexOf(r)&&n.push(r),e.childNodes.length>0)for(var i=e.childNodes,o=0;o<i.length;o++)8!==i[o].nodeType&&t(i[o])}(e),n}(t);e.element_path=r,e.positions=a.map((function(t){return\"\".concat(t)})),e.texts=u;var c=i(t);if(\"A\"===c.tagName&&(e.href=c.getAttribute(\"href\")),\"IMG\"===t.tagName){var l=t.getAttribute(\"src\");l&&0===l.trim().indexOf(\"data:\")&&(l=\"\"),e.src=l}return e.page_title=document.title,e.element_id=t.id,e.element_type=t.tagName,e}var u=window.__TEA_CHUNK_MAX__||524288;function c(t){try{return new Blob([t]).size}catch(i){for(var e=t.length,n=e-1;n>=0;n--){var r=t.charCodeAt(n);r>127&&r<=2047?e++:r>2047&&r<=65535&&(e+=2),r>=56320&&r<=57343&&n--}return e}}function l(t){if(c(t)<u)return[t];var e=encodeURIComponent(t),n=Math.ceil(c(e)/u);return new Array(n).fill(\"\").map((function(t,n){return e.substr(n*u,u)}))}var f=function(t){var e=a(t),n=e.element_path,r=e.positions,i=e.texts,o=e.href,u=e.src,c=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(e,[\"element_path\",\"positions\",\"texts\",\"href\",\"src\"]),l=[].concat(r).reverse(),f=!1;if(-1!==n.indexOf(\"[]\")){f=!0;var s=!1;n.split(\"/\").reverse().forEach((function(t,e){s||-1===t.indexOf(\"[]\")||(s=!0,l[e]=\"*\")}))}var d=[\"absolute\",\"fixed\"],h=0,p=getComputedStyle(t,null).getPropertyValue(\"z-index\");\"auto\"!==p&&(h=parseInt(String(p),10));for(var m=t.parentElement;m;){var g=getComputedStyle(m,null);if(d.includes(g.getPropertyValue(\"position\"))){h+=1e4;break}m=m.parentElement}return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),{_element_path:n,element_path:\"\".concat(n,\"/*\"),positions:r.concat(\"*\"),zIndex:h,texts:i}),f?{fuzzy_positions:l.reverse().concat(\"*\")}:{}),o?{href:o}:{}),u?{src:u}:{})},s=!1,d=1,h=window.innerWidth,p=window.innerHeight,m=new Set;var g=function(t){var e=t._element_path,n=t.positions,r=t.children;t._checkList=!0;var i=e.split(\"/\").length-2;if(t.fuzzy_positions||(t.fuzzy_positions=[].concat(n)),t.fuzzy_positions[i]=\"*\",r){!function t(e){e.forEach((function(e){e.fuzzy_positions||(e.fuzzy_positions=[].concat(e.positions)),e.fuzzy_positions[i]=\"*\",e.children&&t(e.children)}))}(r)}},y=function e(n){return Array.prototype.slice.call(n,0).reduce((function(n,r){if(!r)return n;var i=r.nodeName;if(function(t){return[\"script\",\"link\",\"style\",\"embed\"].includes(t)}(i=i.toLowerCase())||function(t){var e=getComputedStyle(t,null);if(\"none\"===e.getPropertyValue(\"display\"))return!0;if(\"0\"===e.getPropertyValue(\"opacity\"))return!0;return!1}(r))return n;var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t.getBoundingClientRect().toJSON();if(1===e)return n;return Object.keys(n).reduce((function(t,r){return t[r]=Math.ceil(n[r]*e),t}),{})}(r,d);if(!function(t,e){var n=t.left,r=t.right,i=t.top,o=t.bottom,a=t.width,u=t.height,c=!(a>0&&u>0),l=getComputedStyle(e,null);if(![\"\",\"static\"].includes(l.getPropertyValue(\"position\"))){if(c&&!e.children.length)return!1;var f=l.getPropertyValue(\"z-index\");if(\"auto\"!==f&&parseInt(f,10)<0)return!1;return!0}if(c)return!1;if(n>window.innerWidth||r<0||i>window.innerHeight||o<0)return!1;return!0}(o,r))return n;o=function(t){var e={x:t.left,y:t.top,width:t.width,height:t.height};return t.top<0&&(e.y=0,e.height+=t.top),t.bottom>p&&(e.height=p-e.y),t.left<0&&(e.x=0,e.width+=t.left),t.right>h&&(e.width=h-e.x),Object.keys(e).forEach((function(t){e[t]=Math.floor(e[t])})),e}(o);var a={};if(!function(t){return[\"button\",\"select\"].includes(t)}(i)&&r.children){var u=e(r.children);u&&u.length&&(a={children:u})}var c=f(r),l=c._element_path,s=!1;if(m.has(l))s=!0;else{var y=r.parentElement;if(y){var v=y.children,b=Array.from(v).filter((function(t){return t.nodeName.toLowerCase()===i})),w=b.length;if(w>=3){var A=Array.from(r.classList),_=A.length,O=Array.from(r.children).map((function(t){return t.nodeName.toLowerCase()})).join(\",\"),x=0;Array.from(b).forEach((function(e){if(e===r)return x++,void 0;var n=!1;if(_){var i=Array.from(e.classList);A.length+i.length-new Set([].concat(t(i),t(A))).size>0&&(n=!0)}else n=!0;if(n){var o=!1;if(O)Array.from(e.children).map((function(t){return t.nodeName.toLowerCase()})).join(\",\")===O&&(o=!0);else o=!0;o&&x++}})),x>=3&&x/w>=.5&&(s=!0),s&&m.add(l)}}}return c=Object.assign(Object.assign({nodeName:i,frame:o},c),a),s&&g(c),c.children&&c.children.forEach((function(t){var e=t._element_path,n=t._checkList;m.has(e)&&!n&&g(t)})),n.push(c),n}),[])},v=function(){if(s)return;s=!0,d=function(){try{var t=window.outerWidth/window.innerWidth;if(1===t)return 1;if(t)return t;var e=document.querySelector(\'meta[name=\"viewport\"]\');if(e){var n=e.content.match(/initial-scale=(.*?)(,|$)/);if(n&&n[1]){var r=parseFloat(n[1]);if(r)return r}}}catch(t){return 1}return 1}(),h=window.innerWidth*d,p=window.innerHeight*d,m=new Set},b=function(t){return JSON.stringify(t)};if(!window.TEAWebviewInfo){var w=[],A=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(w.length)return console.log(w.length,w),b({value:w.shift(),done:!w.length});v();try{var e=y(document.querySelectorAll(\"body > *\")),n={page:window.location.href,info:e},r=b(n);if(console.log(r),!t)return r;if(1===(w=l(r)).length)return w.shift();return console.log(w.length,w),b({value:w.shift(),done:!1})}catch(t){console.log(t)}return\"\"};A.version=\"1.2.0\",window.TEAWebviewInfo=A}}();\n"

.field public static final JS_URL_PREFIX:Ljava/lang/String; = "javascript:"

.field public static final loggerTags:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public static constructor <clinit>()V
    .locals 1

    const-string v0, "WebViewJsUtil"

    invoke-static {v0}, Ljava/util/Collections;->singletonList(Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    sput-object v0, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static synthetic access$000()Ljava/util/List;
    .locals 1

    sget-object v0, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    return-object v0
.end method

.method public static synthetic access$100(Ljava/lang/String;)V
    .locals 0

    invoke-static {p0}, Lcom/bytedance/applog/util/WebViewJsUtil;->sendWebClick(Ljava/lang/String;)V

    return-void
.end method

.method public static synthetic access$300(Ljava/lang/String;Ljava/lang/String;ZLorg/json/JSONObject;)Lcom/bytedance/bdtracker/q3;
    .locals 0

    invoke-static {p0, p1, p2, p3}, Lcom/bytedance/applog/util/WebViewJsUtil;->create(Ljava/lang/String;Ljava/lang/String;ZLorg/json/JSONObject;)Lcom/bytedance/bdtracker/q3;

    move-result-object p0

    return-object p0
.end method

.method public static create(Ljava/lang/String;Ljava/lang/String;ZLorg/json/JSONObject;)Lcom/bytedance/bdtracker/q3;
    .locals 2

    new-instance v0, Lcom/bytedance/bdtracker/q3;

    const/4 v1, 0x0

    if-eqz p3, :cond_0

    invoke-virtual {p3}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object p3

    goto :goto_0

    :cond_0
    move-object p3, v1

    :goto_0
    invoke-direct {v0, v1, p0, p2, p3}, Lcom/bytedance/bdtracker/q3;-><init>(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V

    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p0

    if-nez p0, :cond_1

    :try_start_0
    invoke-static {p1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide p0

    invoke-virtual {v0, p0, p1}, Lcom/bytedance/bdtracker/j3;->a(J)V
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object p1

    sget-object p2, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    const/4 p3, 0x1

    new-array p3, p3, [Ljava/lang/Object;

    const/4 v1, 0x0

    aput-object p0, p3, v1

    const-string p0, "Create eventV3 failed"

    invoke-interface {p1, p2, p0, p3}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :cond_1
    :goto_1
    return-object v0
.end method

.method public static evaluateJavascript(Landroid/view/View;Ljava/lang/String;)V
    .locals 1

    new-instance v0, Lcom/bytedance/applog/util/WebViewJsUtil$c;

    invoke-direct {v0}, Lcom/bytedance/applog/util/WebViewJsUtil$c;-><init>()V

    invoke-static {p0, p1, v0}, Lcom/bytedance/applog/util/WebViewJsUtil;->evaluateJavascript(Landroid/view/View;Ljava/lang/String;Lcom/bytedance/applog/util/WebViewJsUtil$g;)V

    return-void
.end method

.method public static evaluateJavascript(Landroid/view/View;Ljava/lang/String;Lcom/bytedance/applog/util/WebViewJsUtil$g;)V
    .locals 2

    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->a(Landroid/view/View;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x13

    if-lt v0, v1, :cond_2

    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->b(Landroid/view/View;)Z

    move-result v0

    if-eqz v0, :cond_1

    check-cast p0, Lcom/tencent/smtt/sdk/WebView;

    new-instance v0, Lcom/bytedance/applog/util/WebViewJsUtil$d;

    invoke-direct {v0, p2}, Lcom/bytedance/applog/util/WebViewJsUtil$d;-><init>(Lcom/bytedance/applog/util/WebViewJsUtil$g;)V

    invoke-virtual {p0, p1, v0}, Lcom/tencent/smtt/sdk/WebView;->evaluateJavascript(Ljava/lang/String;Lcom/tencent/smtt/sdk/ValueCallback;)V

    goto :goto_0

    :cond_1
    check-cast p0, Landroid/webkit/WebView;

    new-instance v0, Lcom/bytedance/applog/util/WebViewJsUtil$e;

    invoke-direct {v0, p2}, Lcom/bytedance/applog/util/WebViewJsUtil$e;-><init>(Lcom/bytedance/applog/util/WebViewJsUtil$g;)V

    invoke-virtual {p0, p1, v0}, Landroid/webkit/WebView;->evaluateJavascript(Ljava/lang/String;Landroid/webkit/ValueCallback;)V

    goto :goto_0

    :cond_2
    invoke-static {p1}, Lcom/bytedance/applog/util/WebViewJsUtil;->getJsCodeUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    const/4 p2, 0x0

    invoke-static {p0, p1, p2}, Lcom/bytedance/applog/util/WebViewJsUtil;->loadUrl(Landroid/view/View;Ljava/lang/String;Ljava/util/Map;)V

    :goto_0
    return-void
.end method

.method public static getJsCodeUrl(Ljava/lang/String;)Ljava/lang/String;
    .locals 2

    const-string v0, "javascript:"

    invoke-static {v0}, Lcom/bytedance/bdtracker/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    const-string p0, ""

    :cond_0
    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method public static getWebInfo(Landroid/webkit/WebView;Landroid/os/Handler;)V
    .locals 2

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x13

    if-lt v0, v1, :cond_0

    const-string v0, "TEAWebviewInfo();"

    invoke-static {v0}, Lcom/bytedance/applog/util/WebViewJsUtil;->getJsCodeUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Lcom/bytedance/applog/util/WebViewJsUtil$a;

    invoke-direct {v1, p1, p0}, Lcom/bytedance/applog/util/WebViewJsUtil$a;-><init>(Landroid/os/Handler;Landroid/webkit/WebView;)V

    invoke-virtual {p0, v0, v1}, Landroid/webkit/WebView;->evaluateJavascript(Ljava/lang/String;Landroid/webkit/ValueCallback;)V

    goto :goto_0

    :cond_0
    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object p0

    sget-object p1, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Object;

    const-string v1, "WebViewJsUtil Doesn\'t support evaluateJavascript, can\'t get return value "

    invoke-interface {p0, p1, v1, v0}, Lcom/bytedance/applog/log/IAppLogLogger;->warn(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public static injectCollectJs(Landroid/view/View;Ljava/lang/String;)V
    .locals 5

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object v0

    sget-object v1, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p0, v2, v3

    const-string v4, "WebViewJsUtil collect js to: {}"

    invoke-interface {v0, v1, v4, v2}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v0, Lcom/bytedance/applog/util/WebViewJsUtil$b;

    invoke-direct {v0}, Lcom/bytedance/applog/util/WebViewJsUtil$b;-><init>()V

    invoke-static {v0}, Lcom/bytedance/bdtracker/b;->a(Lcom/bytedance/bdtracker/b$d;)Z

    move-result v0

    const-string v1, "!function(){\"use strict\";function t(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if(e&&(\"object\"==typeof e||\"function\"==typeof e))return e;return function(t){if(void 0===t)throw new ReferenceError(\"this hasn\'t been initialised - super() hasn\'t been called\");return t}(t)}function u(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=i(t);if(e){var a=i(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return o(this,n)}}function c(t,e,n){return(c=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(!r)return;var a=Object.getOwnPropertyDescriptor(r,e);if(a.get)return a.get.call(n);return a.value})(t,e,n||t)}function s(t){if([\"LI\",\"TR\",\"DL\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaIdx\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-idx\"))return!0;return!1}function l(t){if(!t)return!1;if([\"A\",\"BUTTON\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaContainer\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-container\"))return!0;return!1}function h(t){for(var e=t;e&&!l(e);){if(\"HTML\"===e.nodeName||\"BODY\"===e.nodeName)return t;e=e.parentElement}return e||t}function f(t){for(var e=[];null!==t.parentElement;)e.push(t),t=t.parentElement;var n=[],r=[];return e.forEach((function(t){var e=function(t){if(null===t)return{str:\"\",index:0};var e=0,n=t.parentElement;if(n)for(var r=0;r<n.children.length&&n.children[r]!==t;r++)n.children[r].nodeName===t.nodeName&&e++;return{str:[t.nodeName.toLowerCase(),s(t)?\"[]\":\"\"].join(\"\"),index:e}}(t),i=e.str,a=e.index;n.unshift(i),r.unshift(a)})),{element_path:\"/\".concat(n.join(\"/\")),positions:r}}function d(t){var e={element_path:\"\",positions:[],texts:[]},n=f(t),r=n.element_path,i=n.positions,a=function(t){var e=h(t),n=[];return!function t(e){var r=function(t){var e=\"\";return 3===t.nodeType?e=t.textContent.trim():t.dataset&&t.dataset.hasOwnProperty(\"teaTitle\")||t.hasAttribute(\"data-tea-title\")?e=t.getAttribute(\"data-tea-title\"):t.hasAttribute(\"title\")?e=t.getAttribute(\"title\"):\"INPUT\"===t.nodeName&&[\"button\",\"submit\"].includes(t.getAttribute(\"type\"))?e=t.getAttribute(\"value\"):\"IMG\"===t.nodeName&&t.getAttribute(\"alt\")&&(e=t.getAttribute(\"alt\")),e.slice(0,200)}(e);if(r&&-1===n.indexOf(r)&&n.push(r),e.childNodes.length>0)for(var i=e.childNodes,a=0;a<i.length;a++)8!==i[a].nodeType&&t(i[a])}(e),n}(t);e.element_path=r,e.positions=i.map((function(t){return\"\".concat(t)})),e.texts=a;var o=h(t);if(\"A\"===o.tagName&&(e.href=o.getAttribute(\"href\")),\"IMG\"===t.tagName){var u=t.getAttribute(\"src\");u&&0===u.trim().indexOf(\"data:\")&&(u=\"\"),e.src=u}return e.page_title=document.title,e.element_id=t.id,e.element_type=t.tagName,e}var p=function(){function e(n,r){var i=this;t(this,e),this.handler=function(t){var e=(t=i.getEvent(t)).target;if(!i.checkShouldTrackElement(e)||i.checkShouldIgnore(e))return;var n=i.getPositionData(e),r=i.getEventData(t,n),a=i.getElementData(e),o=i.getAllData(r,a,{element_width:Math.floor(n.element_width),element_height:Math.floor(n.element_height)});i.report(o)},this.info=n,this.autoTrack=r,this.listen()}return n(e,[{key:\"listen\",value:function(){this.autoTrack.root.addEventListener(this.info.eventType,this.handler,!0)}},{key:\"_checkShouldTrackElement\",value:function(t){return function(t){var e=window.innerHeight,n=window.innerWidth;if(1!==t.nodeType)return!1;if(function(t){for(var e=t.parentElement,n=!1;e;)\"svg\"===e.tagName.toLowerCase()?(e=null,n=!0):e=e.parentElement;return n}(t))return!1;if([\"HTML\",\"BODY\"].includes(t.tagName.toUpperCase()))return!1;var r=t;if(\"none\"===r.style.display)return!1;if(l(r))return!0;if(!function(t){if(t.children.length>0){var e=t.children;if([].slice.call(e).some((function(t){return t.children.length>0})))return!1;return!0}return!0}(r))return!1;if(r.clientHeight*r.clientWidth>.5*e*n)return!1;return!0}(t)}},{key:\"checkShouldTrackElement\",value:function(t){return!0}},{key:\"checkShouldIgnore\",value:function(t){return function(t){for(var e=t;e&&e.parentNode;){if(e.hasAttribute(\"data-tea-ignore\"))return!0;if(\"HTML\"===e.nodeName||\"body\"===e.nodeName)return!1;e=e.parentNode}return!1}(t)}},{key:\"getEvent\",value:function(t){return t}},{key:\"getEventData\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clientX,r=t.clientY,i=e.left,a=e.top;return{touch_x:Math.floor(n-i),touch_y:Math.floor(r-a)}}},{key:\"getElementData\",value:function(t){return d(t)}},{key:\"getPositionData\",value:function(t){if(!t)return;var e=t.getBoundingClientRect(),n=e.width,r=e.height;return{left:e.left,top:e.top,element_width:n,element_height:r}}},{key:\"getAllData\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.assign(Object.assign(Object.assign(Object.assign({},t),e),n),{is_html:1,page_key:window.location.href})}},{key:\"report\",value:function(t){this.autoTrack.report(this.info.eventName,t)}},{key:\"destroy\",value:function(){this.autoTrack.root.removeEventListener(this.info.eventName,this.handler,!0),this.autoTrack=null}}]),e}(),v=function(e){r(o,e);var a=u(o);function o(e){var n;t(this,o),(n=a.call(this,{eventName:\"bav2b_page\"},e)).handler=function(t){if(n.checkHref())return;n._handler()},n._handler=function(){n.setHref();var t=n.getAllData();n.report(t)},n._listen();try{\"loading\"===document.readyState?document.addEventListener(\"DOMContentLoaded\",n._handler):setTimeout(n._handler)}catch(t){}return n}return n(o,[{key:\"listen\",value:function(){}},{key:\"_listen\",value:function(){var t=this;this._oldPushState=history.pushState,this._oldReplaceState=history.replaceState,history.pushState=function(){try{for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t._oldPushState).call.apply(e,[history].concat(r))}finally{t._handler()}},history.replaceState=function(){try{for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t._oldReplaceState).call.apply(e,[history].concat(r))}finally{t._handler()}},window.addEventListener(\"hashchange\",this.handler,!0),window.addEventListener(\"popstate\",this.handler,!0)}},{key:\"setHref\",value:function(t){this._currentHref=t||window.location.href}},{key:\"checkHref\",value:function(){return this._currentHref===window.location.href}},{key:\"getAllData\",value:function(){return Object.assign(Object.assign({},c(i(o.prototype),\"getAllData\",this).call(this)),{is_bav:1,page_key:this._currentHref,refer_page_key:document.referrer,page_title:document.title,page_path:this._currentHref,referrer_page_path:document.referrer})}},{key:\"destroy\",value:function(){window.removeEventListener(\"popstate\",this.handler,!0),window.removeEventListener(\"hashchange\",this.handler,!0),history.pushState=this._oldPushState,history.replaceState=this._oldReplaceState,this._oldPushState=null,this._oldReplaceState=null,this.autoTrack=null}}]),o}(p),g=function(e){r(o,e);var a=u(o);function o(e){return t(this,o),a.call(this,{eventType:\"click\",eventName:\"bav2b_click\"},e)}return n(o,[{key:\"checkShouldTrackElement\",value:function(t){return c(i(o.prototype),\"_checkShouldTrackElement\",this).call(this,t)}}]),o}(p),y=function(e){r(o,e);var a=u(o);function o(e){var n;return t(this,o),(n=a.call(this,{eventName:\"bav2b_click\"},e)).startHandler=function(t){var e=n.autoTrack.root,r=!1,i=function(){r=!0};e.addEventListener(\"touchmove\",i,!0),e.addEventListener(\"touchend\",(function t(a){r||n.handler(a),e.removeEventListener(\"touchmove\",i,!0),e.removeEventListener(\"touchend\",t,!0)}),!0)},n._listen(),n}return n(o,[{key:\"listen\",value:function(){}},{key:\"_listen\",value:function(){this.autoTrack.root.addEventListener(\"touchstart\",this.startHandler,!0)}},{key:\"getEvent\",value:function(t){return t.changedTouches[0]}},{key:\"checkShouldTrackElement\",value:function(t){if(!c(i(o.prototype),\"_checkShouldTrackElement\",this).call(this,t))return!1;if(\"input\"===t.nodeName.toLowerCase()&&[\"text\",\"password\",\"email\",\"tel\",\"number\",\"url\"].includes(t.type))return!1;return!0}},{key:\"destroy\",value:function(){this.autoTrack.root.removeEventListener(\"touchstart\",this.startHandler,!0),this.autoTrack=null}}]),o}(p),m=function(){function e(){t(this,e),this.version=\"1.2.1\",this.options={page:!1,touch:!1,click:!1},this.root=document,this.eventInstances=[],this.started=!1}return n(e,[{key:\"init\",value:function(t,e){this.options=Object.assign(Object.assign({},this.options),t),this.reportAdapter=e}},{key:\"start\",value:function(){if(this.started)return;this.started=!0;var t=this.options,e=t.page,n=t.click,r=t.touch;e&&this.eventInstances.push(new v(this)),n&&this.eventInstances.push(new g(this)),r&&this.eventInstances.push(new y(this))}},{key:\"stop\",value:function(){this.started=!1,this.eventInstances.forEach((function(t){return t.destroy()})),this.root=null}},{key:\"report\",value:function(){this.reportAdapter&&this.reportAdapter.apply(this,arguments)}}],[{key:\"getInstance\",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();m.instance=null;var w,k,_;if(console.log(\"Winter Is Coming!\"),!window.TEAWebviewAutoTrack){var b=null,E=function(t){b||(b=window.TEANativeReport&&\"function\"==typeof window.TEANativeReport.postMessage?function(t){window.TEANativeReport.postMessage(t)}:window.TEANativeReport&&\"function\"==typeof window.TEANativeReport?function(t){window.TEANativeReport(t)}:window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.TEANativeReport&&\"function\"==typeof window.webkit.messageHandlers.TEANativeReport.postMessage?function(t){window.webkit.messageHandlers.TEANativeReport.postMessage(t)}:function(t){}),b(t)},T=(w={page:!0,touch:!0,click:!1},k=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],a=[{event:r,is_bav:1,local_time_ms:+new Date,params:i}];console.log(a[0]),E(JSON.stringify(a))},(_=m.getInstance()).init(w,k),_);T.start(),window.TEAWebviewAutoTrack=T}}();"

    if-nez v0, :cond_0

    const-string v0, "!function(){\"use strict\";function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if(\"string\"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if([\"LI\",\"TR\",\"DL\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaIdx\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-idx\"))return!0;return!1}function r(t){if(!t)return!1;if([\"A\",\"BUTTON\"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty(\"teaContainer\"))return!0;if(t.hasAttribute&&t.hasAttribute(\"data-tea-container\"))return!0;return!1}function i(t){for(var e=t;e&&!r(e);){if(\"HTML\"===e.nodeName||\"BODY\"===e.nodeName)return t;e=e.parentElement}return e||t}function o(t){for(var e=[];null!==t.parentElement;)e.push(t),t=t.parentElement;var r=[],i=[];return e.forEach((function(t){var e=function(t){if(null===t)return{str:\"\",index:0};var e=0,r=t.parentElement;if(r)for(var i=0;i<r.children.length&&r.children[i]!==t;i++)r.children[i].nodeName===t.nodeName&&e++;return{str:[t.nodeName.toLowerCase(),n(t)?\"[]\":\"\"].join(\"\"),index:e}}(t),o=e.str,a=e.index;r.unshift(o),i.unshift(a)})),{element_path:\"/\".concat(r.join(\"/\")),positions:i}}function a(t){var e={element_path:\"\",positions:[],texts:[]},n=o(t),r=n.element_path,a=n.positions,u=function(t){var e=i(t),n=[];return!function t(e){var r=function(t){var e=\"\";return 3===t.nodeType?e=t.textContent.trim():t.dataset&&t.dataset.hasOwnProperty(\"teaTitle\")||t.hasAttribute(\"data-tea-title\")?e=t.getAttribute(\"data-tea-title\"):t.hasAttribute(\"title\")?e=t.getAttribute(\"title\"):\"INPUT\"===t.nodeName&&[\"button\",\"submit\"].includes(t.getAttribute(\"type\"))?e=t.getAttribute(\"value\"):\"IMG\"===t.nodeName&&t.getAttribute(\"alt\")&&(e=t.getAttribute(\"alt\")),e.slice(0,200)}(e);if(r&&-1===n.indexOf(r)&&n.push(r),e.childNodes.length>0)for(var i=e.childNodes,o=0;o<i.length;o++)8!==i[o].nodeType&&t(i[o])}(e),n}(t);e.element_path=r,e.positions=a.map((function(t){return\"\".concat(t)})),e.texts=u;var c=i(t);if(\"A\"===c.tagName&&(e.href=c.getAttribute(\"href\")),\"IMG\"===t.tagName){var l=t.getAttribute(\"src\");l&&0===l.trim().indexOf(\"data:\")&&(l=\"\"),e.src=l}return e.page_title=document.title,e.element_id=t.id,e.element_type=t.tagName,e}var u=window.__TEA_CHUNK_MAX__||524288;function c(t){try{return new Blob([t]).size}catch(i){for(var e=t.length,n=e-1;n>=0;n--){var r=t.charCodeAt(n);r>127&&r<=2047?e++:r>2047&&r<=65535&&(e+=2),r>=56320&&r<=57343&&n--}return e}}function l(t){if(c(t)<u)return[t];var e=encodeURIComponent(t),n=Math.ceil(c(e)/u);return new Array(n).fill(\"\").map((function(t,n){return e.substr(n*u,u)}))}var f=function(t){var e=a(t),n=e.element_path,r=e.positions,i=e.texts,o=e.href,u=e.src,c=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(e,[\"element_path\",\"positions\",\"texts\",\"href\",\"src\"]),l=[].concat(r).reverse(),f=!1;if(-1!==n.indexOf(\"[]\")){f=!0;var s=!1;n.split(\"/\").reverse().forEach((function(t,e){s||-1===t.indexOf(\"[]\")||(s=!0,l[e]=\"*\")}))}var d=[\"absolute\",\"fixed\"],h=0,p=getComputedStyle(t,null).getPropertyValue(\"z-index\");\"auto\"!==p&&(h=parseInt(String(p),10));for(var m=t.parentElement;m;){var g=getComputedStyle(m,null);if(d.includes(g.getPropertyValue(\"position\"))){h+=1e4;break}m=m.parentElement}return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),{_element_path:n,element_path:\"\".concat(n,\"/*\"),positions:r.concat(\"*\"),zIndex:h,texts:i}),f?{fuzzy_positions:l.reverse().concat(\"*\")}:{}),o?{href:o}:{}),u?{src:u}:{})},s=!1,d=1,h=window.innerWidth,p=window.innerHeight,m=new Set;var g=function(t){var e=t._element_path,n=t.positions,r=t.children;t._checkList=!0;var i=e.split(\"/\").length-2;if(t.fuzzy_positions||(t.fuzzy_positions=[].concat(n)),t.fuzzy_positions[i]=\"*\",r){!function t(e){e.forEach((function(e){e.fuzzy_positions||(e.fuzzy_positions=[].concat(e.positions)),e.fuzzy_positions[i]=\"*\",e.children&&t(e.children)}))}(r)}},y=function e(n){return Array.prototype.slice.call(n,0).reduce((function(n,r){if(!r)return n;var i=r.nodeName;if(function(t){return[\"script\",\"link\",\"style\",\"embed\"].includes(t)}(i=i.toLowerCase())||function(t){var e=getComputedStyle(t,null);if(\"none\"===e.getPropertyValue(\"display\"))return!0;if(\"0\"===e.getPropertyValue(\"opacity\"))return!0;return!1}(r))return n;var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t.getBoundingClientRect().toJSON();if(1===e)return n;return Object.keys(n).reduce((function(t,r){return t[r]=Math.ceil(n[r]*e),t}),{})}(r,d);if(!function(t,e){var n=t.left,r=t.right,i=t.top,o=t.bottom,a=t.width,u=t.height,c=!(a>0&&u>0),l=getComputedStyle(e,null);if(![\"\",\"static\"].includes(l.getPropertyValue(\"position\"))){if(c&&!e.children.length)return!1;var f=l.getPropertyValue(\"z-index\");if(\"auto\"!==f&&parseInt(f,10)<0)return!1;return!0}if(c)return!1;if(n>window.innerWidth||r<0||i>window.innerHeight||o<0)return!1;return!0}(o,r))return n;o=function(t){var e={x:t.left,y:t.top,width:t.width,height:t.height};return t.top<0&&(e.y=0,e.height+=t.top),t.bottom>p&&(e.height=p-e.y),t.left<0&&(e.x=0,e.width+=t.left),t.right>h&&(e.width=h-e.x),Object.keys(e).forEach((function(t){e[t]=Math.floor(e[t])})),e}(o);var a={};if(!function(t){return[\"button\",\"select\"].includes(t)}(i)&&r.children){var u=e(r.children);u&&u.length&&(a={children:u})}var c=f(r),l=c._element_path,s=!1;if(m.has(l))s=!0;else{var y=r.parentElement;if(y){var v=y.children,b=Array.from(v).filter((function(t){return t.nodeName.toLowerCase()===i})),w=b.length;if(w>=3){var A=Array.from(r.classList),_=A.length,O=Array.from(r.children).map((function(t){return t.nodeName.toLowerCase()})).join(\",\"),x=0;Array.from(b).forEach((function(e){if(e===r)return x++,void 0;var n=!1;if(_){var i=Array.from(e.classList);A.length+i.length-new Set([].concat(t(i),t(A))).size>0&&(n=!0)}else n=!0;if(n){var o=!1;if(O)Array.from(e.children).map((function(t){return t.nodeName.toLowerCase()})).join(\",\")===O&&(o=!0);else o=!0;o&&x++}})),x>=3&&x/w>=.5&&(s=!0),s&&m.add(l)}}}return c=Object.assign(Object.assign({nodeName:i,frame:o},c),a),s&&g(c),c.children&&c.children.forEach((function(t){var e=t._element_path,n=t._checkList;m.has(e)&&!n&&g(t)})),n.push(c),n}),[])},v=function(){if(s)return;s=!0,d=function(){try{var t=window.outerWidth/window.innerWidth;if(1===t)return 1;if(t)return t;var e=document.querySelector(\'meta[name=\"viewport\"]\');if(e){var n=e.content.match(/initial-scale=(.*?)(,|$)/);if(n&&n[1]){var r=parseFloat(n[1]);if(r)return r}}}catch(t){return 1}return 1}(),h=window.innerWidth*d,p=window.innerHeight*d,m=new Set},b=function(t){return JSON.stringify(t)};if(!window.TEAWebviewInfo){var w=[],A=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(w.length)return console.log(w.length,w),b({value:w.shift(),done:!w.length});v();try{var e=y(document.querySelectorAll(\"body > *\")),n={page:window.location.href,info:e},r=b(n);if(console.log(r),!t)return r;if(1===(w=l(r)).length)return w.shift();return console.log(w.length,w),b({value:w.shift(),done:!1})}catch(t){console.log(t)}return\"\"};A.version=\"1.2.0\",window.TEAWebviewInfo=A}}();\n"

    goto :goto_0

    :cond_0
    move-object v0, v1

    :goto_0
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object v1

    sget-object v2, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    new-array v3, v3, [Ljava/lang/Object;

    const-string v4, "WebViewJsUtil \u5708\u9009"

    invoke-interface {v1, v2, v4, v3}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :cond_1
    invoke-static {v0}, Lcom/bytedance/applog/util/WebViewJsUtil;->getJsCodeUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_2

    return-void

    :cond_2
    invoke-static {p0, v0}, Lcom/bytedance/applog/util/WebViewJsUtil;->evaluateJavascript(Landroid/view/View;Ljava/lang/String;)V

    return-void
.end method

.method public static injectNativeReportCallback(Landroid/view/View;)V
    .locals 9
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "AddJavascriptInterface"
        }
    .end annotation

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object v0

    sget-object v1, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    const/4 v2, 0x1

    new-array v3, v2, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p0, v3, v4

    const-string v5, "WebViewJsUtil add interface:TEANativeReport to: {}"

    invoke-interface {v0, v1, v5, v3}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v0, Lcom/bytedance/applog/util/WebViewJsUtil$h;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/bytedance/applog/util/WebViewJsUtil$h;-><init>(Lcom/bytedance/applog/util/WebViewJsUtil$a;)V

    const-string v1, "TEANativeReport"

    .line 1
    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->a(Landroid/view/View;)Z

    move-result v3

    if-nez v3, :cond_0

    goto :goto_0

    :cond_0
    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const-string v5, "addJavascriptInterface"

    const/4 v6, 0x2

    :try_start_1
    new-array v7, v6, [Ljava/lang/Class;

    const-class v8, Ljava/lang/Object;

    aput-object v8, v7, v4

    const-class v8, Ljava/lang/String;

    aput-object v8, v7, v2

    invoke-virtual {v3, v5, v7}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v3

    new-array v5, v6, [Ljava/lang/Object;

    aput-object v0, v5, v4

    aput-object v1, v5, v2

    invoke-virtual {v3, p0, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object v0

    const-string v1, "JavaScriptUtils"

    invoke-static {v1}, Ljava/util/Collections;->singletonList(Ljava/lang/Object;)Ljava/util/List;

    move-result-object v1

    new-array v2, v4, [Ljava/lang/Object;

    const-string v3, "addJavascriptInterface failed"

    invoke-interface {v0, v1, v3, p0, v2}, Lcom/bytedance/applog/log/IAppLogLogger;->error(Ljava/util/List;Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public static loadData(Landroid/view/View;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 8

    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->a(Landroid/view/View;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x1

    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const-string v3, "loadData"

    const/4 v4, 0x3

    :try_start_1
    new-array v5, v4, [Ljava/lang/Class;

    const-class v6, Ljava/lang/String;

    aput-object v6, v5, v0

    const-class v6, Ljava/lang/String;

    aput-object v6, v5, v1

    const-class v6, Ljava/lang/String;

    const/4 v7, 0x2

    aput-object v6, v5, v7

    invoke-virtual {v2, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    new-array v3, v4, [Ljava/lang/Object;

    aput-object p1, v3, v0

    aput-object p2, v3, v1

    aput-object p3, v3, v7

    invoke-virtual {v2, p0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object p1

    sget-object p2, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    new-array p3, v1, [Ljava/lang/Object;

    aput-object p0, p3, v0

    const-string p0, "Reflect loadData failed"

    invoke-interface {p1, p2, p0, p3}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public static loadDataWithBaseURL(Landroid/view/View;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 10

    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->a(Landroid/view/View;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x1

    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const-string v3, "loadDataWithBaseURL"

    const/4 v4, 0x5

    :try_start_1
    new-array v5, v4, [Ljava/lang/Class;

    const-class v6, Ljava/lang/String;

    aput-object v6, v5, v0

    const-class v6, Ljava/lang/String;

    aput-object v6, v5, v1

    const-class v6, Ljava/lang/String;

    const/4 v7, 0x2

    aput-object v6, v5, v7

    const-class v6, Ljava/lang/String;

    const/4 v8, 0x3

    aput-object v6, v5, v8

    const-class v6, Ljava/lang/String;

    const/4 v9, 0x4

    aput-object v6, v5, v9

    invoke-virtual {v2, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    new-array v3, v4, [Ljava/lang/Object;

    aput-object p1, v3, v0

    aput-object p2, v3, v1

    aput-object p3, v3, v7

    aput-object p4, v3, v8

    aput-object p5, v3, v9

    invoke-virtual {v2, p0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object p1

    sget-object p2, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    new-array p3, v1, [Ljava/lang/Object;

    aput-object p0, p3, v0

    const-string p0, "Reflect loadDataWithBaseURL failed"

    invoke-interface {p1, p2, p0, p3}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public static loadUrl(Landroid/view/View;Ljava/lang/String;Ljava/util/Map;)V
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/view/View;",
            "Ljava/lang/String;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    invoke-static {p0}, Lcom/bytedance/bdtracker/z3;->a(Landroid/view/View;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x1

    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const-string v3, "loadUrl"

    const/4 v4, 0x2

    :try_start_1
    new-array v5, v4, [Ljava/lang/Class;

    const-class v6, Ljava/lang/String;

    aput-object v6, v5, v0

    const-class v6, Ljava/util/Map;

    aput-object v6, v5, v1

    invoke-virtual {v2, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    new-array v3, v4, [Ljava/lang/Object;

    aput-object p1, v3, v0

    aput-object p2, v3, v1

    invoke-virtual {v2, p0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object p1

    sget-object p2, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    new-array v1, v1, [Ljava/lang/Object;

    aput-object p0, v1, v0

    const-string p0, "Reflect loadUrl failed"

    invoke-interface {p1, p2, p0, v1}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method public static sendWebClick(Ljava/lang/String;)V
    .locals 8

    const/4 v0, 0x0

    const/4 v1, 0x1

    :try_start_0
    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2, p0}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    move p0, v0

    :goto_0
    invoke-virtual {v2}, Lorg/json/JSONArray;->length()I

    move-result v3

    if-ge p0, v3, :cond_2

    invoke-virtual {v2, p0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "event"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "local_time_ms"

    invoke-virtual {v3, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "is_bav"

    invoke-virtual {v3, v6}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v6

    if-ne v6, v1, :cond_0

    move v6, v1

    goto :goto_1

    :cond_0
    move v6, v0

    :goto_1
    const-string v7, "params"

    invoke-virtual {v3, v7}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v3

    invoke-static {v4}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v7

    if-nez v7, :cond_1

    new-instance v7, Lcom/bytedance/applog/util/WebViewJsUtil$f;

    invoke-direct {v7, v4, v5, v6, v3}, Lcom/bytedance/applog/util/WebViewJsUtil$f;-><init>(Ljava/lang/String;Ljava/lang/String;ZLorg/json/JSONObject;)V

    sget-object v3, Lcom/bytedance/bdtracker/b;->a:Lcom/bytedance/bdtracker/b$d;

    invoke-static {v7, v3}, Lcom/bytedance/bdtracker/b;->a(Lcom/bytedance/bdtracker/b$e;Lcom/bytedance/bdtracker/b$d;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_1
    add-int/lit8 p0, p0, 0x1

    goto :goto_0

    :catchall_0
    move-exception p0

    invoke-static {}, Lcom/bytedance/applog/log/LoggerImpl;->global()Lcom/bytedance/applog/log/IAppLogLogger;

    move-result-object v2

    sget-object v3, Lcom/bytedance/applog/util/WebViewJsUtil;->loggerTags:Ljava/util/List;

    new-array v1, v1, [Ljava/lang/Object;

    aput-object p0, v1, v0

    const-string p0, "sendWebClick failed"

    invoke-interface {v2, v3, p0, v1}, Lcom/bytedance/applog/log/IAppLogLogger;->debug(Ljava/util/List;Ljava/lang/String;[Ljava/lang/Object;)V

    :cond_2
    return-void
.end method